diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbb6a7ee..7c0f11e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 2 - name: Setup Node.js environment uses: actions/setup-node@v2 with: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..f7b0d07a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +See the [Changelog.mdx page](./packages/website/docs/Changelog.mdx) for the changelog. diff --git a/README.md b/README.md index 9be8b2b2..b2ec16c4 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,12 @@ turbo run build --filter=@quri/squiggle-components You can also run specific npm scripts for the package you're working on. See `packages/*/README.md` for the details. +# NixOS users + +This repository requires the use of bundled binaries from node_modules, which +are not linked statically. The easiest way to get them working is to enable +[nix-ld](https://github.com/Mic92/nix-ld). + # Contributing See `CONTRIBUTING.md`. diff --git a/nix/squiggle-lang.nix b/nix/squiggle-lang.nix index 724533cf..0adfae47 100644 --- a/nix/squiggle-lang.nix +++ b/nix/squiggle-lang.nix @@ -30,16 +30,6 @@ rec { patchelf --replace-needed libstdc++.so.6 $THE_SO linux/ninja.exe && echo "- replaced needed for linux/ninja.exe" ''; }; - bisect_ppx = { - buildInputs = common.which; - postInstall = '' - echo "PATCHELF'ING BISECT_PPX EXECUTABLE" - THE_LD=$(patchelf --print-interpreter $(which mkdir)) - patchelf --set-interpreter $THE_LD bin/linux/ppx - patchelf --set-interpreter $THE_LD bin/linux/bisect-ppx-report - cp bin/linux/ppx ppx - ''; - }; gentype = { postInstall = '' mv gentype.exe ELFLESS-gentype.exe diff --git a/nixos.sh b/nixos.sh deleted file mode 100755 index 28ff5d91..00000000 --- a/nixos.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# This script is only relevant if you're rolling nixos. - -# Esy (a bisect_ppx dependency/build tool) is borked on nixos without using an FHS shell. https://github.com/esy/esy/issues/858 -# We need to patchelf rescript executables. https://github.com/NixOS/nixpkgs/issues/107375 -set -x - -fhsShellName="squiggle-fhs-development" -fhsShellDotNix="{pkgs ? import {} }: (pkgs.buildFHSUserEnv { name = \"${fhsShellName}\"; targetPkgs = pkgs: [pkgs.yarn pkgs.glibc]; runScript = \"yarn\"; }).env" -nix-shell - <<<"$fhsShellDotNix" - -theLd=$(patchelf --print-interpreter $(which mkdir)) -patchelf --set-interpreter $theLd ./node_modules/gentype/gentype.exe -patchelf --set-interpreter $theLd ./node_modules/rescript/linux/*.exe -patchelf --set-interpreter $theLd ./node_modules/bisect_ppx/ppx -patchelf --set-interpreter $theLd ./node_modules/bisect_ppx/bisect-ppx-report -theSo=$(find /nix/store/*$fhsShellName*/lib64 -name libstdc++.so.6 | head -n 1) -patchelf --replace-needed libstdc++.so.6 $theSo ./node_modules/rescript/linux/ninja.exe diff --git a/packages/cli/README.md b/packages/cli/README.md index 7b0d0038..ec9e334b 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -20,3 +20,30 @@ Runs compilation in the current directory and all of its subdirectories. ### `npx squiggle-cli-experimental watch` Watches `.squiggleU` files in the current directory (and subdirectories) and rebuilds them when they are saved. Note that this will _not_ rebuild files when their dependencies are changed, just when they are changed directly. + +## Further instructions + +The above requires having node, npm and npx. To install the first two, see [here](https://nodejs.org/en/), to install npx, run: + +``` +npm install -g npx +``` + +Alternatively, you can run the following without the need for npx: + +``` +npm install squiggle-cli-experimental +node node_modules/squiggle-cli-experimental/index.js compile +``` + +or you can add a script to your `package.json`, like: + +``` + ... + scripts: { + "compile": "squiggle-cli-experimental compile" + } + ... +``` + +This can be run with `npm run compile`. `npm` knows how to reach into the node_modules directly, so it's not necessary to specify that. diff --git a/packages/cli/package.json b/packages/cli/package.json index 92a088f0..a21a9939 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -13,7 +13,7 @@ }, "license": "MIT", "dependencies": { - "chalk": "^5.0.1", + "chalk": "^5.1.0", "chokidar": "^3.5.3", "commander": "^9.4.1", "fs": "^0.0.1-security", diff --git a/packages/components/package.json b/packages/components/package.json index 6e0cba3f..2669594c 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -12,11 +12,11 @@ "@react-hook/size": "^2.1.2", "@types/uuid": "^8.3.4", "clsx": "^1.2.1", - "framer-motion": "^7.5.1", + "framer-motion": "^7.5.3", "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", - "react-hook-form": "^7.36.1", + "react-hook-form": "^7.37.0", "react-use": "^17.4.0", "react-vega": "^7.6.0", "uuid": "^9.0.0", @@ -41,7 +41,7 @@ "@testing-library/user-event": "^14.4.3", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.186", - "@types/node": "^18.8.0", + "@types/node": "^18.8.3", "@types/react": "^18.0.21", "@types/styled-components": "^5.1.26", "@types/uuid": "^8.3.4", @@ -49,8 +49,8 @@ "canvas": "^2.10.1", "cross-env": "^7.0.3", "jest": "^29.0.3", - "jest-environment-jsdom": "^29.0.3", - "jsdom": "^20.0.0", + "jest-environment-jsdom": "^29.1.2", + "jsdom": "^20.0.1", "mini-css-extract-plugin": "^2.6.1", "postcss-cli": "^10.0.0", "postcss-import": "^15.0.0", @@ -60,11 +60,11 @@ "react-scripts": "^5.0.1", "style-loader": "^3.3.1", "tailwindcss": "^3.1.8", - "ts-jest": "^29.0.2", + "ts-jest": "^29.0.3", "ts-loader": "^9.4.1", "tsconfig-paths-webpack-plugin": "^4.0.0", "typescript": "^4.8.4", - "web-vitals": "^3.0.2", + "web-vitals": "^3.0.3", "webpack": "^5.74.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.11.1" diff --git a/packages/components/src/components/SquiggleEditor.tsx b/packages/components/src/components/SquiggleEditor.tsx index 49810b39..2e3b44fa 100644 --- a/packages/components/src/components/SquiggleEditor.tsx +++ b/packages/components/src/components/SquiggleEditor.tsx @@ -16,7 +16,7 @@ const WrappedCodeEditor: React.FC<{ setCode: (code: string) => void; errorLocations?: SqLocation[]; }> = ({ code, setCode, errorLocations }) => ( -
+
+
{autorunMode ? null : (