Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 571f5b6

Browse files
committedMar 24, 2025··
pnpm
1 parent f3f0806 commit 571f5b6

27 files changed

+41817
-75521
lines changed
 

‎.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
link-workspace-packages=true
2+
save-prefix=''
3+
shamefully-hoist=true

‎README.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,15 @@ To build a project according to its derivation:
9494
nix build .#DERIVATION_NAME
9595
```
9696

97-
### Using NPM
97+
### Using PNPM
9898

99-
The repository uses NPM Workspaces to manage collective dependencies across the JS/TS projects it is hosting.
99+
The repository uses PNPM Workspaces to manage collective dependencies across the JS/TS projects it is hosting.
100100

101-
There can only be one top-level `package-lock.json` file that can be regenerated as follows:
101+
There can only be one top-level `pnpm-lock` file.
102102

103-
```bash
104-
npm run install:clean
105-
```
106-
107-
Individual projects should not have separate `package-lock.json` files. If such files exist, it may lead to unintended behaviors.
103+
Individual projects should not have separate `pnpm-lock` files. If such files exist, it may lead to unintended behaviors.
108104

109-
In addition, Nix validates the hashum of the `package-lock.json` file when building the project. Perform the following actions after running the `install:clean` script:
105+
Perform the following actions after running the `pnpm install` script:
110106

111107
1. Open the `./nix/npmdeps.nix` file
112108
2. Remove the current hashsum (located under the list of all `package.json` files)

‎clijs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"bugs": "https://github.com/nil-blockchain/issues",
1010
"dependencies": {
1111
"@libp2p/peer-id": "^5.0.9",
12-
"@nilfoundation/niljs": "0.25.0",
12+
"@nilfoundation/niljs": "workspace:*",
1313
"@oclif/core": "^4",
1414
"@oclif/plugin-help": "^6",
1515
"@oclif/plugin-plugins": "^5",

‎create-nil-hardhat-project/run_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ echo "Smart account addr: $SMART_ACCOUNT_ADDR"
4141
cd $(dirname "$0")
4242

4343
set +e
44-
if CI=true npx hardhat test --network nil test/*.ts; then
44+
if CI=true pnpm exec hardhat test --network nil test/*.ts; then
4545
exit 0
4646
else
4747
STATUS=$?

‎docs/docusaurus.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const config = {
8181
},
8282
themes: ["@docusaurus/theme-mermaid"],
8383
plugins: [
84-
"custom-loader",
84+
[path.resolve(__dirname, "./plugins/custom-loader"), {}],
8585
[path.resolve(__dirname, "./plugins/nil-playground-plugin"), {}],
8686
[
8787
"nil-docusaurus-plugin-typedoc",

‎docs/package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"private": true,
55
"scripts": {
66
"docusaurus": "docusaurus",
7-
"start": "npm run generate-cli-docs && docusaurus start",
7+
"start": "pnpm run generate-cli-docs && docusaurus start",
88
"swizzle": "docusaurus swizzle",
99
"deploy": "docusaurus deploy",
1010
"clear": "docusaurus clear",
1111
"serve": "docusaurus serve",
1212
"write-translations": "docusaurus write-translations",
1313
"write-heading-ids": "docusaurus write-heading-ids",
1414
"test": "vitest",
15-
"generate-cli-docs": "npx tsx nil/scripts/cliRefGenerator.ts",
16-
"build": "npm run generate-cli-docs && docusaurus build",
15+
"generate-cli-docs": "tsx ./nil/scripts/cliRefGenerator.ts",
16+
"build": "pnpm run generate-cli-docs && docusaurus build",
1717
"lint": "biome check .",
1818
"lint:fix": "biome check --write ."
1919
},
@@ -34,14 +34,13 @@
3434
"@docusaurus/types": "^3.7.0",
3535
"@khannanov-nil/openrpc-docusaurus": "0.7.1",
3636
"@mdx-js/react": "^3.0.0",
37-
"@nilfoundation/niljs": "0.25.0",
38-
"@nilfoundation/smart-contracts": "0.7.0",
37+
"@nilfoundation/niljs": "workspace:*",
38+
"@nilfoundation/smart-contracts": "workspace:*",
3939
"@openzeppelin/contracts": "^5.0.2",
4040
"@uiw/codemirror-themes": "4.21.0",
4141
"@uiw/react-codemirror": "4.21.0",
4242
"ai": "^4.0.11",
4343
"clsx": "^2.0.0",
44-
"custom-loader": "file:plugins/custom-loader",
4544
"docusaurus": "^1.14.7",
4645
"docusaurus-lunr-search": "^3.3.2",
4746
"lottie-react": "^2.4.1",

‎docs/run_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ nild run --http-port 8529 --collator-tick-ms=100 >nild.log 2>&1 &
2525
NILD_PID=$!
2626
sleep 2
2727

28-
if CI=true npm run test; then
28+
if CI=true pnpm run test; then
2929
exit 0
3030
else
3131
STATUS=$?

‎docs_ai_backend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"dependencies": {
2323
"@langchain/community": "^0.3.16",
2424
"@libsql/client": "^0.14.0",
25-
"@nilfoundation/smart-contracts": "0.7.0",
25+
"@nilfoundation/smart-contracts": "workspace:*",
2626
"ai": "^4.0.13",
2727
"axios": "^1.7.9",
2828
"bcryptjs": "^2.4.3",

‎explorer_backend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"license": "ISC",
1717
"dependencies": {
1818
"@clickhouse/client": "^1.0.2",
19-
"@nilfoundation/niljs": "0.25.0",
19+
"@nilfoundation/niljs": "workspace:*",
2020
"@opentelemetry/api": "^1.7.0",
2121
"@opentelemetry/auto-instrumentations-node": "^0.40.0",
2222
"@opentelemetry/exporter-metrics-otlp-grpc": "^0.47.0",

‎explorer_frontend/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"@codemirror/state": "6.5.0",
2323
"@codemirror/view": "^6.34.1",
2424
"@loadable/component": "^5.15.3",
25-
"@nilfoundation/niljs": "0.25.0",
26-
"@nilfoundation/smart-contracts": "0.7.0",
25+
"@nilfoundation/niljs": "workspace:*",
26+
"@nilfoundation/smart-contracts": "workspace:*",
2727
"@nilfoundation/ui-kit": "^2.5.28",
2828
"@noble/curves": "^1.4.0",
2929
"@replit/codemirror-lang-solidity": "^6.0.2",

‎niljs/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@
5151
"rollup-plugin-esbuild": "6.1.1",
5252
"rollup-plugin-filesize": "^10.0.0",
5353
"solc-typed-ast": "^18.2.3",
54-
"tsx": "^4.17.0",
54+
"tsx": "4.17.0",
5555
"typescript": "^5.6.2",
56-
"typescript-eslint": "^8.12.2"
56+
"typescript-eslint": "^8.12.2",
57+
"rimraf": "^6.0.1"
5758
},
5859
"publishConfig": {
5960
"access": "public",
@@ -62,7 +63,7 @@
6263
"dependencies": {
6364
"@chainsafe/persistent-merkle-tree": "^0.7.2",
6465
"@chainsafe/ssz": "^0.16.0",
65-
"@nilfoundation/smart-contracts": "0.7.0",
66+
"@nilfoundation/smart-contracts": "workspace:*",
6667
"@noble/curves": "^1.4.0",
6768
"@open-rpc/client-js": "^1.8.1",
6869
"@rollup/plugin-json": "^6.1.0",

‎nix/clijs.nix

+16-27
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,31 @@
1-
{ pkgs
2-
, lib
3-
, stdenv
4-
, biome
5-
, callPackage
6-
, npmHooks
7-
, nil
8-
, enableTesting ? false
9-
}:
1+
{ pkgs, lib, stdenv, biome, callPackage, pnpm_10, nil, enableTesting ? false }:
102

113
let
124
sigtool = callPackage ./sigtool.nix { };
5+
nodejs_static = pkgs.pkgsStatic.nodejs_22;
6+
pnpm_static = (pnpm_10.override { nodejs = nodejs_static; });
137
in
148
stdenv.mkDerivation rec {
159
name = "clijs";
1610
pname = "clijs";
1711
src = lib.sourceByRegex ./.. [
1812
"package.json"
19-
"package-lock.json"
13+
"pnpm-workspace.yaml"
14+
"pnpm-lock.yaml"
15+
".npmrc"
2016
"^clijs(/.*)?$"
2117
"^niljs(/.*)?$"
2218
"^smart-contracts(/.*)?$"
2319
"biome.json"
2420
];
2521

26-
npmDeps = (callPackage ./npmdeps.nix { });
22+
pnpmDeps = (callPackage ./npmdeps.nix { });
2723

2824
NODE_PATH = "$npmDeps";
2925

30-
nativeBuildInputs = [
31-
pkgs.pkgsStatic.nodejs_22
32-
npmHooks.npmConfigHook
33-
biome
34-
]
35-
++ lib.optionals stdenv.buildPlatform.isDarwin [ sigtool ]
36-
++ (if enableTesting then [ nil ] else [ ]);
37-
38-
dontConfigure = true;
26+
nativeBuildInputs = [ nodejs_static pnpm_static.configHook biome ]
27+
++ lib.optionals stdenv.buildPlatform.isDarwin [ sigtool ]
28+
++ (if enableTesting then [ nil ] else [ ]);
3929

4030
preUnpack = ''
4131
echo "Setting UV_USE_IO_URING=0 to work around the io_uring kernel bug"
@@ -48,23 +38,23 @@ stdenv.mkDerivation rec {
4838
'';
4939

5040
buildPhase = ''
51-
PATH="${pkgs.pkgsStatic.nodejs_22}/bin/:$PATH"
41+
PATH="${nodejs_static}/bin/:$PATH"
5242
5343
patchShebangs docs/node_modules
5444
patchShebangs niljs/node_modules
55-
(cd smart-contracts; npm run build)
56-
(cd niljs; npm run build)
45+
(cd smart-contracts; pnpm run build)
46+
(cd niljs; pnpm run build)
5747
5848
cd clijs
59-
npm run bundle
49+
pnpm run bundle
6050
'';
6151

6252
doCheck = enableTesting;
6353

6454
checkPhase = ''
6555
export BIOME_BINARY=${biome}/bin/biome
6656
67-
npm run lint
57+
pnpm run lint
6858
6959
./dist/clijs | grep -q "The CLI tool for interacting with the =nil; cluster" || {
7060
echo "Error: Output does not contain the expected substring!" >&2
@@ -74,7 +64,7 @@ stdenv.mkDerivation rec {
7464
7565
nohup nild run --http-port 8529 --collator-tick-ms=100 > nild.log 2>&1 & echo $! > nild_pid &
7666
77-
npm run test:ci
67+
pnpm run test:ci
7868
7969
kill `cat nild_pid` && rm nild_pid
8070
@@ -86,4 +76,3 @@ stdenv.mkDerivation rec {
8676
mv ./dist/clijs $out/${pname}
8777
'';
8878
}
89-

‎nix/docsaibackend.nix

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ lib
22
, stdenv
33
, callPackage
4-
, npmHooks
4+
, pnpm_10
55
, nodejs
66
}:
77

@@ -10,18 +10,21 @@ stdenv.mkDerivation rec {
1010
pname = "docsaibackend";
1111
src = lib.sourceByRegex ./.. [
1212
"package.json"
13-
"package-lock.json"
13+
"pnpm-lock.yaml"
14+
"pnpm-workspace.yaml"
15+
".npmrc"
1416
"^docs_ai_backend(/.*)?$"
1517
];
1618

17-
npmDeps = (callPackage ./npmdeps.nix { });
19+
pnpmDeps = (callPackage ./npmdeps.nix { });
1820

1921
NODE_PATH = "$npmDeps";
2022

2123
nativeBuildInputs = [
2224
nodejs
23-
npmHooks.npmConfigHook
2425
nodejs.python
26+
pnpm_10
27+
pnpm_10.configureHook
2528
];
2629

2730
dontConfigure = true;
@@ -34,7 +37,7 @@ stdenv.mkDerivation rec {
3437
buildPhase = ''
3538
patchShebangs docs_ai_backend/node_modules
3639
37-
(cd docs_ai_backend; npm run build)
40+
(cd docs_ai_backend; pnpm run build)
3841
'';
3942

4043
checkPhase = ''

‎nix/nildocs.nix

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{ lib
22
, stdenv
3-
, npmHooks
3+
, pnpm_10
44
, nodejs
55
, nil
66
, openssl
@@ -19,24 +19,25 @@ stdenv.mkDerivation rec {
1919
pname = "nildocs";
2020
src = lib.sourceByRegex ./.. [
2121
"package.json"
22-
"package-lock.json"
22+
"pnpm-lock.yaml"
23+
"pnpm-workspace.yaml"
24+
".npmrc"
2325
"^docs(/.*)?$"
2426
"^niljs(/.*)?$"
2527
"^smart-contracts(/.*)?$"
2628
"biome.json"
2729
];
2830

29-
npmDeps = (callPackage ./npmdeps.nix { });
30-
31-
NODE_PATH = "$npmDeps";
31+
pnpmDeps = (callPackage ./npmdeps.nix { });
3232

3333
buildInputs = [
3434
openssl
3535
];
3636

3737
nativeBuildInputs = [
3838
nodejs
39-
npmHooks.npmConfigHook
39+
pnpm_10
40+
pnpm_10.configHook
4041
autoconf
4142
automake
4243
libtool
@@ -45,8 +46,6 @@ stdenv.mkDerivation rec {
4546
biome
4647
] ++ (if enableTesting then [ nil ] else [ ]);
4748

48-
dontConfigure = true;
49-
5049
preUnpack = ''
5150
echo "Setting UV_USE_IO_URING=0 to work around the io_uring kernel bug"
5251
export UV_USE_IO_URING=0
@@ -62,8 +61,8 @@ stdenv.mkDerivation rec {
6261
runHook preBuild
6362
patchShebangs docs/node_modules
6463
patchShebangs niljs/node_modules
65-
(cd smart-contracts; npm run build)
66-
(cd niljs; npm run build)
64+
(cd smart-contracts; pnpm run build)
65+
(cd niljs; pnpm run build)
6766
export NILJS_SRC=${../niljs}
6867
export OPENRPC_JSON=${nil}/share/doc/nil/openrpc.json
6968
export CMD_NIL=${../nil/cmd/nil/internal}
@@ -76,7 +75,7 @@ stdenv.mkDerivation rec {
7675
# needed to work-around the openssl incompatibility
7776
# not sure why it happens, but it does the job
7877
export NODE_OPTIONS=--openssl-legacy-provider
79-
npm run build
78+
pnpm run build
8079
'';
8180

8281

@@ -85,7 +84,7 @@ stdenv.mkDerivation rec {
8584
checkPhase = ''
8685
export BIOME_BINARY=${biome}/bin/biome
8786
88-
npm run lint
87+
pnpm run lint
8988
9089
echo "Runnig tests..."
9190
bash run_tests.sh

‎nix/nilexplorer.nix

+15-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
, biome
44
, python3
55
, callPackage
6-
, npmHooks
6+
, pnpm_10
77
, nodejs
88
, enableTesting ? false
99
, cypress
@@ -15,27 +15,28 @@ stdenv.mkDerivation rec {
1515
pname = "nilexplorer";
1616
src = lib.sourceByRegex ./.. [
1717
"package.json"
18-
"package-lock.json"
18+
"pnpm-lock.yaml"
19+
"pnpm-workspace.yaml"
20+
".npmrc"
1921
"^niljs(/.*)?$"
2022
"^smart-contracts(/.*)?$"
2123
"biome.json"
2224
"^explorer_frontend(/.*)?$"
2325
"^explorer_backend(/.*)?$"
2426
];
2527

26-
npmDeps = (callPackage ./npmdeps.nix { });
28+
pnpmDeps = (callPackage ./npmdeps.nix { });
2729

28-
NODE_PATH = "$npmDeps";
2930

3031
nativeBuildInputs = [
3132
nodejs
32-
npmHooks.npmConfigHook
33+
pnpm_10.configHook
34+
pnpm_10
3335
biome
3436
python3
3537
nil
3638
] ++ (if enableTesting then [ nil ] else [ ]);
3739

38-
dontConfigure = true;
3940

4041
preUnpack = ''
4142
echo "Setting UV_USE_IO_URING=0 to work around the io_uring kernel bug"
@@ -50,11 +51,11 @@ stdenv.mkDerivation rec {
5051
patchShebangs explorer_frontend/node_modules
5152
patchShebangs node_modules
5253
53-
(cd smart-contracts; npm run build)
54-
(cd niljs; npm run build)
54+
(cd smart-contracts; pnpm run build)
55+
(cd niljs; pnpm run build)
5556
56-
(cd explorer_frontend; npm run build)
57-
(cd explorer_backend; npm run build)
57+
(cd explorer_frontend; pnpm run build)
58+
(cd explorer_backend; pnpm run build)
5859
'';
5960

6061
doCheck = enableTesting;
@@ -63,17 +64,17 @@ stdenv.mkDerivation rec {
6364
export BIOME_BINARY=${biome}/bin/biome
6465
6566
echo "Checking explorer frontend"
66-
(cd explorer_frontend; npm run lint; bash run_tutorial_tests.sh;)
67+
(cd explorer_frontend; pnpm run lint; bash run_tutorial_tests.sh;)
6768
6869
echo "Checking explorer backend"
69-
(cd explorer_backend; npm run lint;)
70+
(cd explorer_backend; pnpm run lint;)
7071
7172
echo "Checking if explorer backend starts up without errors"
7273
cd explorer_backend
73-
npm run start & NPM_PID=$!
74+
pnpm run start & NPM_PID=$!
7475
sleep 7
7576
76-
77+
7778
7879
if kill -0 $NPM_PID 2>/dev/null; then
7980
echo "Explorer backend is running successfully"

‎nix/niljs.nix

+12-13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
, callPackage
55
, npmHooks
66
, nodejs
7+
, pnpm
78
, nil
89
, solc
910
, enableTesting ? false
@@ -12,21 +13,19 @@
1213
stdenv.mkDerivation rec {
1314
name = "nil.js";
1415
pname = "niljs";
15-
src = lib.sourceByRegex ./.. [ "package.json" "package-lock.json" "^niljs(/.*)?$" "^smart-contracts(/.*)?$" "biome.json" ];
16+
src = lib.sourceByRegex ./.. [ "package.json" ".npmrc" "pnpm-workspace.yaml" "pnpm-lock.yaml" "^niljs(/.*)?$" "^smart-contracts(/.*)?$" "biome.json" ];
1617

17-
npmDeps = (callPackage ./npmdeps.nix { });
18+
pnpmDeps = (callPackage ./npmdeps.nix { });
1819

19-
NODE_PATH = "$npmDeps";
2020

2121
nativeBuildInputs = [
2222
nodejs
23-
npmHooks.npmConfigHook
2423
biome
24+
pnpm
25+
pnpm.configHook
2526
solc
2627
] ++ (if enableTesting then [ nil ] else [ ]);
2728

28-
dontConfigure = true;
29-
3029
preUnpack = ''
3130
echo "Setting UV_USE_IO_URING=0 to work around the io_uring kernel bug"
3231
export UV_USE_IO_URING=0
@@ -35,7 +34,7 @@ stdenv.mkDerivation rec {
3534
buildPhase = ''
3635
(cd smart-contracts; npm run build)
3736
cd niljs
38-
npm run build
37+
pnpm run build
3938
'';
4039

4140
doCheck = enableTesting;
@@ -46,12 +45,12 @@ stdenv.mkDerivation rec {
4645
4746
export BIOME_BINARY=${biome}/bin/biome
4847
49-
npm run lint
50-
npm run test:unit
51-
npm run test:integration --cache=false
52-
npm run test:examples
53-
npm run lint:types
54-
npm run lint:jsdoc
48+
pnpm run lint
49+
pnpm run test:unit
50+
pnpm run test:integration --cache=false
51+
pnpm run test:examples
52+
pnpm run lint:types
53+
pnpm run lint:jsdoc
5554
5655
kill `cat nild_pid` && rm nild_pid
5756

‎nix/nilsmartcontracts.nix

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ lib
22
, stdenv
33
, callPackage
4-
, npmHooks
4+
, pnpm_10
55
, nodejs
66
}:
77

@@ -10,20 +10,19 @@ stdenv.mkDerivation rec {
1010
pname = "smart-contracts";
1111
src = lib.sourceByRegex ./.. [
1212
"package.json"
13-
"package-lock.json"
13+
"pnpm-lock.yaml"
14+
"pnpm-workspace.yaml"
15+
".npmrc"
1416
"^smart-contracts(/.*)?$"
1517
];
1618

17-
npmDeps = (callPackage ./npmdeps.nix { });
18-
19-
NODE_PATH = "$npmDeps";
19+
pnpmDeps = (callPackage ./npmdeps.nix { });
2020

2121
nativeBuildInputs = [
2222
nodejs
23-
npmHooks.npmConfigHook
23+
pnpm_10.configHook
2424
];
2525

26-
dontConfigure = true;
2726

2827
preUnpack = ''
2928
echo "Setting UV_USE_IO_URING=0 to work around the io_uring kernel bug"
@@ -32,7 +31,7 @@ stdenv.mkDerivation rec {
3231

3332
buildPhase = ''
3433
cd smart-contracts
35-
npm run build
34+
pnpm run build
3635
'';
3736

3837
installPhase = ''

‎nix/npmdeps.nix

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
{ lib, stdenv, fetchNpmDeps }:
1+
{ lib, stdenv, pnpm_10, nodejs }:
22
let
33
inherit (lib) fileset;
4+
pnpm = pnpm_10;
45
in
5-
(fetchNpmDeps {
6+
(pnpm.fetchDeps {
67
src = fileset.toSource {
78
root = ./..;
89
fileset = fileset.unions [
9-
../package-lock.json
10+
../pnpm-workspace.yaml
11+
../pnpm-lock.yaml
12+
../.npmrc
1013
../package.json
1114
../clijs/package.json
1215
../docs/package.json
@@ -17,7 +20,9 @@ in
1720
../explorer_frontend/package.json
1821
../uniswap/package.json
1922
../rollup-bridge-contracts/package.json
23+
../wallet-extension/package.json
2024
];
2125
};
22-
hash = "sha256-kUf/USfBCH2bB+Km4QxknRnrHXYY1uFwVWlkGsGUMxA=";
26+
pname = "nil";
27+
hash = "sha256-zblsctTvIbaEwKtYs71fz1RzK6rJ9TOsDPKBjBSEt6Y=";
2328
})

‎nix/rollup-bridge-contracts.nix

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
, stdenv
33
, biome
44
, callPackage
5-
, npmHooks
5+
, pnpm_10
66
, nodejs
77
, nil
88
, enableTesting ? false
@@ -13,18 +13,21 @@ stdenv.mkDerivation rec {
1313
pname = "rollup-bridge-contracts";
1414
src = lib.sourceByRegex ./.. [
1515
"package.json"
16-
"package-lock.json"
16+
"pnpm-lock.yaml"
17+
"pnpm-workspace.yaml"
18+
".npmrc"
1719
"^niljs(/.*)?$"
1820
"^rollup-bridge-contracts(/.*)?$"
1921
"biome.json"
2022
"^create-nil-hardhat-project(/.*)?$"
2123
];
2224

23-
npmDeps = (callPackage ./npmdeps.nix { });
25+
pnpmDeps = (callPackage ./npmdeps.nix { });
2426

2527
nativeBuildInputs = [
2628
nodejs
27-
npmHooks.npmConfigHook
29+
pnpm_10.configHook
30+
pnpm_10
2831
];
2932

3033
soljson26 = builtins.fetchurl {

‎nix/uniswap.nix

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
, stdenv
33
, biome
44
, callPackage
5-
, npmHooks
5+
, pnpm_10
66
, nodejs
77
, nil
88
, enableTesting ? false
@@ -13,7 +13,9 @@ stdenv.mkDerivation rec {
1313
pname = "uniswap";
1414
src = lib.sourceByRegex ./.. [
1515
"package.json"
16-
"package-lock.json"
16+
"pnpm-lock.yaml"
17+
"pnpm-workspace.yaml"
18+
".npmrc"
1719
"^niljs(/.*)?$"
1820
"^smart-contracts(/.*)?$"
1921
"^create-nil-hardhat-project(/.*)?$"
@@ -26,18 +28,16 @@ stdenv.mkDerivation rec {
2628
sha256 = "1mhww44ni55yfcyn4hjql2hwnvag40p78kac7jjw2g2jdwwyb1fv";
2729
};
2830

29-
npmDeps = (callPackage ./npmdeps.nix { });
31+
pnpmDeps = (callPackage ./npmdeps.nix { });
3032

31-
NODE_PATH = "$npmDeps";
3233

3334
nativeBuildInputs = [
3435
nodejs
35-
npmHooks.npmConfigHook
36+
pnpm_10.configHook
37+
pnpm_10
3638
biome
3739
] ++ (if enableTesting then [ nil ] else [ ]);
3840

39-
dontConfigure = true;
40-
4141
preUnpack = ''
4242
echo "Setting UV_USE_IO_URING=0 to work around the io_uring kernel bug"
4343
export UV_USE_IO_URING=0
@@ -46,8 +46,8 @@ stdenv.mkDerivation rec {
4646
buildPhase = ''
4747
patchShebangs node_modules
4848
49-
(cd smart-contracts; npm run build)
50-
(cd niljs; npm run build)
49+
(cd smart-contracts; pnpm run build)
50+
(cd niljs; pnpm run build)
5151
'';
5252

5353
doCheck = enableTesting;
@@ -68,8 +68,8 @@ stdenv.mkDerivation rec {
6868
export SMART_ACCOUNT_ADDR=`nil smart-account new -q`
6969
7070
echo "Checking uniswap"
71-
(cd uniswap; npm run lint)
72-
(cd uniswap; npm run compile)
71+
(cd uniswap; pnpm run lint)
72+
(cd uniswap; pnpm run compile)
7373
7474
echo "tests finished successfully"
7575
'';

‎nix/walletextension.nix

+12-15
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
, stdenv
33
, biome
44
, callPackage
5-
, npmHooks
5+
, pnpm_10
66
, nodejs
77
, nil
88
, enableTesting ? false
@@ -13,47 +13,44 @@ stdenv.mkDerivation rec {
1313
pname = "walletExtension";
1414
src = lib.sourceByRegex ./.. [
1515
"package.json"
16-
"package-lock.json"
16+
"pnpm-lock.yaml"
17+
"pnpm-workspace.yaml"
18+
".npmrc"
1719
"^niljs(/.*)?$"
1820
"^smart-contracts(/.*)?$"
1921
"biome.json"
2022
"^wallet-extension(/.*)?$"
2123
];
2224

23-
npmDeps = (callPackage ./npmdeps.nix { });
24-
25-
NODE_PATH = "$npmDeps";
25+
pnpmDeps = (callPackage ./npmdeps.nix { });
2626

2727
nativeBuildInputs = [
2828
nodejs
29-
npmHooks.npmConfigHook
29+
pnpm_10.configHook
30+
pnpm_10
3031
biome
3132
] ++ (if enableTesting then [ nil ] else [ ]);
3233

33-
dontConfigure = true;
3434

3535
buildPhase = ''
36-
patchShebangs wallet-extension/node_modules
37-
38-
(cd smart-contracts; npm run build)
39-
(cd niljs; npm run build)
36+
(cd smart-contracts; pnpm run build)
37+
(cd niljs; pnpm run build)
4038
4139
cd wallet-extension
42-
npm run build
40+
pnpm run build
4341
'';
4442

4543
doCheck = enableTesting;
4644

4745
checkPhase = ''
48-
patchShebangs node_modules
4946
nohup nild run --http-port 8529 --collator-tick-ms=100 > nild.log 2>&1 & echo $! > nild_pid &
5047
5148
export BIOME_BINARY=${biome}/bin/biome
5249
5350
echo "Checking wallet extension"
5451
55-
npm run lint
56-
npm run test:integration --cache=false
52+
pnpm run lint
53+
pnpm run test:integration --cache=false
5754
5855
kill `cat nild_pid` && rm nild_pid
5956

‎package-lock.json

-75,355
This file was deleted.

‎package.json

+38-23
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,11 @@
22
"name": "nil-monorepo",
33
"private": true,
44
"version": "1.0.0",
5-
"workspaces": [
6-
"smart-contracts",
7-
"niljs",
8-
"create-nil-hardhat-project",
9-
"docs",
10-
"explorer_frontend",
11-
"explorer_backend",
12-
"uniswap",
13-
"clijs",
14-
"wallet-extension",
15-
"docs_ai_backend",
16-
"rollup-bridge-contracts",
17-
"academy/*"
18-
],
195
"scripts": {
20-
"build": "npm run build --workspaces --if-present",
21-
"lint": "npm run lint --workspaces --if-present",
22-
"lint:fix": "npm run lint:fix --workspaces --if-present",
23-
"install:clean": "rm -rf package-lock.json && rm -rf node_modules && rm -rf */node_modules && rm -rf */package-lock.json && npm i && npm dedupe",
24-
"pub": "npm run pub --workspaces --if-present"
6+
"build": "pnpm run build --workspaces --if-present",
7+
"lint": "pnpm run lint --workspaces --if-present",
8+
"lint:fix": "pnpm run lint:fix --workspaces --if-present",
9+
"pub": "pnpm run pub --workspaces --if-present"
2510
},
2611
"author": "",
2712
"license": "ISC",
@@ -31,11 +16,41 @@
3116
"fs-extra": "^11.3.0",
3217
"hardhat": "^2.22.19",
3318
"rimraf": "^6.0.1",
34-
"vitest": "^2.1.6"
19+
"vitest": "^2.1.9"
3520
},
36-
"optionalDependencies": {
37-
"@biomejs/cli-linux-x64": "1.9.4",
38-
"@biomejs/cli-win32-x64": "1.9.4"
21+
"pnpm": {
22+
"supportedArchitectures": {
23+
"os": [
24+
"current",
25+
"linux",
26+
"darwin"
27+
],
28+
"cpu": [
29+
"x64",
30+
"arm64"
31+
]
32+
},
33+
"ignoredBuiltDependencies": [
34+
"@biomejs/biome",
35+
"baseui",
36+
"core-js",
37+
"core-js-pure",
38+
"cypress",
39+
"esbuild",
40+
"fast-folder-size",
41+
"gifsicle",
42+
"highlight.js",
43+
"jpegtran-bin",
44+
"keccak",
45+
"optipng-bin",
46+
"protobufjs",
47+
"secp256k1",
48+
"sharp",
49+
"yarn"
50+
],
51+
"onlyBuiltDependencies": [
52+
"better-sqlite3"
53+
]
3954
},
4055
"overrides": {
4156
"whatwg-url": "13.0.0",

‎pnpm-lock.yaml

+41,629
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pnpm-workspace.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
packages:
2+
- 'smart-contracts'
3+
- 'niljs'
4+
- "create-nil-hardhat-project"
5+
- "docs"
6+
- "explorer_frontend"
7+
- "explorer_backend"
8+
- "uniswap"
9+
- "clijs"
10+
- "wallet-extension"
11+
- "docs_ai_backend"
12+
- "rollup-bridge-contracts"
13+
- "academy/*"

‎uniswap/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"lint:fix": "biome check --write ."
1414
},
1515
"dependencies": {
16-
"@nilfoundation/niljs": "0.25.0",
17-
"@nilfoundation/smart-contracts": "0.7.0",
16+
"@nilfoundation/niljs": "workspace:*",
17+
"@nilfoundation/smart-contracts": "workspace:*",
1818
"abitype": "^1.0.7",
1919
"dotenv": "^16.4.5"
2020
},

‎wallet-extension/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
"build:content-nil": "vite build --config vite.contentScript-nil.ts",
1010
"build": "tsc && npm run build:general && npm run build:content-injected && npm run build:content-nil",
1111
"lint": "biome check .",
12-
"lint:all": "npm run lint && npm run lint:types",
12+
"lint:all": "pnpm run lint && npm run lint:types",
1313
"lint:fix": "biome check --write .",
1414
"lint:types": "tsc --noEmit -p tsconfig.json",
1515
"test:integration": "CI=true vitest -c ./test/vitest.integration.config.ts --isolate false",
1616
"interface": "i18next-resources-for-ts interface -i public/locales/en -o src/@types/resources.d.ts"
1717
},
1818
"dependencies": {
1919
"@metamask/rpc-errors": "^7.0.2",
20-
"@nilfoundation/niljs": "0.25.0",
20+
"@nilfoundation/niljs": "workspace:*",
2121
"@nilfoundation/ui-kit": "^2.5.28",
2222
"baseui": "^13.0.0",
2323
"effector": "^22.8.6",

0 commit comments

Comments
 (0)
Please sign in to comment.