parent 351ae14c
Pipeline #6069 failed with stages
in 28 seconds
...@@ -63,28 +63,6 @@ nix -L develop ...@@ -63,28 +63,6 @@ nix -L develop
**Local instance is ready!** (Example: http://localhost:8000/) **Local instance is ready!** (Example: http://localhost:8000/)
#### [bun](https://bun.sh/)
We use [bun](https://bun.sh/) as the package manager.
Sometimes, when you remove `node_modules` it complains about
`better-sqlite3`:
```
file:///home/przemek/GARGANTEXT/haskell-gargantext/purescript-gargantext/node_modules/spago/bin/bundle.js:61138
throw util.fromLeft(step3);
```
Just issue this (I guess it reinstalls `better-sqlite3` for local bun dev):
```sh
cd node_modules/better-sqlite3
bun install
cd ../..
```
or
```sh
nix-shell shell.nix --run fix-bun
```
### 2. Use Docker setup ### 2. Use Docker setup
You will need docker and docker-compose installed. You will need docker and docker-compose installed.
...@@ -126,6 +104,6 @@ nix-shell --run build ...@@ -126,6 +104,6 @@ nix-shell --run build
To compile CSS (Sass): To compile CSS (Sass):
```shell ```shell
nix-shell --run "bun css" nix-shell --run "npm run css"
``` ```
...@@ -26,10 +26,9 @@ ...@@ -26,10 +26,9 @@
dependencies = with pkgs; [ dependencies = with pkgs; [
purescript purescript
spago-unstable spago-unstable
bun
sqlite sqlite
nodejs nodejs
nodePackages.node-gyp nodePackages.npm
]; ];
serve = pkgs.writeShellScriptBin "serve" '' serve = pkgs.writeShellScriptBin "serve" ''
...@@ -68,22 +67,6 @@ ...@@ -68,22 +67,6 @@
in in
{ {
packages = { packages = {
# sometimes bun is broken because of better-sqlite3
fix-bun = pkgs.writeShellApplication {
name = "fix-bun";
runtimeInputs = dependencies;
text = ''
#!${pkgs.stdenv.shell}
set -e
DIR=./node_modules/better-sqlite3
if [ -d "$DIR" ]; then
cd $DIR
${pkgs.bun}/bin/bun install
fi
'';
};
compile = pkgs.writeShellApplication { compile = pkgs.writeShellApplication {
name = "compile"; name = "compile";
runtimeInputs = dependencies; runtimeInputs = dependencies;
...@@ -93,11 +76,11 @@ ...@@ -93,11 +76,11 @@
echo "Installing JS Dependencies" echo "Installing JS Dependencies"
#yarn #yarn
${pkgs.bun}/bin/bun install ${pkgs.nodePackages.npm}/bin/npm install
${pkgs.bun}/bin/bun install --dev ${pkgs.nodePackages.npm}/bin/npm install --dev
echo "Compiling" echo "Compiling"
${pkgs.bun}/bin/bun run build ${pkgs.nodePackages.npm}/bin/npm run build
''; '';
}; };
build = pkgs.writeShellApplication { build = pkgs.writeShellApplication {
...@@ -110,7 +93,7 @@ ...@@ -110,7 +93,7 @@
${self.packages.${system}.compile}/bin/compile ${self.packages.${system}.compile}/bin/compile
echo "Bundling" echo "Bundling"
${pkgs.bun}/bin/bun run bundle ${pkgs.nodePackages.npm}/bin/npm run bundle
''; '';
}; };
test-ps = pkgs.writeShellApplication { test-ps = pkgs.writeShellApplication {
...@@ -123,7 +106,7 @@ ...@@ -123,7 +106,7 @@
${self.packages.${system}.compile}/bin/compile ${self.packages.${system}.compile}/bin/compile
echo "Testing" echo "Testing"
${pkgs.bun}/bin/bun run test ${pkgs.nodePackages.npm}/bin/npm run test
''; '';
}; };
repl = pkgs.writeShellApplication { repl = pkgs.writeShellApplication {
...@@ -132,7 +115,7 @@ ...@@ -132,7 +115,7 @@
text = '' text = ''
#!${pkgs.stdenv.shell} #!${pkgs.stdenv.shell}
${pkgs.bun}/bin/bun run repl ${pkgs.nodePackages.npm}/bin/npm run repl
''; '';
}; };
...@@ -144,7 +127,7 @@ ...@@ -144,7 +127,7 @@
set -e set -e
#yarn css #yarn css
${pkgs.bun}/bin/bun run css ${pkgs.nodePackages.npm}/bin/npm run css
''; '';
}; };
}; };
...@@ -156,7 +139,6 @@ ...@@ -156,7 +139,6 @@
# scripts # scripts
self.packages.${system}.build self.packages.${system}.build
self.packages.${system}.compile self.packages.${system}.compile
self.packages.${system}.fix-bun
self.packages.${system}.test-ps self.packages.${system}.test-ps
self.packages.${system}.repl self.packages.${system}.repl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment