mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-28 02:40:50 +00:00
tests/pnpm: add test for pnpm 12
(cherry picked from commit feccedc4bf)
This commit is contained in:
committed by
Diogo Correia
parent
05b188e5e9
commit
39bd700221
@@ -5,4 +5,5 @@
|
||||
pnpm-workspaces = lib.recurseIntoAttrs (callPackage ./pnpm-workspaces { });
|
||||
pnpm_11_v3 = callPackage ./pnpm_11_v3 { };
|
||||
pnpm_11_v4 = callPackage ./pnpm_11_v4 { };
|
||||
pnpm_12_v4 = callPackage ./pnpm_12_v4 { };
|
||||
}
|
||||
|
||||
60
pkgs/test/pnpm/pnpm_12_v4/default.nix
Normal file
60
pkgs/test/pnpm/pnpm_12_v4/default.nix
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
fetchPnpmDeps,
|
||||
lib,
|
||||
makeShellWrapper,
|
||||
nodejs-slim,
|
||||
pnpmConfigHook,
|
||||
pnpm_12,
|
||||
stdenv,
|
||||
testers,
|
||||
}:
|
||||
let
|
||||
pnpm = pnpm_12;
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "pnpm-test";
|
||||
inherit (pnpm) version;
|
||||
|
||||
src = ./src;
|
||||
|
||||
pnpmDeps = testers.invalidateFetcherByDrvHash fetchPnpmDeps {
|
||||
inherit (finalAttrs) pname version src;
|
||||
inherit pnpm;
|
||||
fetcherVersion = 4;
|
||||
hash = "sha256-NDGKyqZasK13YkmNQ1ypP14rCP8wp2llT8bnKUi4/zo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeShellWrapper
|
||||
nodejs-slim
|
||||
pnpm
|
||||
pnpmConfigHook
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
pnpm build
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm644 -t $out/lib/pnpm-12-test dist/index.js
|
||||
|
||||
makeWrapper ${lib.getExe nodejs-slim} $out/bin/pnpm-12-test \
|
||||
--add-flags "$out/lib/pnpm-12-test"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
meta = {
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "pnpm-12-test";
|
||||
inherit (pnpm.meta) maintainers;
|
||||
};
|
||||
})
|
||||
2
pkgs/test/pnpm/pnpm_12_v4/src/.gitignore
vendored
Normal file
2
pkgs/test/pnpm/pnpm_12_v4/src/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
dist/
|
||||
node_modules/
|
||||
1
pkgs/test/pnpm/pnpm_12_v4/src/index.ts
Normal file
1
pkgs/test/pnpm/pnpm_12_v4/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
console.log("Hello World");
|
||||
20
pkgs/test/pnpm/pnpm_12_v4/src/package.json
Normal file
20
pkgs/test/pnpm/pnpm_12_v4/src/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "pnpm12test",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"start": "node dist/index.js"
|
||||
},
|
||||
"license": "MIT",
|
||||
"packageManager": "pnpm",
|
||||
"type": "module",
|
||||
"files": [
|
||||
"dist/"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.5.0",
|
||||
"typescript": "^6.0.2"
|
||||
}
|
||||
}
|
||||
39
pkgs/test/pnpm/pnpm_12_v4/src/pnpm-lock.yaml
generated
Normal file
39
pkgs/test/pnpm/pnpm_12_v4/src/pnpm-lock.yaml
generated
Normal file
@@ -0,0 +1,39 @@
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
devDependencies:
|
||||
'@types/node':
|
||||
specifier: ^25.5.0
|
||||
version: 25.9.6
|
||||
typescript:
|
||||
specifier: ^6.0.2
|
||||
version: 6.0.3
|
||||
|
||||
packages:
|
||||
|
||||
'@types/node@25.9.6':
|
||||
resolution: {integrity: sha512-JR6Q/PV5DKFvjrGFVqQJdeG0qvsqQQLDa3TzFrqVwhqRXqwNaxPo2KYCtCQXpOdIulCouKwT7a6in9nFthBAzw==}
|
||||
|
||||
typescript@6.0.3:
|
||||
resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==}
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
|
||||
undici-types@7.24.6:
|
||||
resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==}
|
||||
|
||||
snapshots:
|
||||
|
||||
'@types/node@25.9.6':
|
||||
dependencies:
|
||||
undici-types: 7.24.6
|
||||
|
||||
typescript@6.0.3: {}
|
||||
|
||||
undici-types@7.24.6: {}
|
||||
13
pkgs/test/pnpm/pnpm_12_v4/src/tsconfig.json
Normal file
13
pkgs/test/pnpm/pnpm_12_v4/src/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"outDir": "dist",
|
||||
"rootDir": ".",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user