prisma: init at 5.18.0

+129 -114
+2
nixos/doc/manual/release-notes/rl-2411.section.md
··· 233 233 and `nodePackages.vscode-json-languageserver-bin` were dropped due to an unmaintained upstream. 234 234 The `vscode-langservers-extracted` package is a maintained drop-in replacement. 235 235 236 + - `nodePackages.prisma` has been replaced by `prisma`. 237 + 236 238 - `fetchNextcloudApp` has been rewritten to use `fetchurl` rather than 237 239 `fetchzip`. This invalidates all existing hashes but you can restore the old 238 240 behavior by passing it `unpack = true`.
+4 -2
pkgs/applications/office/documenso/default.nix
··· 1 1 { lib 2 2 , fetchFromGitHub 3 3 , buildNpmPackage 4 - , nodePackages 4 + , prisma 5 5 , nix-update-script 6 6 }: 7 7 let ··· 18 18 hash = "sha256-uKOJVZ0GRHo/CYvd/Ix/tq1WDhutRji1tSGdcITsNlo="; 19 19 }; 20 20 21 + nativeBuildInputs = [ prisma ]; 22 + 21 23 preBuild = '' 22 24 # somehow for linux, npm is not finding the prisma package with the 23 25 # packages installed with the lockfile. 24 26 # This generates a prisma version incompatibility warning and is a kludge 25 27 # until the upstream package-lock is modified. 26 - ${nodePackages.prisma}/bin/prisma generate 28 + prisma generate 27 29 ''; 28 30 29 31 npmDepsHash = "sha256-+JbvFMi8xoyxkuL9k96K1Vq0neciCGkkyZUPd15ES2E=";
+101
pkgs/by-name/pr/prisma/package.nix
··· 1 + { 2 + lib, 3 + fetchFromGitHub, 4 + stdenv, 5 + nodejs, 6 + pnpm_8, 7 + prisma-engines, 8 + jq, 9 + makeWrapper, 10 + moreutils, 11 + callPackage, 12 + }: 13 + 14 + stdenv.mkDerivation (finalAttrs: { 15 + pname = "prisma"; 16 + version = "5.18.0"; 17 + 18 + src = fetchFromGitHub { 19 + owner = "prisma"; 20 + repo = "prisma"; 21 + rev = finalAttrs.version; 22 + hash = "sha256-BLD2nKryigXr03BCgGwb3PnCcBLMyDfSFb9Snj0VPKI="; 23 + }; 24 + 25 + nativeBuildInputs = [ 26 + nodejs 27 + pnpm_8.configHook 28 + jq 29 + makeWrapper 30 + moreutils 31 + ]; 32 + 33 + pnpmDeps = pnpm_8.fetchDeps { 34 + inherit (finalAttrs) pname version src; 35 + hash = "sha256-lgdJk7HCfX3cAvdEI8xG/IVBiLWezdUN0q+e/0LtVUQ="; 36 + }; 37 + 38 + patchPhase = '' 39 + runHook prePatch 40 + 41 + for package in packages/*; do 42 + jq --arg version $version '.version = $version' $package/package.json | sponge $package/package.json 43 + done 44 + 45 + runHook postPatch 46 + ''; 47 + 48 + buildPhase = '' 49 + runHook preBuild 50 + 51 + pnpm build 52 + 53 + runHook postBuild 54 + ''; 55 + 56 + # FIXME: Use pnpm deploy: https://github.com/pnpm/pnpm/issues/5315 57 + installPhase = '' 58 + runHook preInstall 59 + 60 + mkdir -p $out/lib/prisma 61 + 62 + # Fetch CLI workspace dependencies 63 + deps_json=$(pnpm list --filter ./packages/cli --prod --depth Infinity --json) 64 + deps=$(jq -r '[.. | strings | select(startswith("link:../")) | sub("^link:../"; "")] | unique[]' <<< "$deps_json") 65 + 66 + # Remove unnecessary external dependencies 67 + rm -rf node_modules 68 + pnpm install --offline --ignore-scripts --frozen-lockfile --prod --filter ./packages/cli 69 + cp -r node_modules $out/lib/prisma 70 + 71 + # Only install cli and its workspace dependencies 72 + for package in cli $deps; do 73 + filename=$(npm pack --json ./packages/$package | jq -r '.[].filename') 74 + mkdir -p $out/lib/prisma/packages/$package 75 + cp -r packages/$package/node_modules $out/lib/prisma/packages/$package 76 + tar xf $filename --strip-components=1 -C $out/lib/prisma/packages/$package 77 + done 78 + 79 + makeWrapper "${lib.getExe nodejs}" "$out/bin/prisma" \ 80 + --add-flags "$out/lib/prisma/packages/cli/build/index.js" \ 81 + --set PRISMA_SCHEMA_ENGINE_BINARY ${prisma-engines}/bin/schema-engine \ 82 + --set PRISMA_QUERY_ENGINE_BINARY ${prisma-engines}/bin/query-engine \ 83 + --set PRISMA_QUERY_ENGINE_LIBRARY ${lib.getLib prisma-engines}/lib/libquery_engine.node 84 + 85 + runHook postInstall 86 + ''; 87 + 88 + dontStrip = true; 89 + 90 + passthru.tests = { 91 + cli = callPackage ./test-cli.nix { }; 92 + }; 93 + 94 + meta = with lib; { 95 + description = "Next-generation ORM for Node.js and TypeScript"; 96 + homepage = "https://www.prisma.io/"; 97 + license = licenses.asl20; 98 + maintainers = with maintainers; [ aqrln ]; 99 + platforms = platforms.unix; 100 + }; 101 + })
-1
pkgs/development/node-packages/node-packages.json
··· 168 168 , "prebuild-install" 169 169 , "prettier" 170 170 , "prettier-plugin-toml" 171 - , "prisma" 172 171 , "@prisma/language-server" 173 172 , "pscid" 174 173 , "pulp"
-70
pkgs/development/node-packages/node-packages.nix
··· 8707 8707 sha512 = "j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ=="; 8708 8708 }; 8709 8709 }; 8710 - "@prisma/debug-5.17.0" = { 8711 - name = "_at_prisma_slash_debug"; 8712 - packageName = "@prisma/debug"; 8713 - version = "5.17.0"; 8714 - src = fetchurl { 8715 - url = "https://registry.npmjs.org/@prisma/debug/-/debug-5.17.0.tgz"; 8716 - sha512 = "l7+AteR3P8FXiYyo496zkuoiJ5r9jLQEdUuxIxNCN1ud8rdbH3GTxm+f+dCyaSv9l9WY+29L9czaVRXz9mULfg=="; 8717 - }; 8718 - }; 8719 - "@prisma/engines-5.17.0" = { 8720 - name = "_at_prisma_slash_engines"; 8721 - packageName = "@prisma/engines"; 8722 - version = "5.17.0"; 8723 - src = fetchurl { 8724 - url = "https://registry.npmjs.org/@prisma/engines/-/engines-5.17.0.tgz"; 8725 - sha512 = "+r+Nf+JP210Jur+/X8SIPLtz+uW9YA4QO5IXA+KcSOBe/shT47bCcRMTYCbOESw3FFYFTwe7vU6KTWHKPiwvtg=="; 8726 - }; 8727 - }; 8728 - "@prisma/engines-version-5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053" = { 8729 - name = "_at_prisma_slash_engines-version"; 8730 - packageName = "@prisma/engines-version"; 8731 - version = "5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053"; 8732 - src = fetchurl { 8733 - url = "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053.tgz"; 8734 - sha512 = "tUuxZZysZDcrk5oaNOdrBnnkoTtmNQPkzINFDjz7eG6vcs9AVDmA/F6K5Plsb2aQc/l5M2EnFqn3htng9FA4hg=="; 8735 - }; 8736 - }; 8737 - "@prisma/fetch-engine-5.17.0" = { 8738 - name = "_at_prisma_slash_fetch-engine"; 8739 - packageName = "@prisma/fetch-engine"; 8740 - version = "5.17.0"; 8741 - src = fetchurl { 8742 - url = "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.17.0.tgz"; 8743 - sha512 = "ESxiOaHuC488ilLPnrv/tM2KrPhQB5TRris/IeIV4ZvUuKeaicCl4Xj/JCQeG9IlxqOgf1cCg5h5vAzlewN91Q=="; 8744 - }; 8745 - }; 8746 - "@prisma/get-platform-5.17.0" = { 8747 - name = "_at_prisma_slash_get-platform"; 8748 - packageName = "@prisma/get-platform"; 8749 - version = "5.17.0"; 8750 - src = fetchurl { 8751 - url = "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.17.0.tgz"; 8752 - sha512 = "UlDgbRozCP1rfJ5Tlkf3Cnftb6srGrEQ4Nm3og+1Se2gWmCZ0hmPIi+tQikGDUVLlvOWx3Gyi9LzgRP+HTXV9w=="; 8753 - }; 8754 - }; 8755 8710 "@prisma/prisma-schema-wasm-5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053" = { 8756 8711 name = "_at_prisma_slash_prisma-schema-wasm"; 8757 8712 packageName = "@prisma/prisma-schema-wasm"; ··· 81402 81357 description = "An opinionated `toml` formatter plugin for Prettier"; 81403 81358 homepage = "https://github.com/un-ts/prettier/tree/master/packages/prettier"; 81404 81359 license = "MIT"; 81405 - }; 81406 - production = true; 81407 - bypassCache = true; 81408 - reconstructLock = true; 81409 - }; 81410 - prisma = nodeEnv.buildNodePackage { 81411 - name = "prisma"; 81412 - packageName = "prisma"; 81413 - version = "5.17.0"; 81414 - src = fetchurl { 81415 - url = "https://registry.npmjs.org/prisma/-/prisma-5.17.0.tgz"; 81416 - sha512 = "m4UWkN5lBE6yevqeOxEvmepnL5cNPEjzMw2IqDB59AcEV6w7D8vGljDLd1gPFH+W6gUxw9x7/RmN5dCS/WTPxA=="; 81417 - }; 81418 - dependencies = [ 81419 - sources."@prisma/debug-5.17.0" 81420 - sources."@prisma/engines-5.17.0" 81421 - sources."@prisma/engines-version-5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053" 81422 - sources."@prisma/fetch-engine-5.17.0" 81423 - sources."@prisma/get-platform-5.17.0" 81424 - ]; 81425 - buildInputs = globalBuildInputs; 81426 - meta = { 81427 - description = "Prisma is an open-source database toolkit. It includes a JavaScript/TypeScript ORM for Node.js, migrations and a modern GUI to view and edit the data in your database. You can use Prisma in new projects or add it to an existing one."; 81428 - homepage = "https://www.prisma.io"; 81429 - license = "Apache-2.0"; 81430 81360 }; 81431 81361 production = true; 81432 81362 bypassCache = true;
-27
pkgs/development/node-packages/overrides.nix
··· 268 268 }; 269 269 }); 270 270 271 - # To update prisma, please first update prisma-engines to the latest 272 - # version. Then change the correct hash to this package. The PR should hold 273 - # two commits: one for the engines and the other one for the node package. 274 - prisma = prev.prisma.override rec { 275 - nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ]; 276 - 277 - inherit (pkgs.prisma-engines) version; 278 - 279 - src = fetchurl { 280 - url = "https://registry.npmjs.org/prisma/-/prisma-${version}.tgz"; 281 - hash = "sha256-TlwKCuDQRFM6+Hhx9eFCfXbtLZq6RwBTIFCWzE4D8N8="; 282 - }; 283 - postInstall = with pkgs; '' 284 - wrapProgram "$out/bin/prisma" \ 285 - --set PRISMA_SCHEMA_ENGINE_BINARY ${prisma-engines}/bin/schema-engine \ 286 - --set PRISMA_QUERY_ENGINE_BINARY ${prisma-engines}/bin/query-engine \ 287 - --set PRISMA_QUERY_ENGINE_LIBRARY ${lib.getLib prisma-engines}/lib/libquery_engine.node \ 288 - --set PRISMA_FMT_BINARY ${prisma-engines}/bin/prisma-fmt 289 - ''; 290 - 291 - passthru.tests = { 292 - simple-execution = pkgs.callPackage ./package-tests/prisma.nix { 293 - inherit (final) prisma; 294 - }; 295 - }; 296 - }; 297 - 298 271 pulp = prev.pulp.override { 299 272 # tries to install purescript 300 273 npmFlags = builtins.toString [ "--ignore-scripts" ];
+17 -9
pkgs/development/node-packages/package-tests/prisma.nix pkgs/by-name/pr/prisma/test-cli.nix
··· 1 - { lib, pkgs, runCommand, prisma }: 1 + { 2 + lib, 3 + runCommand, 4 + prisma, 5 + prisma-engines, 6 + sqlite-interactive, 7 + }: 2 8 3 9 let 4 - inherit (prisma) packageName; 5 10 prismaMajorVersion = lib.versions.majorMinor prisma.version; 6 - enginesMajorVersion = lib.versions.majorMinor pkgs.prisma-engines.version; 11 + enginesMajorVersion = lib.versions.majorMinor prisma-engines.version; 7 12 in 8 - 9 - runCommand "${packageName}-tests" { 10 - nativeBuildInputs = with pkgs; [ prisma sqlite-interactive ]; 11 - meta.timeout = 60; 12 - } 13 + runCommand "prisma-cli-tests" 14 + { 15 + nativeBuildInputs = [ 16 + prisma 17 + sqlite-interactive 18 + ]; 19 + meta.timeout = 60; 20 + } 13 21 '' 14 22 mkdir $out 15 23 cd $out 16 24 17 25 if [ "${prismaMajorVersion}" != "${enginesMajorVersion}" ]; then 18 - echo "nodePackages.prisma in version ${prismaMajorVersion} and prisma-engines in ${enginesMajorVersion}. Major versions must match." 26 + echo "prisma in version ${prismaMajorVersion} and prisma-engines in ${enginesMajorVersion}. Major versions must match." 19 27 exit 1 20 28 fi 21 29
+3 -3
pkgs/development/tools/database/prisma-engines/default.nix
··· 9 9 , stdenv 10 10 }: 11 11 12 - # Updating this package will force an update for nodePackages.prisma. The 13 - # version of prisma-engines and nodePackages.prisma must be the same for them to 12 + # Updating this package will force an update for prisma. The 13 + # version of prisma-engines and prisma must be the same for them to 14 14 # function correctly. 15 15 rustPlatform.buildRustPackage rec { 16 16 pname = "prisma-engines"; ··· 89 89 # Here's an example application using Prisma with Nix: https://github.com/pimeys/nix-prisma-example 90 90 # At example's `flake.nix` shellHook, notice the requirement of defining environment variables for prisma, it's values will show on `prisma --version`. 91 91 # Read the example's README: https://github.com/pimeys/nix-prisma-example/blob/main/README.md 92 - # Prisma requires 2 packages, `prisma-engines` and `nodePackages.prisma`, to be at *exact* same versions. 92 + # Prisma requires 2 packages, `prisma-engines` and `prisma`, to be at *exact* same versions. 93 93 # Certify at `package.json` that dependencies "@prisma/client" and "prisma" are equal, meaning no caret (`^`) in version. 94 94 # Configure NPM to use exact version: `npm config set save-exact=true` 95 95 # Delete `package-lock.json`, delete `node_modules` directory and run `npm install`.
+2 -2
pkgs/servers/pingvin-share/backend.nix
··· 3 3 buildNpmPackage, 4 4 vips, 5 5 pkg-config, 6 - nodePackages, 6 + prisma, 7 7 src, 8 8 version, 9 9 nixosTests, ··· 28 28 buildInputs = [ vips ]; 29 29 nativeBuildInputs = [ 30 30 pkg-config 31 - nodePackages.prisma 31 + prisma 32 32 ]; 33 33 34 34 npmDepsHash = "sha256-btjvX+2krSc0/bJqeLcVTqHBVWqiTFipp3MidO9wApY=";