parent 351ae14c
Pipeline #6069 failed with stages
in 28 seconds
......@@ -63,28 +63,6 @@ nix -L develop
**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
You will need docker and docker-compose installed.
......@@ -126,6 +104,6 @@ nix-shell --run build
To compile CSS (Sass):
```shell
nix-shell --run "bun css"
nix-shell --run "npm run css"
```
......@@ -26,10 +26,9 @@
dependencies = with pkgs; [
purescript
spago-unstable
bun
sqlite
nodejs
nodePackages.node-gyp
nodePackages.npm
];
serve = pkgs.writeShellScriptBin "serve" ''
......@@ -68,22 +67,6 @@
in
{
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 {
name = "compile";
runtimeInputs = dependencies;
......@@ -93,11 +76,11 @@
echo "Installing JS Dependencies"
#yarn
${pkgs.bun}/bin/bun install
${pkgs.bun}/bin/bun install --dev
${pkgs.nodePackages.npm}/bin/npm install
${pkgs.nodePackages.npm}/bin/npm install --dev
echo "Compiling"
${pkgs.bun}/bin/bun run build
${pkgs.nodePackages.npm}/bin/npm run build
'';
};
build = pkgs.writeShellApplication {
......@@ -110,7 +93,7 @@
${self.packages.${system}.compile}/bin/compile
echo "Bundling"
${pkgs.bun}/bin/bun run bundle
${pkgs.nodePackages.npm}/bin/npm run bundle
'';
};
test-ps = pkgs.writeShellApplication {
......@@ -123,7 +106,7 @@
${self.packages.${system}.compile}/bin/compile
echo "Testing"
${pkgs.bun}/bin/bun run test
${pkgs.nodePackages.npm}/bin/npm run test
'';
};
repl = pkgs.writeShellApplication {
......@@ -132,7 +115,7 @@
text = ''
#!${pkgs.stdenv.shell}
${pkgs.bun}/bin/bun run repl
${pkgs.nodePackages.npm}/bin/npm run repl
'';
};
......@@ -144,7 +127,7 @@
set -e
#yarn css
${pkgs.bun}/bin/bun run css
${pkgs.nodePackages.npm}/bin/npm run css
'';
};
};
......@@ -156,7 +139,6 @@
# scripts
self.packages.${system}.build
self.packages.${system}.compile
self.packages.${system}.fix-bun
self.packages.${system}.test-ps
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