[refactor] migrate from yarn to bun

parent 9740c437
...@@ -2,75 +2,57 @@ ...@@ -2,75 +2,57 @@
"name": "Gargantext", "name": "Gargantext",
"version": "0.0.6.9.9.9.9.1", "version": "0.0.6.9.9.9.9.1",
"scripts": { "scripts": {
"generate-purs-packages-nix": "./nix/generate-purs-packages.nix", "css": "bun css-themes",
"generate-psc-packages-nix": "./nix/generate-packages-json.bash", "css-themes": "bun css-default-theme && bun css-dark-theme && bun css-darkster-theme && bun css-greyson-theme && bun css-herbie-theme && bun css-monotony-theme",
"css": "yarn css-themes",
"css-themes": "yarn css-default-theme && yarn css-dark-theme && yarn css-darkster-theme && yarn css-greyson-theme && yarn css-herbie-theme && yarn css-monotony-theme",
"css-default-theme": "sass src/sass/themes/default.scss:dist/styles/bootstrap-default.css", "css-default-theme": "sass src/sass/themes/default.scss:dist/styles/bootstrap-default.css",
"css-dark-theme": "cp node_modules/bootstrap-dark/src/bootstrap-dark.css dist/styles/bootstrap-dark.css", "css-dark-theme": "cp node_modules/bootstrap-dark/src/bootstrap-dark.css dist/styles/bootstrap-dark.css",
"css-darkster-theme": "sass src/sass/themes/darkster.scss:dist/styles/bootstrap-darkster.css", "css-darkster-theme": "sass src/sass/themes/darkster.scss:dist/styles/bootstrap-darkster.css",
"css-greyson-theme": "sass src/sass/themes/greyson.scss:dist/styles/bootstrap-greyson.css", "css-greyson-theme": "sass src/sass/themes/greyson.scss:dist/styles/bootstrap-greyson.css",
"css-herbie-theme": "sass src/sass/themes/herbie.scss:dist/styles/bootstrap-herbie.css", "css-herbie-theme": "sass src/sass/themes/herbie.scss:dist/styles/bootstrap-herbie.css",
"css-monotony-theme": "sass src/sass/themes/monotony.scss:dist/styles/bootstrap-monotony.css", "css-monotony-theme": "sass src/sass/themes/monotony.scss:dist/styles/bootstrap-monotony.css",
"css-npm": "npm run css-themes-npm", "docs": "bun spago docs",
"css-themes-npm": "npm run css-default-theme && npm run css-dark-theme && npm run css-darkster-theme && npm run css-greyson-theme && npm run css-herbie-theme && npm run css-monotony-theme",
"docs": "pulp docs -- --format html",
"repl": "pulp repl",
"clean": "rm -Rf output node_modules",
"clean-js": "rm -Rf node_modules",
"clean-ps": "rm -Rf output",
"server": "serve -l 8008 dist", "server": "serve -l 8008 dist",
"server-ssl": "ssl-serve --ssl dist", "server-ssl": "ssl-serve --ssl dist"
"build": "spago bundle-app --main Main --to dist/bundle.js",
"prod": "yarn prod:compile && yarn prod:dce && yarn prod:bundle && yarn prod:pack",
"prod:compile": "pulp build -- -g corefn",
"prod:dce": "zephyr -f Main.main",
"prod:bundle": "pulp browserify --skip-compile -o dce-output -t app.js",
"prod:pack": "parcel build index.html -d prod --public-url . --no-source-maps",
"test-pulp": "pulp test",
"test": "gauge run specs/"
}, },
"dependencies": { "dependencies": {
"@fontsource/crete-round": "^5.0.12", "@fontsource/crete-round": "~5.0.12",
"@fontsource/montserrat": "^5.0.17", "@fontsource/montserrat": "~5.0.17",
"@fontsource/mulish": "^5.0.16", "@fontsource/mulish": "^5.0.16",
"@fontsource/nunito": "^5.0.17", "@fontsource/nunito": "^5.0.17",
"@fontsource/open-sans": "^5.0.25", "@fontsource/open-sans": "~5.0.25",
"@fontsource/oswald": "^5.0.18", "@fontsource/oswald": "~5.0.18",
"@popperjs/core": "^2.9.2", "@popperjs/core": "~2.9.2",
"@urql/core": "^2.3.3", "@urql/core": "~2.3.3",
"aes-js": "^3.1.1", "aes-js": "~3.1.1",
"base-x": "^3.0.2", "base-x": "~3.0.2",
"bootstrap": "^4.6.0", "bootstrap": "~4.6.0",
"bootstrap-dark": "^1.0.3", "bootstrap-dark": "~1.0.3",
"buffer": "^6.0.3", "buffer": "~6.0.3",
"create-react-class": "^15.6.3", "create-react-class": "~15.6.3",
"crypto": "^1.0.1", "crypto": "~1.0.1",
"d3": "^7.6.1", "d3": "~7.6.1",
"echarts": "^5.1.2", "echarts": "~5.1.2",
"echarts-for-react": "^3.0.1", "echarts-for-react": "~3.0.1",
"esbuild": "^0.15.7", "graphology": "~0.25.1",
"graphology": "^0.25.1", "graphology-communities-louvain": "~2.0.1",
"graphology-communities-louvain": "^2.0.1", "graphology-layout-forceatlas2": "~0.9.2",
"graphology-layout-forceatlas2": "^0.9.2", "graphology-layout-noverlap": "~0.4.2",
"graphology-layout-noverlap": "^0.4.2", "graphology-operators": "~1.6.0",
"graphology-operators": "^1.6.0", "graphql": "~15.6.1",
"graphql": "^15.6.1", "graphql-ws": "~5.5.0",
"graphql-ws": "^5.5.0", "highlightjs": "~9.16.2",
"highlightjs": "^9.16.2", "immer": "~9.0.5",
"immer": "^9.0.5", "isomorphic-unfetch": "~3.1.0",
"isomorphic-unfetch": "^3.1.0", "markdown-it": "~13.0.1",
"markdown-it": "^13.0.1", "prop-types": "~15.6.2",
"prop-types": "^15.6.2", "pullstate": "~1.20.6",
"pullstate": "^1.20.6", "react-awesome-popover": "~6.1.1",
"react-awesome-popover": "^6.1.1", "react-bootstrap": "~1.5.2",
"react-bootstrap": "^1.5.2", "react-dom": "~17.0.2",
"react-dom": "^17.0.2", "react-tooltip": "~4.2.8",
"react-tooltip": "^4.2.8", "secp256k1": "~4.0.2",
"secp256k1": "^4.0.2", "sigma": "~2.4.0",
"sigma": "^2.4.0", "twgl.js": "~5.0.4",
"spago": "^0.93.29",
"twgl.js": "^5.0.4",
"uuid": "8.3.2" "uuid": "8.3.2"
}, },
"devDependencies": { "devDependencies": {
...@@ -78,10 +60,12 @@ ...@@ -78,10 +60,12 @@
"@babel/preset-env": "^7.15.6", "@babel/preset-env": "^7.15.6",
"@babel/preset-react": "^7.12.7", "@babel/preset-react": "^7.12.7",
"@getgauge/cli": "^1.4.0", "@getgauge/cli": "^1.4.0",
"esbuild": "^0.15.7",
"parcel": "^2.8.2", "parcel": "^2.8.2",
"react-testing-library": "^8.0.1", "react-testing-library": "^8.0.1",
"sass": "^1.35.2", "sass": "^1.35.2",
"serve": "^12.0.0", "serve": "^12.0.0",
"spago": "^0.93.29",
"ssl-serve": "^6.5.8", "ssl-serve": "^6.5.8",
"taiko": "latest", "taiko": "latest",
"vscode-languageserver": "^7.0.0", "vscode-languageserver": "^7.0.0",
......
...@@ -16,7 +16,8 @@ let ...@@ -16,7 +16,8 @@ let
set -e set -e
echo "Installing JS Dependencies" echo "Installing JS Dependencies"
yarn #yarn
bun install
echo "Compiling" echo "Compiling"
#build-purs #build-purs
...@@ -26,7 +27,7 @@ let ...@@ -26,7 +27,7 @@ let
#browserify #browserify
# 0.15 # 0.15
spago bundle-app --main Main --to dist/bundle.js bun spago bundle --module Main --outfile dist/bundle.js
''; '';
build-suggestions = pkgs.writeShellScriptBin "build-suggestions" '' build-suggestions = pkgs.writeShellScriptBin "build-suggestions" ''
...@@ -34,11 +35,13 @@ let ...@@ -34,11 +35,13 @@ let
set -e set -e
echo "Installing JS Dependencies" echo "Installing JS Dependencies"
yarn #yarn
bun install
rm -rf ./output rm -rf ./output
echo "Compiling" echo "Compiling"
bun spago build
#build-purs #build-purs
#spago build #spago build
#echo "Bundling" #echo "Bundling"
...@@ -46,7 +49,7 @@ let ...@@ -46,7 +49,7 @@ let
#browserify #browserify
# 0.15 # 0.15
spago bundle-app --main Main --to dist/bundle.js --purs-args "--json-errors" | jq -r '.warnings | map(select(.errorCode | test("UnusedDctorExplicitImport|UnusedDctorImport|UnusedDeclaration|UnusedExplicitImport|UnusedImport|UnusedName|UnusedTypeVar"))) | map(select(.filename | test("^.spago") | not)) | map("[\(.filename)::\(.position.startLine)] \(.message)\n \(.suggestion)") | join("\n----------\n")' bun spago bundle --module Main --outfile dist/bundle.js --purs-args "--json-errors" | jq -r '.warnings | map(select(.errorCode | test("UnusedDctorExplicitImport|UnusedDctorImport|UnusedDeclaration|UnusedExplicitImport|UnusedImport|UnusedName|UnusedTypeVar"))) | map(select(.filename | test("^.spago") | not)) | map("[\(.filename)::\(.position.startLine)] \(.message)\n \(.suggestion)") | join("\n----------\n")'
''; '';
...@@ -54,7 +57,8 @@ let ...@@ -54,7 +57,8 @@ let
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
yarn css #yarn css
bun css
''; '';
...@@ -62,7 +66,8 @@ let ...@@ -62,7 +66,8 @@ let
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
yarn server #yarn server
bun server
''; '';
...@@ -71,33 +76,18 @@ let ...@@ -71,33 +76,18 @@ let
set -e set -e
echo "Build watch" echo "Build watch"
spago build -w --then browserify bun spago build -w --then browserify
''; '';
build-zephyr = pkgs.writeShellScriptBin "build-zephyr" '' build-zephyr = pkgs.writeShellScriptBin "build-zephyr" ''
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
spago build --purs-args '--codegen corefn,js' bun spago build --purs-args '--codegen corefn,js'
zephyr -f Main.main zephyr -f Main.main
browserify-zephyr browserify-zephyr
''; '';
browserify = pkgs.writeShellScriptBin "browserify" ''
#!/usr/bin/env bash
set -e
pulp browserify --skip-compile -t dist/bundle.js --src-path output
'';
browserify-zephyr = pkgs.writeShellScriptBin "browserify-zephyr" ''
#!/usr/bin/env bash
set -e
pulp browserify --skip-compile -t dist/bundle.js -o dce-output
#purs bundle -o dist/bundle.js -m Main dce-output/**/*.js
'';
minify-bundle = pkgs.writeShellScriptBin "minify-bundle" '' minify-bundle = pkgs.writeShellScriptBin "minify-bundle" ''
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
...@@ -108,7 +98,7 @@ let ...@@ -108,7 +98,7 @@ let
repl = pkgs.writeShellScriptBin "repl" '' repl = pkgs.writeShellScriptBin "repl" ''
#!/usr/bin/env bash #!/usr/bin/env bash
spago repl bun spago repl
''; '';
test-ps = pkgs.writeShellScriptBin "test-ps" '' test-ps = pkgs.writeShellScriptBin "test-ps" ''
...@@ -116,11 +106,11 @@ let ...@@ -116,11 +106,11 @@ let
set -e set -e
echo "Compiling" echo "Compiling"
yarn bun install
#spago build #spago build
#build-purs #build-purs
echo "Testing" echo "Testing"
spago -v -x test.dhall test --main Test.Main bun spago test
# spago -x test.dhall bundle-app --main Test.Main --to dist/test-bundle.js --platform node # spago -x test.dhall bundle-app --main Test.Main --to dist/test-bundle.js --platform node
# pulp browserify --skip-compile -t dist/bundle.js --src-path output # pulp browserify --skip-compile -t dist/bundle.js --src-path output
# pulp test --src-path output --test-path output # pulp test --src-path output --test-path output
...@@ -147,13 +137,12 @@ pkgs.mkShell { ...@@ -147,13 +137,12 @@ pkgs.mkShell {
#pkgs.nodePackages.purescript-language-server #pkgs.nodePackages.purescript-language-server
#pkgs.python # needed for msgpack etc #pkgs.python # needed for msgpack etc
#nodejs_20_3_1 #nodejs_20_3_1
pkgs.pulp #pkgs.pulp
#pkgs.spago #pkgs.spago
pkgs.yarn #pkgs.yarn
pkgs.bun
# scripts # scripts
browserify
browserify-zephyr
build-css build-css
build-purs build-purs
build-suggestions build-suggestions
......
This diff is collapsed.
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