From 516f4fa39d609d0d26a7a1f088d5574d5e2a3985 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Aug 2022 17:10:08 -0700 Subject: [PATCH 01/55] Added truncate for SampleSet distribution --- .../ReducerInterface_Distribution_test.res | 1 + .../rescript/Distributions/GenericDist.res | 18 ++++++++---- .../SampleSetDist/SampleSetDist.res | 9 ++++++ packages/website/docs/Api/Dist.mdx | 29 +++++++++++++++---- 4 files changed, 46 insertions(+), 11 deletions(-) diff --git a/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res b/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res index 3083b71b..47f1bc8a 100644 --- a/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res +++ b/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res @@ -74,6 +74,7 @@ describe("eval on distribution functions", () => { testEval("truncateLeft(normal(5,2), 3)", "Ok(Point Set Distribution)") testEval("truncateRight(normal(5,2), 3)", "Ok(Point Set Distribution)") testEval("truncate(normal(5,2), 3, 8)", "Ok(Point Set Distribution)") + testEval("truncate(normal(5,2) |> SampleSet.fromDist, 3, 8)", "Ok(Sample Set Distribution)") testEval("isNormalized(truncate(normal(5,2), 3, 8))", "Ok(true)") }) diff --git a/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res b/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res index f536d54d..14abd1b6 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res @@ -242,11 +242,19 @@ module Truncate = { switch trySymbolicSimplification(leftCutoff, rightCutoff, t) { | Some(r) => Ok(r) | None => - toPointSetFn(t)->E.R2.fmap(t => { - DistributionTypes.PointSet( - PointSetDist.T.truncate(leftCutoff, rightCutoff, t)->PointSetDist.T.normalize, - ) - }) + switch t { + | SampleSet(t) => + switch SampleSetDist.truncate(t, ~leftCutoff, ~rightCutoff) { + | Ok(r) => Ok(SampleSet(r)) + | Error(err) => Error(DistributionTypes.SampleSetError(err)) + } + | _ => + toPointSetFn(t)->E.R2.fmap(t => { + DistributionTypes.PointSet( + PointSetDist.T.truncate(leftCutoff, rightCutoff, t)->PointSetDist.T.normalize, + ) + }) + } } } } diff --git a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res index dc15f7a1..f0fbff99 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res @@ -131,3 +131,12 @@ let max = t => T.get(t)->E.A.Floats.max let stdev = t => T.get(t)->E.A.Floats.stdev let variance = t => T.get(t)->E.A.Floats.variance let percentile = (t, f) => T.get(t)->E.A.Floats.percentile(f) + +let truncateLeft = (t, f) => T.get(t)->E.A2.filter(x => x >= f)->T.make +let truncateRight = (t, f) => T.get(t)->E.A2.filter(x => x <= f)->T.make + +let truncate = (t, ~leftCutoff: option, ~rightCutoff: option) => { + let withTruncatedLeft = t => leftCutoff |> E.O.dimap(left => truncateLeft(t, left), _ => Ok(t)) + let withTruncatedRight = t => rightCutoff |> E.O.dimap(left => truncateRight(t, left), _ => Ok(t)) + t->withTruncatedLeft |> E.R2.bind(withTruncatedRight) +} diff --git a/packages/website/docs/Api/Dist.mdx b/packages/website/docs/Api/Dist.mdx index e37c6f75..6bde09c9 100644 --- a/packages/website/docs/Api/Dist.mdx +++ b/packages/website/docs/Api/Dist.mdx @@ -290,12 +290,29 @@ quantile: (distribution, number) => number quantile(normal(5, 2), 0.5); ``` -### truncateLeft +### truncate -Truncates the left side of a distribution. Returns either a pointSet distribution or a symbolic distribution. +Truncates both the left side and the right side of a distribution. ``` -truncateLeft: (distribution, l => number) => distribution +truncate: (distribution, left: number, right: number) => distribution +``` + + +

+ Sample set distributions are truncated by filtering samples, but point set + distributions are truncated using direct geometric manipulation. Uniform + distributions are truncated symbolically. Symbolic but non-uniform + distributions get converted to Point Set distributions. +

+
+ +### truncateLeft + +Truncates the left side of a distribution. + +``` +truncateLeft: (distribution, left: number) => distribution ``` **Examples** @@ -306,10 +323,10 @@ truncateLeft(normal(5, 2), 3); ### truncateRight -Truncates the right side of a distribution. Returns either a pointSet distribution or a symbolic distribution. +Truncates the right side of a distribution. ``` -truncateRight: (distribution, r => number) => distribution +truncateRight: (distribution, right: number) => distribution ``` **Examples** @@ -388,7 +405,7 @@ The only functions that do not return normalized distributions are the pointwise ### normalize -Normalize a distribution. This means scaling it appropriately so that it's cumulative sum is equal to 1. This only impacts Pointset distributions, because those are the only ones that can be non-normlized. +Normalize a distribution. This means scaling it appropriately so that it's cumulative sum is equal to 1. This only impacts Point Set distributions, because those are the only ones that can be non-normlized. ``` normalize: (distribution) => distribution From 7237f2709b22e37225cb25447fbf989916b5e5f3 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Aug 2022 20:32:41 -0700 Subject: [PATCH 02/55] First implementation of sampleSet mixed distribution --- .../Distributions/DistributionOperation.res | 2 +- .../rescript/Distributions/GenericDist.res | 21 ++++++++++++++++--- .../rescript/Distributions/GenericDist.resi | 1 + .../SampleSetDist/SampleSetDist.res | 12 +++++++++++ .../squiggle-lang/src/rescript/Utility/E.res | 1 + 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Distributions/DistributionOperation.res b/packages/squiggle-lang/src/rescript/Distributions/DistributionOperation.res index 319535c1..9c61211e 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/DistributionOperation.res +++ b/packages/squiggle-lang/src/rescript/Distributions/DistributionOperation.res @@ -216,7 +216,7 @@ let rec run = (~env: env, functionCallInfo: functionCallInfo): outputType => { | FromFloat(subFnName, x) => reCall(~functionCallInfo=FromFloat(subFnName, x), ()) | Mixture(dists) => dists - ->GenericDist.mixture(~scaleMultiplyFn=scaleMultiply, ~pointwiseAddFn=pointwiseAdd) + ->GenericDist.mixture(~scaleMultiplyFn=scaleMultiply, ~pointwiseAddFn=pointwiseAdd, ~env) ->E.R2.fmap(r => Dist(r)) ->OutputLocal.fromResult | FromSamples(xs) => diff --git a/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res b/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res index f536d54d..0676ab44 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res @@ -491,15 +491,30 @@ let pointwiseCombinationFloat = ( m->E.R2.fmap(r => DistributionTypes.PointSet(r)) } -//Note: The result should always cumulatively sum to 1. This would be good to test. -//Note: If the inputs are not normalized, this will return poor results. The weights probably refer to the post-normalized forms. It would be good to apply a catch to this. +//TODO: The result should always cumulatively sum to 1. This would be good to test. +//TODO: If the inputs are not normalized, this will return poor results. The weights probably refer to the post-normalized forms. It would be good to apply a catch to this. let mixture = ( values: array<(t, float)>, ~scaleMultiplyFn: scaleMultiplyFn, ~pointwiseAddFn: pointwiseAddFn, + ~env: env, ) => { - if E.A.length(values) == 0 { + let allValuesAreSampleSet = v => E.A.all(((t, _)) => isSampleSetSet(t), v) + + if E.A.isEmpty(values) { Error(DistributionTypes.OtherError("Mixture error: mixture must have at least 1 element")) + } else if allValuesAreSampleSet(values) { + let withSampleSetValues = values->E.A2.fmap(((value, weight)) => + switch value { + | SampleSet(sampleSet) => Ok((sampleSet, weight)) + | _ => Error("Unreachable") + } |> E.R.toExn("Mixture coding error: SampleSet expected. This should be inaccessible.") + ) + let sampleSetMixture = SampleSetDist.mixture(withSampleSetValues, env.sampleCount) + switch sampleSetMixture { + | Ok(sampleSet) => Ok(DistributionTypes.SampleSet(sampleSet)) + | Error(err) => Error(DistributionTypes.Error.sampleErrorToDistErr(err)) + } } else { let totalWeight = values->E.A2.fmap(E.Tuple2.second)->E.A.Floats.sum let properlyWeightedValues = diff --git a/packages/squiggle-lang/src/rescript/Distributions/GenericDist.resi b/packages/squiggle-lang/src/rescript/Distributions/GenericDist.resi index fd04212a..94fe44ad 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/GenericDist.resi +++ b/packages/squiggle-lang/src/rescript/Distributions/GenericDist.resi @@ -81,6 +81,7 @@ let mixture: ( array<(t, float)>, ~scaleMultiplyFn: scaleMultiplyFn, ~pointwiseAddFn: pointwiseAddFn, + ~env: env, ) => result let isSymbolic: t => bool diff --git a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res index dc15f7a1..f8e93df1 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res @@ -131,3 +131,15 @@ let max = t => T.get(t)->E.A.Floats.max let stdev = t => T.get(t)->E.A.Floats.stdev let variance = t => T.get(t)->E.A.Floats.variance let percentile = (t, f) => T.get(t)->E.A.Floats.percentile(f) + +let mixture = (values: array<(t, float)>, intendedLength: int) => { + let totalWeight = values->E.A2.fmap(E.Tuple2.second)->E.A.Floats.sum + values + ->E.A2.fmap(((dist, weight)) => { + let adjustedWeight = weight /. totalWeight + let samplesToGet = adjustedWeight *. E.I.toFloat(intendedLength) |> E.Float.toInt + sampleN(dist, samplesToGet) + }) + ->E.A.concatMany + ->T.make +} diff --git a/packages/squiggle-lang/src/rescript/Utility/E.res b/packages/squiggle-lang/src/rescript/Utility/E.res index 22c8c525..5930db23 100644 --- a/packages/squiggle-lang/src/rescript/Utility/E.res +++ b/packages/squiggle-lang/src/rescript/Utility/E.res @@ -220,6 +220,7 @@ module I = { let increment = n => n + 1 let decrement = n => n - 1 let toString = Js.Int.toString + let toFloat = Js.Int.toFloat } exception Assertion(string) From e1efefaf7d293de988ad0db8de998cf514a67e4f Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 21 Aug 2022 21:45:05 -0700 Subject: [PATCH 03/55] Added sampleN from Stdlib to allow for correct sampling of discrete distributions --- .../squiggle-lang/__tests__/Stdlib_test.res | 16 +++++++++++++ packages/squiggle-lang/package.json | 1 + .../Distributions/PointSetDist/Discrete.res | 5 ++++ .../PointSetDist/PointSetDist.res | 4 ++++ .../SampleSetDist/SampleSetDist.res | 23 ++++++++++++------- .../src/rescript/Utility/Stdlib.res | 8 +++++++ 6 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 packages/squiggle-lang/__tests__/Stdlib_test.res diff --git a/packages/squiggle-lang/__tests__/Stdlib_test.res b/packages/squiggle-lang/__tests__/Stdlib_test.res new file mode 100644 index 00000000..6b571fab --- /dev/null +++ b/packages/squiggle-lang/__tests__/Stdlib_test.res @@ -0,0 +1,16 @@ +open Jest +open Expect + +let makeTest = (~only=false, str, item1, item2) => + only + ? Only.test(str, () => expect(item1)->toEqual(item2)) + : test(str, () => expect(item1)->toEqual(item2)) + +describe("Stdlib", () => { + makeTest("min", Stdlib.Random.sample([1.0, 2.0], {probs: [0.5, 0.5], size: 10}) |> E.A.length, 10) + makeTest( + "min", + Stdlib.Random.sample([1.0, 2.0], {probs: [0.5, 0.5], size: 10}) |> E.A.uniq |> E.A.Floats.sort, + [1.0, 2.0], + ) +}) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index a94197f8..164d62de 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -18,6 +18,7 @@ "benchmark": "ts-node benchmark/conversion_tests.ts", "test": "jest", "test:ts": "jest __tests__/TS/", + "test:stdlib": "jest __tests__/Stdlib_test.bs.js", "test:rescript": "jest --modulePathIgnorePatterns=__tests__/TS/*", "test:watch": "jest --watchAll", "test:fnRegistry": "jest __tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.bs.js", diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res index b7d5ffd4..ba708f0b 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res @@ -224,3 +224,8 @@ module T = Dist({ XYShape.Analysis.getVarianceDangerously(t, mean, getMeanOfSquares) } }) + +let sampleN = (t: t, n): array => { + let normalized = t |> T.normalize |> getShape + Stdlib.Random.sample(normalized.xs, {probs: normalized.ys, size: n}) +} diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res index 6fd2582d..bbf2b074 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res @@ -257,3 +257,7 @@ let toSparkline = (t: t, bucketCount): resultE.O2.fmap(Continuous.downsampleEquallyOverX(bucketCount)) ->E.O2.toResult(PointSetTypes.CannotSparklineDiscrete) ->E.R2.fmap(r => Continuous.getShape(r).ys->Sparklines.create()) + +let makeDiscrete = (d):t => Discrete(d) +let makeContinuous = (d):t => Continuous(d) +let makeMixed = (d):t => Mixed(d) \ No newline at end of file diff --git a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res index f8e93df1..8ad2cbef 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res @@ -134,12 +134,19 @@ let percentile = (t, f) => T.get(t)->E.A.Floats.percentile(f) let mixture = (values: array<(t, float)>, intendedLength: int) => { let totalWeight = values->E.A2.fmap(E.Tuple2.second)->E.A.Floats.sum - values - ->E.A2.fmap(((dist, weight)) => { - let adjustedWeight = weight /. totalWeight - let samplesToGet = adjustedWeight *. E.I.toFloat(intendedLength) |> E.Float.toInt - sampleN(dist, samplesToGet) - }) - ->E.A.concatMany - ->T.make + let discreteSamples = + values + ->Belt.Array.mapWithIndex((i, (_, weight)) => (E.I.toFloat(i), weight /. totalWeight)) + ->XYShape.T.fromZippedArray + ->Discrete.make + ->Discrete.sampleN(intendedLength) + let dists = values->E.A2.fmap(E.Tuple2.first)->E.A2.fmap(T.get) + let samples = + discreteSamples + ->Belt.Array.mapWithIndex((index, distIndexToChoose) => { + let chosenDist = E.A.get(dists, E.Float.toInt(distIndexToChoose)) + chosenDist |> E.O2.bind(E.A.get(_, index)) + }) + ->E.A.O.openIfAllSome + (samples |> E.O.toExn("Mixture unreachable error"))->T.make } diff --git a/packages/squiggle-lang/src/rescript/Utility/Stdlib.res b/packages/squiggle-lang/src/rescript/Utility/Stdlib.res index faa1cb1d..a0bde73d 100644 --- a/packages/squiggle-lang/src/rescript/Utility/Stdlib.res +++ b/packages/squiggle-lang/src/rescript/Utility/Stdlib.res @@ -38,3 +38,11 @@ module Logistic = { @module external variance: (float, float) => float = "@stdlib/stats/base/dists/logistic/variance" let variance = variance } + +module Random = { + type sampleArgs = { + probs: array, + size: int, + } + @module external sample: (array, sampleArgs) => array = "@stdlib/random/sample" +} \ No newline at end of file From 9e342d884f2c290caa753c8335387e351dc7fd5d Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 29 Aug 2022 21:39:18 +0800 Subject: [PATCH 04/55] init nix --- .github/workflows/ci-cachix.yml | 37 +++++++++ .gitignore | 1 + flake.lock | 79 +++++++++++++++++++ flake.nix | 95 +++++++++++++++++++++++ nix/README.md | 1 + nix/shell.nix | 21 +++++ nix/squiggle-components.nix | 75 ++++++++++++++++++ nix/squiggle-lang.nix | 116 ++++++++++++++++++++++++++++ nix/squiggle-vscode.nix | 23 ++++++ nix/squiggle-website.nix | 30 +++++++ nixos.sh | 4 +- packages/squiggle-lang/package.json | 1 + packages/vscode-ext/.prettierignore | 3 + packages/vscode-ext/package.json | 2 +- yarn.lock | 2 +- 15 files changed, 486 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci-cachix.yml create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 nix/README.md create mode 100644 nix/shell.nix create mode 100644 nix/squiggle-components.nix create mode 100644 nix/squiggle-lang.nix create mode 100644 nix/squiggle-vscode.nix create mode 100644 nix/squiggle-website.nix create mode 100644 packages/vscode-ext/.prettierignore diff --git a/.github/workflows/ci-cachix.yml b/.github/workflows/ci-cachix.yml new file mode 100644 index 00000000..39051677 --- /dev/null +++ b/.github/workflows/ci-cachix.yml @@ -0,0 +1,37 @@ +name: Builds, lints, tests in nix + +on: [push, pull_request] + +jobs: + flake: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Install nix + uses: cachix/install-nix-action@v17 + with: + nix_path: nixpkgs=channel:nixos-unstable + - name: Use cachix + uses: cachix/cachix-action@v10 + with: + name: quantified-uncertainty + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Check that lang lints + run: nix build .#lang-lint + - name: Check that components lints + run: nix build .#components-lint + - name: Check that website lints + run: nix build .#docusaurus-lint + - name: Check that vscode extension lints + run: nix build .#vscode-lint + + - name: Check that lang bundles + run: nix build .#lang-bundle + - name: Check all lang tests + run: nix build .#lang-test + - name: Check that components builds + run: nix build .#components + - name: Check that components bundles + run: nix build .#components-bundle diff --git a/.gitignore b/.gitignore index 5b48f91c..0a2d50fe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ yarn-error.log **/.sync.ffs_db .direnv .log +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..fcadffff --- /dev/null +++ b/flake.lock @@ -0,0 +1,79 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gentype": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660630689, + "narHash": "sha256-oM21qcr+VtI69GIm56UDy6oGiupq2GkZDIaKXWWnM8k=", + "owner": "quinn-dougherty", + "repo": "genType", + "rev": "c2a022cfec32b5a61d575205daa93416a9a9309c", + "type": "github" + }, + "original": { + "owner": "quinn-dougherty", + "repo": "genType", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1661617163, + "narHash": "sha256-NN9Ky47j8ohgPhA9JZyfkYIbbAo6RJkGz+7h8/exVpE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0ba2543f8c855d7be8e90ef6c8dc89c1617e8a08", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-22.05", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "gentype": "gentype", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..fa8efa59 --- /dev/null +++ b/flake.nix @@ -0,0 +1,95 @@ +{ + description = "Squiggle CI"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-22.05"; + gentype = { + url = github:quinn-dougherty/genType; + inputs.nixpkgs.follows = "nixpkgs"; + }; + flake-utils = { + url = github:numtide/flake-utils; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, gentype, flake-utils }: + let + version = builtins.substring 0 8 self.lastModifiedDate; + overlays = [ + (final: prev: { + # set the node version here + nodejs = prev.nodejs-18_x; + # The override is the only way to get it into mkYarnModules + }) + ]; + + commonFn = pkgs: { + buildInputs = with pkgs; [ nodejs yarn ]; + prettier = with pkgs.nodePackages; [ prettier ]; + which = [ pkgs.which ]; + }; + gentypeOutputFn = pkgs: gentype.outputs.packages.${pkgs.system}.default; + langFn = { pkgs, ... }: + # Probably doesn't work on i686-linux + import ./nix/squiggle-lang.nix { + inherit pkgs commonFn gentypeOutputFn; + }; + componentsFn = { pkgs, ... }: + import ./nix/squiggle-components.nix { + inherit pkgs commonFn langFn; + }; + websiteFn = { pkgs, ... }: + import ./nix/squiggle-website.nix { + inherit pkgs commonFn langFn componentsFn; + }; + vscodeextFn = { pkgs, ... }: + import ./nix/squiggle-vscode.nix { + inherit pkgs commonFn langFn componentsFn; + }; + + # local machines + localFlakeOutputs = { pkgs, ... }: + let + lang = langFn pkgs; + components = componentsFn pkgs; + website = websiteFn pkgs; + vscodeext = vscodeextFn pkgs; + in { + # validating + checks = flake-utils.lib.flattenTree { + lang-lint = lang.lint; + lang-test = lang.test; + components-lint = components.lint; + docusaurus-lint = website.lint; + }; + # building + packages = flake-utils.lib.flattenTree { + default = components.build; + lang-bundle = lang.bundle; + lang-test = lang.test; + components = components.build; + components-bundle = components.bundle; + + # Lint + lang-lint = lang.lint; + components-lint = components.lint; + docusaurus-lint = website.lint; + vscode-lint = vscodeext.lint; + }; + + # developing + devShells = flake-utils.lib.flattenTree { + default = + (import ./nix/shell.nix { inherit pkgs; }).shell; + }; + }; + in flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = overlays; + }; + + in localFlakeOutputs pkgs); +} diff --git a/nix/README.md b/nix/README.md new file mode 100644 index 00000000..cadf6b82 --- /dev/null +++ b/nix/README.md @@ -0,0 +1 @@ +Visit `quantified-uncertainty.cachix.org` for information about how to add our binary cache to your local dev environment. diff --git a/nix/shell.nix b/nix/shell.nix new file mode 100644 index 00000000..16c20eab --- /dev/null +++ b/nix/shell.nix @@ -0,0 +1,21 @@ +{ pkgs }: +with pkgs; { + shell = mkShell { + name = "SQUIGGLE_yarn-wasm-devshell"; + buildInputs = [ + wasm-pack + cargo + yarn + nodejs + nodePackages.ts-node + rustup + pkg-config + libressl + nixfmt + rustfmt + wasmtime + binaryen + wasm-bindgen-cli + ]; + }; +} diff --git a/nix/squiggle-components.nix b/nix/squiggle-components.nix new file mode 100644 index 00000000..3a01641f --- /dev/null +++ b/nix/squiggle-components.nix @@ -0,0 +1,75 @@ +{ pkgs, commonFn, langFn }: + +rec { + common = commonFn pkgs; + lang = langFn pkgs; + componentsPackageJson = let + raw = pkgs.lib.importJSON ../packages/components/package.json; + modified = + pkgs.lib.recursiveUpdate raw { dependencies.react-dom = "^18.2.0"; }; + packageJsonString = builtins.toJSON modified; + in pkgs.writeText "packages/components/patched-package.json" + packageJsonString; + yarn-source = pkgs.mkYarnPackage { + name = "squiggle-components_yarnsource"; + buildInputs = common.buildInputs; + src = ../packages/components; + packageJSON = componentsPackageJson; + yarnLock = ../yarn.lock; + packageResolutions."@quri/squiggle-lang" = lang.build; + }; + lint = pkgs.stdenv.mkDerivation { + name = "squiggle-components-lint"; + src = ../packages/components; + buildInputs = common.buildInputs ++ common.prettier; + buildPhase = "yarn lint"; + installPhase = "mkdir -p $out"; + }; + build = pkgs.stdenv.mkDerivation { + name = "squiggle-components-build"; + src = yarn-source + "/libexec/@quri/squiggle-components"; + buildInputs = common.buildInputs; + buildPhase = '' + cp -r node_modules/@quri/squiggle-lang deps/@quri + pushd deps/@quri/squiggle-components + + yarn --offline build:cjs + yarn --offline build:css + popd + ''; + installPhase = '' + mkdir -p $out + + # annoying hack because permissions on transitive dependencies later on + mv deps/@quri/squiggle-components/node_modules deps/@quri/squiggle-components/NODE_MODULES + mv node_modules deps/@quri/squiggle-components + + # patching .gitignore so flake keeps build artefacts + sed -i /dist/d deps/@quri/squiggle-components/.gitignore + cp -r deps/@quri/squiggle-components/. $out + ''; + }; + bundle = pkgs.stdenv.mkDerivation { + name = "squiggle-components-bundle"; + src = yarn-source + "/libexec/@quri/squiggle-components"; + buildInputs = common.buildInputs; + buildPhase = '' + cp -r node_modules/@quri/squiggle-lang deps/@quri + pushd deps/@quri/squiggle-components + + yarn --offline bundle + popd + ''; + installPhase = '' + mkdir -p $out + + # annoying hack because permissions on transitive dependencies later on + mv deps/@quri/squiggle-components/node_modules deps/@quri/squiggle-components/NODE_MODULES + mv node_modules deps/@quri/squiggle-components + + # patching .gitignore so flake keeps build artefacts + sed -i /dist/d deps/@quri/squiggle-components/.gitignore + cp -r deps/@quri/squiggle-components/. $out + ''; + }; +} diff --git a/nix/squiggle-lang.nix b/nix/squiggle-lang.nix new file mode 100644 index 00000000..e7ad21ee --- /dev/null +++ b/nix/squiggle-lang.nix @@ -0,0 +1,116 @@ +{ pkgs, commonFn, gentypeOutputFn }: + +rec { + common = commonFn pkgs; + yarn-source = pkgs.mkYarnPackage { + name = "squiggle-lang_yarnsource"; + src = ../packages/squiggle-lang; + packageJSON = ../packages/squiggle-lang/package.json; + yarnLock = ../yarn.lock; + pkgConfig = { + rescript = { + buildInputs = common.which ++ (if pkgs.system != "i686-linux" then [ pkgs.gcc_multi ] else []); + postInstall = '' + echo "PATCHELF'ING RESCRIPT EXECUTABLES (INCL NINJA)" + # Patching interpreter for linux/*.exe's + THE_LD=$(patchelf --print-interpreter $(which mkdir)) + patchelf --set-interpreter $THE_LD linux/*.exe && echo "- patched interpreter for linux/*.exe's" + + # Replacing needed shared library for linux/ninja.exe + THE_SO=$(find /nix/store/*/lib64 -name libstdc++.so.6 | head -n 1) + 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 + cp ${gentypeOutputFn pkgs}/src/GenType.exe gentype.exe + ''; + }; + }; + }; + lint = pkgs.stdenv.mkDerivation { + name = "squiggle-lang-lint"; + src = yarn-source + "/libexec/@quri/squiggle-lang/deps/@quri/squiggle-lang"; + buildInputs = common.buildInputs ++ common.prettier; + buildPhase = '' + yarn lint:prettier + yarn lint:rescript + ''; + installPhase = "mkdir -p $out"; + }; + build = pkgs.stdenv.mkDerivation { + name = "squiggle-lang-build"; + # `peggy` is in the `node_modules` that's adjacent to `deps`. + src = yarn-source + "/libexec/@quri/squiggle-lang"; + buildInputs = common.buildInputs; + buildPhase = '' + # so that the path to ppx doesn't need to be patched. + mv node_modules deps + + pushd deps/@quri/squiggle-lang + yarn --offline build:peggy + yarn --offline build:rescript + yarn --offline build:typescript + + # custom gitignore so that the flake keeps build artefacts + mv .gitignore GITIGNORE + sed -i /Reducer_Peggy_GeneratedParser.js/d GITIGNORE + sed -i /\*.bs.js/d GITIGNORE + sed -i /\*.gen.ts/d GITIGNORE + sed -i /\*.gen.tsx/d GITIGNORE + sed -i /\*.gen.js/d GITIGNORE + sed -i /helpers.js/d GITIGNORE + + popd + ''; + installPhase = '' + mkdir -p $out + # mkdir -p $out/node_modules + mv deps/@quri/squiggle-lang/GITIGNORE deps/@quri/squiggle-lang/.gitignore + + # annoying hack because permissions on transitive dependencies later on + mv deps/@quri/squiggle-lang/node_modules deps/@quri/squiggle-lang/NODE_MODULES + mv deps/node_modules deps/@quri/squiggle-lang + + # the proper install phase + cp -r deps/@quri/squiggle-lang/. $out + ''; + }; + test = pkgs.stdenv.mkDerivation { + name = "squiggle-lang-test"; + src = build; + buildInputs = common.buildInputs; + buildPhase = '' + yarn --offline test + ''; + installPhase = '' + mkdir -p $out + cp -r . $out + ''; + }; + bundle = pkgs.stdenv.mkDerivation { + name = "squiggle-lang-bundle"; + src = test; + buildInputs = common.buildInputs; + buildPhase = '' + yarn --offline bundle + ''; + installPhase = '' + mkdir -p $out + cp -r dist $out + cp *.json $out/dist + ''; + }; + +} diff --git a/nix/squiggle-vscode.nix b/nix/squiggle-vscode.nix new file mode 100644 index 00000000..433d6caa --- /dev/null +++ b/nix/squiggle-vscode.nix @@ -0,0 +1,23 @@ +{ pkgs, commonFn, langFn, componentsFn }: + +rec { + common = commonFn pkgs; + lang = langFn pkgs; + components = componentsFn pkgs; + + yarn-source = pkgs.mkYarnPackage { + name = "squiggle-vscodeext_yarnsource"; + src = ../packages/vscode-ext; + packageJson = ../packages/vscode-ext/package.json; + yarnLock = ../yarn.lock; + packageResolutions."@quri/squiggle-lang" = lang.build; + packageResolutions."@quri/squiggle-components" = components.build; + }; + lint = pkgs.stdenv.mkDerivation { + name = "squiggle-vscode-lint"; + buildInputs = common.buildInputs ++ common.prettier; + src = ../packages/vscode-ext; # yarn-source + "/libexec/vscode-squiggle/deps/vscode-squiggle"; + buildPhase = "prettier --check ."; + installPhase = "mkdir -p $out"; + }; +} diff --git a/nix/squiggle-website.nix b/nix/squiggle-website.nix new file mode 100644 index 00000000..a3ee1856 --- /dev/null +++ b/nix/squiggle-website.nix @@ -0,0 +1,30 @@ +{ pkgs, commonFn, langFn, componentsFn }: + +rec { + common = commonFn pkgs; +# lang = langFn pkgs; +# components = componentsFn pkgs; +# websitePackageJson = let +# raw = pkgs.lib.importJSON ../packages/website/package.json; +# modified = pkgs.lib.recursiveUpdate raw { +# dependencies.postcss-import = "^14.1.0"; +# dependencies.tailwindcss = "^3.1.8"; +# }; +# packageJsonString = builtins.toJSON modified; +# in pkgs.writeText "packages/website/patched-package.json" packageJsonString; +# yarn-source = pkgs.mkYarnPackage { +# name = "squiggle-website_yarnsource"; +# src = ../packages/website; +# packageJSON = websitePackageJson; +# yarnLock = ../yarn.lock; +# packageResolutions."@quri/squiggle-lang" = lang.build; +# packageResolutions."@quri/squiggle-components" = components.build; +# }; + lint = pkgs.stdenv.mkDerivation { + name = "squiggle-website-lint"; + buildInputs = common.buildInputs ++ common.prettier; + src = ../packages/website; + buildPhase = "yarn lint"; + installPhase = "mkdir -p $out"; + }; +} diff --git a/nixos.sh b/nixos.sh index 91aa754f..8acff5f4 100755 --- a/nixos.sh +++ b/nixos.sh @@ -13,6 +13,6 @@ 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_moduels/bisect_ppx/bisect-ppx-report -theSo=$(find /nix/store/*$fhsShellName*/lib64 -name libstdc++.so.6 | grep $fhsShellName | head -n 1) +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/squiggle-lang/package.json b/packages/squiggle-lang/package.json index a94197f8..73db9a42 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -51,6 +51,7 @@ "@glennsl/rescript-jest": "^0.9.0", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/jest": "^27.5.0", + "@types/lodash": "^4.14.182", "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", "bisect_ppx": "^2.7.1", "chalk": "^5.0.1", diff --git a/packages/vscode-ext/.prettierignore b/packages/vscode-ext/.prettierignore new file mode 100644 index 00000000..ea5daaf6 --- /dev/null +++ b/packages/vscode-ext/.prettierignore @@ -0,0 +1,3 @@ +out +dist +**/*.d.ts diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 73ca9dd6..8fa973fa 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -143,4 +143,4 @@ "vscode-languageserver-textdocument": "^1.0.5", "@quri/squiggle-lang": "^0.2.11" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index acdc5bf0..5dbab7c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4696,7 +4696,7 @@ resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.11.1.tgz#34de04477dcf79e2ef6c8d23b41a3d81f9ebeaf5" integrity sha512-DUlIj2nk0YnJdlWgsFuVKcX27MLW0KbKmGVoUHmFr+74FYYNUDAaj9ZqTADvsbE8rfxuVmSFc7KczYn5Y09ozg== -"@types/lodash@^4.14.167", "@types/lodash@^4.14.175", "@types/lodash@^4.14.184": +"@types/lodash@^4.14.167", "@types/lodash@^4.14.175", "@types/lodash@^4.14.182", "@types/lodash@^4.14.184": version "4.14.184" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.184.tgz#23f96cd2a21a28e106dc24d825d4aa966de7a9fe" integrity sha512-RoZphVtHbxPZizt4IcILciSWiC6dcn+eZ8oX9IWEYfDMcocdd42f7NPI6fQj+6zI8y4E0L7gu2pcZKLGTRaV9Q== From 06cd81eee3e5f958db92f938434339da6e42b20b Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 29 Aug 2022 21:48:14 +0800 Subject: [PATCH 05/55] rm eslint --- .gitignore | 1 + .prettierignore | 2 -- packages/vscode-ext/.prettierignore | 3 +++ packages/vscode-ext/package.json | 9 +++------ yarn.lock | 6 +++--- 5 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 packages/vscode-ext/.prettierignore diff --git a/.gitignore b/.gitignore index 5b48f91c..0a2d50fe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ yarn-error.log **/.sync.ffs_db .direnv .log +result diff --git a/.prettierignore b/.prettierignore index 8090b3f3..2fbca9b9 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,13 +1,11 @@ .direnv *.bs.js *.gen.tsx -packages/*/dist packages/components/storybook-static node_modules packages/*/node_modules packages/website/.docusaurus packages/squiggle-lang/lib -packages/squiggle-lang/.nyc_output/ packages/squiggle-lang/coverage/ packages/squiggle-lang/.cache/ packages/website/build/ diff --git a/packages/vscode-ext/.prettierignore b/packages/vscode-ext/.prettierignore new file mode 100644 index 00000000..9b148f43 --- /dev/null +++ b/packages/vscode-ext/.prettierignore @@ -0,0 +1,3 @@ +out +dist +media/vendor diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 73ca9dd6..640b371c 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -121,17 +121,14 @@ "compile": "yarn run compile:vendor && yarn run compile:grammar && yarn run compile:tsc", "watch": "tsc -b -watch", "pretest": "yarn run compile && yarn run lint", - "lint": "eslint client/src server/src --ext ts", - "format": "eslint client/src server/src --ext ts --fix", + "lint": "prettier --check .", + "format": "prettier --write .", "package": "npx vsce package --yarn" }, "devDependencies": { "@types/glob": "^7.2.0", "@types/node": "18.x", "@types/vscode": "^1.70.0", - "@typescript-eslint/eslint-plugin": "^5.33.1", - "@typescript-eslint/parser": "^5.33.1", - "eslint": "^8.22.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", "typescript": "^4.7.4", @@ -143,4 +140,4 @@ "vscode-languageserver-textdocument": "^1.0.5", "@quri/squiggle-lang": "^0.2.11" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index acdc5bf0..b024c60d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5005,7 +5005,7 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.33.1", "@typescript-eslint/eslint-plugin@^5.5.0": +"@typescript-eslint/eslint-plugin@^5.5.0": version "5.33.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.1.tgz#c0a480d05211660221eda963cc844732fe9b1714" integrity sha512-S1iZIxrTvKkU3+m63YUOxYPKaP+yWDQrdhxTglVDVEVBf+aCSw85+BmJnyUaQQsk5TXFG/LpBu9fa+LrAQ91fQ== @@ -5027,7 +5027,7 @@ dependencies: "@typescript-eslint/utils" "5.29.0" -"@typescript-eslint/parser@^5.33.1", "@typescript-eslint/parser@^5.5.0": +"@typescript-eslint/parser@^5.5.0": version "5.33.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.1.tgz#e4b253105b4d2a4362cfaa4e184e2d226c440ff3" integrity sha512-IgLLtW7FOzoDlmaMoXdxG8HOCByTBXrB1V2ZQYSEV1ggMmJfAkMWTwUjjzagS6OkfpySyhKFkBw7A9jYmcHpZA== @@ -8965,7 +8965,7 @@ eslint-webpack-plugin@^3.1.1: normalize-path "^3.0.0" schema-utils "^3.1.1" -eslint@^8.22.0, eslint@^8.3.0: +eslint@^8.3.0: version "8.22.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.22.0.tgz#78fcb044196dfa7eef30a9d65944f6f980402c48" integrity sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA== From b6a261bfb0c184a35351c13b4395eb7b1a8dfc4e Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 29 Aug 2022 21:50:51 +0800 Subject: [PATCH 06/55] rm `.eslintrc.json` --- packages/vscode-ext/.eslintrc.json | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 packages/vscode-ext/.eslintrc.json diff --git a/packages/vscode-ext/.eslintrc.json b/packages/vscode-ext/.eslintrc.json deleted file mode 100644 index 5dfecab7..00000000 --- a/packages/vscode-ext/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, - "plugins": ["@typescript-eslint"], - "rules": { - "@typescript-eslint/naming-convention": "warn", - "@typescript-eslint/semi": "warn", - "curly": "warn", - "eqeqeq": "warn", - "no-throw-literal": "warn", - "semi": "off" - }, - "ignorePatterns": ["out", "dist", "**/*.d.ts"] -} From 1c0dc6af0683db641de50bd1f0b00cbcf3536d16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:23:47 +0000 Subject: [PATCH 07/55] :arrow_up: Bump @typescript-eslint/eslint-plugin from 5.33.1 to 5.35.1 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.33.1 to 5.35.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.35.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/vscode-ext/package.json | 2 +- yarn.lock | 72 +++++++++++++++++++++++--------- 2 files changed, 54 insertions(+), 20 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 73ca9dd6..800f37db 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -129,7 +129,7 @@ "@types/glob": "^7.2.0", "@types/node": "18.x", "@types/vscode": "^1.70.0", - "@typescript-eslint/eslint-plugin": "^5.33.1", + "@typescript-eslint/eslint-plugin": "^5.35.1", "@typescript-eslint/parser": "^5.33.1", "eslint": "^8.22.0", "glob": "^8.0.3", diff --git a/yarn.lock b/yarn.lock index acdc5bf0..9ce3edb5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5005,14 +5005,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.33.1", "@typescript-eslint/eslint-plugin@^5.5.0": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.1.tgz#c0a480d05211660221eda963cc844732fe9b1714" - integrity sha512-S1iZIxrTvKkU3+m63YUOxYPKaP+yWDQrdhxTglVDVEVBf+aCSw85+BmJnyUaQQsk5TXFG/LpBu9fa+LrAQ91fQ== +"@typescript-eslint/eslint-plugin@^5.35.1", "@typescript-eslint/eslint-plugin@^5.5.0": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.35.1.tgz#0d822bfea7469904dfc1bb8f13cabd362b967c93" + integrity sha512-RBZZXZlI4XCY4Wzgy64vB+0slT9+yAPQRjj/HSaRwUot33xbDjF1oN9BLwOLTewoOI0jothIltZRe9uJCHf8gg== dependencies: - "@typescript-eslint/scope-manager" "5.33.1" - "@typescript-eslint/type-utils" "5.33.1" - "@typescript-eslint/utils" "5.33.1" + "@typescript-eslint/scope-manager" "5.35.1" + "@typescript-eslint/type-utils" "5.35.1" + "@typescript-eslint/utils" "5.35.1" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -5053,12 +5053,20 @@ "@typescript-eslint/types" "5.33.1" "@typescript-eslint/visitor-keys" "5.33.1" -"@typescript-eslint/type-utils@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.33.1.tgz#1a14e94650a0ae39f6e3b77478baff002cec4367" - integrity sha512-X3pGsJsD8OiqhNa5fim41YtlnyiWMF/eKsEZGsHID2HcDqeSC5yr/uLOeph8rNF2/utwuI0IQoAK3fpoxcLl2g== +"@typescript-eslint/scope-manager@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.35.1.tgz#ccb69d54b7fd0f2d0226a11a75a8f311f525ff9e" + integrity sha512-kCYRSAzIW9ByEIzmzGHE50NGAvAP3wFTaZevgWva7GpquDyFPFcmvVkFJGWJJktg/hLwmys/FZwqM9EKr2u24Q== dependencies: - "@typescript-eslint/utils" "5.33.1" + "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/visitor-keys" "5.35.1" + +"@typescript-eslint/type-utils@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.35.1.tgz#d50903b56758c5c8fc3be52b3be40569f27f9c4a" + integrity sha512-8xT8ljvo43Mp7BiTn1vxLXkjpw8wS4oAc00hMSB4L1/jIiYbjjnc3Qp2GAUOG/v8zsNCd1qwcqfCQ0BuishHkw== + dependencies: + "@typescript-eslint/utils" "5.35.1" debug "^4.3.4" tsutils "^3.21.0" @@ -5072,6 +5080,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.1.tgz#3faef41793d527a519e19ab2747c12d6f3741ff7" integrity sha512-7K6MoQPQh6WVEkMrMW5QOA5FO+BOwzHSNd0j3+BlBwd6vtzfZceJ8xJ7Um2XDi/O3umS8/qDX6jdy2i7CijkwQ== +"@typescript-eslint/types@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.35.1.tgz#af355fe52a0cc88301e889bc4ada72f279b63d61" + integrity sha512-FDaujtsH07VHzG0gQ6NDkVVhi1+rhq0qEvzHdJAQjysN+LHDCKDKCBRlZFFE0ec0jKxiv0hN63SNfExy0KrbQQ== + "@typescript-eslint/typescript-estree@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.29.0.tgz#e83d19aa7fd2e74616aab2f25dfbe4de4f0b5577" @@ -5098,6 +5111,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.35.1.tgz#db878a39a0dbdc9bb133f11cdad451770bfba211" + integrity sha512-JUqE1+VRTGyoXlDWWjm6MdfpBYVq+hixytrv1oyjYIBEOZhBCwtpp5ZSvBt4wIA1MKWlnaC2UXl2XmYGC3BoQA== + dependencies: + "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/visitor-keys" "5.35.1" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + "@typescript-eslint/utils@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.29.0.tgz#775046effd5019667bd086bcf326acbe32cd0082" @@ -5110,15 +5136,15 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/utils@5.33.1", "@typescript-eslint/utils@^5.13.0": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.33.1.tgz#171725f924fe1fe82bb776522bb85bc034e88575" - integrity sha512-uphZjkMaZ4fE8CR4dU7BquOV6u0doeQAr8n6cQenl/poMaIyJtBu8eys5uk6u5HiDH01Mj5lzbJ5SfeDz7oqMQ== +"@typescript-eslint/utils@5.35.1", "@typescript-eslint/utils@^5.13.0": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.35.1.tgz#ae1399afbfd6aa7d0ed1b7d941e9758d950250eb" + integrity sha512-v6F8JNXgeBWI4pzZn36hT2HXXzoBBBJuOYvoQiaQaEEjdi5STzux3Yj8v7ODIpx36i/5s8TdzuQ54TPc5AITQQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.33.1" - "@typescript-eslint/types" "5.33.1" - "@typescript-eslint/typescript-estree" "5.33.1" + "@typescript-eslint/scope-manager" "5.35.1" + "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/typescript-estree" "5.35.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -5138,6 +5164,14 @@ "@typescript-eslint/types" "5.33.1" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.35.1.tgz#285e9e34aed7c876f16ff646a3984010035898e6" + integrity sha512-cEB1DvBVo1bxbW/S5axbGPE6b7FIMAbo3w+AGq6zNDA7+NYJOIkKj/sInfTv4edxd4PxJSgdN4t6/pbvgA+n5g== + dependencies: + "@typescript-eslint/types" "5.35.1" + eslint-visitor-keys "^3.3.0" + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" From 353ea7e13088b9e4b452e29b45a43d79d479f43b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:25:49 +0000 Subject: [PATCH 08/55] :arrow_up: Bump framer-motion from 7.2.0 to 7.2.1 Bumps [framer-motion](https://github.com/framer/motion) from 7.2.0 to 7.2.1. - [Release notes](https://github.com/framer/motion/releases) - [Changelog](https://github.com/framer/motion/blob/main/CHANGELOG.md) - [Commits](https://github.com/framer/motion/compare/v7.2.0...v7.2.1) --- updated-dependencies: - dependency-name: framer-motion dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 77e5e263..abf1c067 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -11,7 +11,7 @@ "@quri/squiggle-lang": "^0.3.0", "@react-hook/size": "^2.1.2", "clsx": "^1.2.1", - "framer-motion": "^7.2.0", + "framer-motion": "^7.2.1", "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", diff --git a/yarn.lock b/yarn.lock index acdc5bf0..275fd1de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9620,10 +9620,10 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -framer-motion@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.2.0.tgz#1abc8090e185eaac8a3b3729e2529154d2edcb17" - integrity sha512-D24ZHtbtdpiaByamNYiVXafVU6JfBxjrVlR1beyNupJL80haaDE23xS4dR0b/Qb64frtw/Mpdd9VYwSCv+UtSw== +framer-motion@^7.2.1: + version "7.2.1" + resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.2.1.tgz#0db5992ece791cb58357787ef9c29dd76281720d" + integrity sha512-bt2ZqqGpPsW6UojYUa5poWQJu3sDr4Dp3IZsdVBYdKUJ8p+9PxOk1fYRAT8lTGGmaC5HFoKrbDXQeKWGAKZz9g== dependencies: "@motionone/dom" "10.13.1" framesync "6.1.2" From a68c3c06158577a926e910a32063de1b5c2ed56b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:26:20 +0000 Subject: [PATCH 09/55] :arrow_up: Bump fast-check from 3.1.1 to 3.1.2 Bumps [fast-check](https://github.com/dubzzz/fast-check/tree/HEAD/packages/fast-check) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/dubzzz/fast-check/releases) - [Changelog](https://github.com/dubzzz/fast-check/blob/main/packages/fast-check/CHANGELOG.md) - [Commits](https://github.com/dubzzz/fast-check/commits/v3.1.2/packages/fast-check) --- updated-dependencies: - dependency-name: fast-check dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/squiggle-lang/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index a94197f8..0cf2324d 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -55,7 +55,7 @@ "bisect_ppx": "^2.7.1", "chalk": "^5.0.1", "codecov": "^3.8.3", - "fast-check": "^3.1.1", + "fast-check": "^3.1.2", "gentype": "^4.5.0", "jest": "^27.5.1", "moduleserve": "^0.9.1", diff --git a/yarn.lock b/yarn.lock index acdc5bf0..848ee006 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9242,10 +9242,10 @@ fast-check@^2.17.0: dependencies: pure-rand "^5.0.1" -fast-check@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-3.1.1.tgz#72c5ae7022a4e86504762e773adfb8a5b0b01252" - integrity sha512-3vtXinVyuUKCKFKYcwXhGE6NtGWkqF8Yh3rvMZNzmwz8EPrgoc/v4pDdLHyLnCyCI5MZpZZkDEwFyXyEONOxpA== +fast-check@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-3.1.2.tgz#1b09c3d856d425e06be9d39e9e23d1f6fa4a6d0e" + integrity sha512-OZRPFXhZHpIhtG46XtAMzVW1jtuR7Clw13wOcfw1v//tNnPCvVuLLlT1bEqywCQXNXR4qGT3tk7z0MUMSTit3Q== dependencies: pure-rand "^5.0.1" From 1ce657d634654fa6a14a0f2f5dc3651387080d4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:26:59 +0000 Subject: [PATCH 10/55] :arrow_up: Bump mathjs from 11.0.1 to 11.1.0 Bumps [mathjs](https://github.com/josdejong/mathjs) from 11.0.1 to 11.1.0. - [Release notes](https://github.com/josdejong/mathjs/releases) - [Changelog](https://github.com/josdejong/mathjs/blob/develop/HISTORY.md) - [Commits](https://github.com/josdejong/mathjs/compare/v11.0.1...v11.1.0) --- updated-dependencies: - dependency-name: mathjs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/squiggle-lang/package.json | 2 +- yarn.lock | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index a94197f8..8d905e80 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -44,7 +44,7 @@ "@stdlib/stats": "^0.0.13", "jstat": "^1.9.5", "lodash": "^4.17.21", - "mathjs": "^11.0.1", + "mathjs": "^11.1.0", "pdfast": "^0.2.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index acdc5bf0..0352d2f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8056,10 +8056,10 @@ decamelize@^1.1.2, decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -decimal.js@^10.2.1, decimal.js@^10.3.1: - version "10.3.1" - resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" - integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== +decimal.js@^10.2.1, decimal.js@^10.4.0: + version "10.4.0" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.0.tgz#97a7448873b01e92e5ff9117d89a7bca8e63e0fe" + integrity sha512-Nv6ENEzyPQ6AItkGwLE2PGKinZZ9g59vSh2BeH6NqPu0OTKZ5ruJsVqh/orbAnqXc9pBbgXAIrc2EyaCj8NpGg== decode-uri-component@^0.2.0: version "0.2.0" @@ -12416,20 +12416,20 @@ markdown-it@^8.3.1: mdurl "^1.0.1" uc.micro "^1.0.5" -mathjs@^11.0.1: - version "11.0.1" - resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-11.0.1.tgz#7fb5150ef8c427f8bcddba52a084a3d8bffda7ea" - integrity sha512-Kgm+GcTxwD68zupr7BPK0yrlWpTh2q8sMH6VcBcQe5+JCBqcwOrBxBF11WPah7hVv0NCLDnJnFTiXtik1Phasg== +mathjs@^11.0.1, mathjs@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-11.1.0.tgz#501fc1b8d66155442ce7762bf04469168d38587c" + integrity sha512-cbsEruLNoIlj5h5vOF+DUQVe4EsA/WNomSQDMnX2WafX9TLneBSCRMx2okgGnSLzLoMGWQ211KVzY55bEnQa8Q== dependencies: "@babel/runtime" "^7.18.9" complex.js "^2.1.1" - decimal.js "^10.3.1" + decimal.js "^10.4.0" escape-latex "^1.2.0" fraction.js "^4.2.0" javascript-natural-sort "^0.7.1" seedrandom "^3.0.5" tiny-emitter "^2.1.0" - typed-function "^3.0.0" + typed-function "^4.1.0" md5.js@^1.3.4: version "1.3.5" @@ -17493,10 +17493,10 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -typed-function@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/typed-function/-/typed-function-3.0.0.tgz#42f75ffdd7dd63bf5dcc950847138f2bb65f1ad3" - integrity sha512-mKJKkt2xYxJUuMD7jyfgUxfn5KCsCxkEKBVjep5yYellJJ5aEDO2QUAmIGdvcZmfQnIrplkzELIaG+5b1475qg== +typed-function@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/typed-function/-/typed-function-4.1.0.tgz#da4bdd8a6d19a89e22732f75e4a410860aaf9712" + integrity sha512-DGwUl6cioBW5gw2L+6SMupGwH/kZOqivy17E4nsh1JI9fKF87orMmlQx3KISQPmg3sfnOUGlwVkroosvgddrlg== typed-rest-client@1.2.0: version "1.2.0" From 92fb4c47c15f2837e1bbe98d7f30ef77e1d2f981 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:30:36 +0000 Subject: [PATCH 11/55] :arrow_up: Bump @floating-ui/react-dom-interactions from 0.9.2 to 0.9.3 Bumps [@floating-ui/react-dom-interactions](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/react-dom-interactions) from 0.9.2 to 0.9.3. - [Release notes](https://github.com/floating-ui/floating-ui/releases) - [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/react-dom-interactions@0.9.3/packages/react-dom-interactions) --- updated-dependencies: - dependency-name: "@floating-ui/react-dom-interactions" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 77e5e263..276e995a 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -4,7 +4,7 @@ "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^1.0.0", - "@floating-ui/react-dom-interactions": "^0.9.2", + "@floating-ui/react-dom-interactions": "^0.9.3", "@headlessui/react": "^1.6.6", "@heroicons/react": "^1.0.6", "@hookform/resolvers": "^2.9.7", diff --git a/yarn.lock b/yarn.lock index acdc5bf0..4ff47489 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2200,10 +2200,10 @@ dependencies: "@floating-ui/core" "^1.0.0" -"@floating-ui/react-dom-interactions@^0.9.2": - version "0.9.2" - resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.9.2.tgz#9a364cc44ecbc242b5218dff0e0d071de115e13a" - integrity sha512-1I0urs4jlGuo4FRukvjtMmdUwxqvgwtTlESEPVwEvFGHXVh1PKkKaPZJ0Dcp9B8DQt4ewQEbwJxsoker2pDYTQ== +"@floating-ui/react-dom-interactions@^0.9.3": + version "0.9.3" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.9.3.tgz#4d4d81664066ac36980e50691aa90b1d40667949" + integrity sha512-oHwFLxySRtmhgwg7ZdWswvDDi+ld4mEtxu6ngOd7mRC5L1Rk6adjSfOBOHDxea+ItAWmds8m6A725sn1HQtUyQ== dependencies: "@floating-ui/react-dom" "^1.0.0" aria-hidden "^1.1.3" From 790cffec8a680427e780cf1615db03884d652358 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:31:20 +0000 Subject: [PATCH 12/55] :arrow_up: Bump web-vitals from 2.1.4 to 3.0.0 Bumps [web-vitals](https://github.com/GoogleChrome/web-vitals) from 2.1.4 to 3.0.0. - [Release notes](https://github.com/GoogleChrome/web-vitals/releases) - [Changelog](https://github.com/GoogleChrome/web-vitals/blob/main/CHANGELOG.md) - [Commits](https://github.com/GoogleChrome/web-vitals/compare/v2.1.4...v3.0.0) --- updated-dependencies: - dependency-name: web-vitals dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 77e5e263..4ab48e92 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -55,7 +55,7 @@ "ts-loader": "^9.3.0", "tsconfig-paths-webpack-plugin": "^4.0.0", "typescript": "^4.7.4", - "web-vitals": "^2.1.4", + "web-vitals": "^3.0.0", "webpack": "^5.74.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.10.0" diff --git a/yarn.lock b/yarn.lock index acdc5bf0..ee47fa06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18495,10 +18495,10 @@ web-namespaces@^1.0.0: resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== -web-vitals@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-2.1.4.tgz#76563175a475a5e835264d373704f9dde718290c" - integrity sha512-sVWcwhU5mX6crfI5Vd2dC4qchyTqxV8URinzt25XqVh+bHEPGH4C3NPrNionCP7Obx59wrYEbNlw4Z8sjALzZg== +web-vitals@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-3.0.0.tgz#db8a32fd62738a439343309336720ee5685ac71e" + integrity sha512-3Gh6rH5aetFYqfkl9V59KCvjj9vp9U2Tkaep9MO+xpAVg+JULmQfi5zEkcPLkE6iU8pNYVwdjHvIU8RFAchYyQ== webidl-conversions@^3.0.0: version "3.0.1" From 28067ffcbd722dc502ecbd364ddc968c7fdca513 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:35:37 +0000 Subject: [PATCH 13/55] :arrow_up: Bump @glennsl/rescript-jest from 0.9.1 to 0.9.2 Bumps [@glennsl/rescript-jest](https://github.com/glennsl/rescript-jest) from 0.9.1 to 0.9.2. - [Release notes](https://github.com/glennsl/rescript-jest/releases) - [Commits](https://github.com/glennsl/rescript-jest/compare/v0.9.1...v0.9.2) --- updated-dependencies: - dependency-name: "@glennsl/rescript-jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/squiggle-lang/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index a94197f8..f5cfceca 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -48,7 +48,7 @@ "pdfast": "^0.2.0" }, "devDependencies": { - "@glennsl/rescript-jest": "^0.9.0", + "@glennsl/rescript-jest": "^0.9.2", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/jest": "^27.5.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", diff --git a/yarn.lock b/yarn.lock index acdc5bf0..32365f26 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2220,10 +2220,10 @@ resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== -"@glennsl/rescript-jest@^0.9.0": - version "0.9.1" - resolved "https://registry.yarnpkg.com/@glennsl/rescript-jest/-/rescript-jest-0.9.1.tgz#a85a6f0e4c3b79010b5a917c3652aa70d374e4d1" - integrity sha512-FfvMOlKPXiU49wxn1ZN8OD9f6midoyNMMAHzljMg/1kaNtOQVMI/7UwdfsWEBhItHXXEso2wn/Mpa15X5gQusw== +"@glennsl/rescript-jest@^0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@glennsl/rescript-jest/-/rescript-jest-0.9.2.tgz#d896d3b1bec5caa93ec26a49d2794a5883ab963f" + integrity sha512-Qy7O5/vYWgfVyXveFAcOy0Wa0tZ1hUVdSmZJgmblnHvZYyeVJOCIxdSk8vvjBF/gujlvGBFcSeHMWs6Bx22luQ== dependencies: "@ryyppy/rescript-promise" "^2.1.0" jest "^27.3.1" From ea053d4869a37a1226ee32bd859cfe9de44fb4e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:39:50 +0000 Subject: [PATCH 14/55] :arrow_up: Bump @types/node from 18.7.9 to 18.7.13 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.7.9 to 18.7.13. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 77e5e263..4fc7021e 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -39,7 +39,7 @@ "@testing-library/user-event": "^14.4.3", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.184", - "@types/node": "^18.7.9", + "@types/node": "^18.7.13", "@types/react": "^18.0.9", "@types/styled-components": "^5.1.26", "@types/webpack": "^5.28.0", diff --git a/yarn.lock b/yarn.lock index 9ce3edb5..511ed5f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4726,10 +4726,10 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@18.x", "@types/node@^18.7.9": - version "18.7.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.9.tgz#180bfc495c91dc62573967edf047e15dbdce1491" - integrity sha512-0N5Y1XAdcl865nDdjbO0m3T6FdmQ4ijE89/urOHLREyTXbpMWbSafx9y7XIsgWGtwUP2iYTinLyyW3FatAxBLQ== +"@types/node@*", "@types/node@18.x", "@types/node@^18.7.13": + version "18.7.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.13.tgz#23e6c5168333480d454243378b69e861ab5c011a" + integrity sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw== "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0": version "16.11.41" From 745c8f9aeb36b032a4a670370dae232b77db0520 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:40:13 +0000 Subject: [PATCH 15/55] :arrow_up: Bump @typescript-eslint/parser from 5.33.1 to 5.35.1 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.33.1 to 5.35.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.35.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/vscode-ext/package.json | 2 +- yarn.lock | 48 +++++--------------------------- 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 800f37db..cd3b7500 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -130,7 +130,7 @@ "@types/node": "18.x", "@types/vscode": "^1.70.0", "@typescript-eslint/eslint-plugin": "^5.35.1", - "@typescript-eslint/parser": "^5.33.1", + "@typescript-eslint/parser": "^5.35.1", "eslint": "^8.22.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index dbca5a18..1e5cba78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5027,14 +5027,14 @@ dependencies: "@typescript-eslint/utils" "5.29.0" -"@typescript-eslint/parser@^5.33.1", "@typescript-eslint/parser@^5.5.0": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.1.tgz#e4b253105b4d2a4362cfaa4e184e2d226c440ff3" - integrity sha512-IgLLtW7FOzoDlmaMoXdxG8HOCByTBXrB1V2ZQYSEV1ggMmJfAkMWTwUjjzagS6OkfpySyhKFkBw7A9jYmcHpZA== +"@typescript-eslint/parser@^5.35.1", "@typescript-eslint/parser@^5.5.0": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.35.1.tgz#bf2ee2ebeaa0a0567213748243fb4eec2857f04f" + integrity sha512-XL2TBTSrh3yWAsMYpKseBYTVpvudNf69rPOWXWVBI08My2JVT5jR66eTt4IgQFHA/giiKJW5dUD4x/ZviCKyGg== dependencies: - "@typescript-eslint/scope-manager" "5.33.1" - "@typescript-eslint/types" "5.33.1" - "@typescript-eslint/typescript-estree" "5.33.1" + "@typescript-eslint/scope-manager" "5.35.1" + "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/typescript-estree" "5.35.1" debug "^4.3.4" "@typescript-eslint/scope-manager@5.29.0": @@ -5045,14 +5045,6 @@ "@typescript-eslint/types" "5.29.0" "@typescript-eslint/visitor-keys" "5.29.0" -"@typescript-eslint/scope-manager@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.1.tgz#8d31553e1b874210018ca069b3d192c6d23bc493" - integrity sha512-8ibcZSqy4c5m69QpzJn8XQq9NnqAToC8OdH/W6IXPXv83vRyEDPYLdjAlUx8h/rbusq6MkW4YdQzURGOqsn3CA== - dependencies: - "@typescript-eslint/types" "5.33.1" - "@typescript-eslint/visitor-keys" "5.33.1" - "@typescript-eslint/scope-manager@5.35.1": version "5.35.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.35.1.tgz#ccb69d54b7fd0f2d0226a11a75a8f311f525ff9e" @@ -5075,11 +5067,6 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== -"@typescript-eslint/types@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.1.tgz#3faef41793d527a519e19ab2747c12d6f3741ff7" - integrity sha512-7K6MoQPQh6WVEkMrMW5QOA5FO+BOwzHSNd0j3+BlBwd6vtzfZceJ8xJ7Um2XDi/O3umS8/qDX6jdy2i7CijkwQ== - "@typescript-eslint/types@5.35.1": version "5.35.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.35.1.tgz#af355fe52a0cc88301e889bc4ada72f279b63d61" @@ -5098,19 +5085,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.1.tgz#a573bd360790afdcba80844e962d8b2031984f34" - integrity sha512-JOAzJ4pJ+tHzA2pgsWQi4804XisPHOtbvwUyqsuuq8+y5B5GMZs7lI1xDWs6V2d7gE/Ez5bTGojSK12+IIPtXA== - dependencies: - "@typescript-eslint/types" "5.33.1" - "@typescript-eslint/visitor-keys" "5.33.1" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.35.1": version "5.35.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.35.1.tgz#db878a39a0dbdc9bb133f11cdad451770bfba211" @@ -5156,14 +5130,6 @@ "@typescript-eslint/types" "5.29.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@5.33.1": - version "5.33.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.1.tgz#0155c7571c8cd08956580b880aea327d5c34a18b" - integrity sha512-nwIxOK8Z2MPWltLKMLOEZwmfBZReqUdbEoHQXeCpa+sRVARe5twpJGHCB4dk9903Yaf0nMAlGbQfaAH92F60eg== - dependencies: - "@typescript-eslint/types" "5.33.1" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.35.1": version "5.35.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.35.1.tgz#285e9e34aed7c876f16ff646a3984010035898e6" From 48409c7f821f1097efb5ea4a4fa954fbe2c95d18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 14:59:45 +0000 Subject: [PATCH 16/55] :arrow_up: Bump eslint from 8.22.0 to 8.23.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.22.0 to 8.23.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.22.0...v8.23.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/vscode-ext/package.json | 2 +- yarn.lock | 42 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index cd3b7500..023c02fd 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -131,7 +131,7 @@ "@types/vscode": "^1.70.0", "@typescript-eslint/eslint-plugin": "^5.35.1", "@typescript-eslint/parser": "^5.35.1", - "eslint": "^8.22.0", + "eslint": "^8.23.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", "typescript": "^4.7.4", diff --git a/yarn.lock b/yarn.lock index baf6297c..8d45b5ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2173,14 +2173,14 @@ resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.4.tgz#19bf0f5af19149111c40d98bb0cf82119f5d9eeb" integrity sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw== -"@eslint/eslintrc@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.0.tgz#29f92c30bb3e771e4a2048c95fa6855392dfac4f" - integrity sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw== +"@eslint/eslintrc@^1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.1.tgz#de0807bfeffc37b964a7d0400e0c348ce5a2543d" + integrity sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.3.2" + espree "^9.4.0" globals "^13.15.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -2269,6 +2269,11 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d" integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA== +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" @@ -8965,14 +8970,15 @@ eslint-webpack-plugin@^3.1.1: normalize-path "^3.0.0" schema-utils "^3.1.1" -eslint@^8.22.0, eslint@^8.3.0: - version "8.22.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.22.0.tgz#78fcb044196dfa7eef30a9d65944f6f980402c48" - integrity sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA== +eslint@^8.23.0, eslint@^8.3.0: + version "8.23.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.0.tgz#a184918d288820179c6041bb3ddcc99ce6eea040" + integrity sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA== dependencies: - "@eslint/eslintrc" "^1.3.0" + "@eslint/eslintrc" "^1.3.1" "@humanwhocodes/config-array" "^0.10.4" "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" + "@humanwhocodes/module-importer" "^1.0.1" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -8982,7 +8988,7 @@ eslint@^8.22.0, eslint@^8.3.0: eslint-scope "^7.1.1" eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" - espree "^9.3.3" + espree "^9.4.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -9008,12 +9014,11 @@ eslint@^8.22.0, eslint@^8.3.0: strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" - v8-compile-cache "^2.0.3" -espree@^9.3.2, espree@^9.3.3: - version "9.3.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.3.tgz#2dd37c4162bb05f433ad3c1a52ddf8a49dc08e9d" - integrity sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng== +espree@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a" + integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" @@ -17919,11 +17924,6 @@ v8-compile-cache-lib@^3.0.1: resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - v8-to-istanbul@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" From 47ccba4c46342df06fbc43c8eca4a65091ef31e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 15:16:16 +0000 Subject: [PATCH 17/55] :arrow_up: Bump typescript from 4.7.4 to 4.8.2 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.7.4 to 4.8.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.7.4...v4.8.2) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- packages/squiggle-lang/package.json | 2 +- packages/vscode-ext/package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 735b3d16..dc757468 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -54,7 +54,7 @@ "tailwindcss": "^3.1.8", "ts-loader": "^9.3.0", "tsconfig-paths-webpack-plugin": "^4.0.0", - "typescript": "^4.7.4", + "typescript": "^4.8.2", "web-vitals": "^3.0.0", "webpack": "^5.74.0", "webpack-cli": "^4.10.0", diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 6229738e..4d8c9224 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -68,7 +68,7 @@ "ts-jest": "^27.1.4", "ts-loader": "^9.3.0", "ts-node": "^10.9.1", - "typescript": "^4.7.4", + "typescript": "^4.8.2", "webpack": "^5.74.0", "webpack-cli": "^4.10.0" }, diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 023c02fd..e223040c 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -134,7 +134,7 @@ "eslint": "^8.23.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", - "typescript": "^4.7.4", + "typescript": "^4.8.2", "vsce-yarn-patch": "^1.66.2" }, "dependencies": { diff --git a/yarn.lock b/yarn.lock index a09e1999..ddbc73d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17523,10 +17523,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript@^4.7.4: - version "4.7.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== +typescript@^4.8.2: + version "4.8.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790" + integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw== ua-parser-js@^0.7.30: version "0.7.31" From a83b46af25bb0dbca4ea33dcc1e978bcee27e738 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 08:22:55 +0800 Subject: [PATCH 18/55] regenerating lockfile isn't helping --- .prettierignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.prettierignore b/.prettierignore index 2fbca9b9..7bbb5874 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,3 +11,5 @@ packages/squiggle-lang/.cache/ packages/website/build/ packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.js packages/vscode-ext/media/vendor/ +packages/squiggle-lang/.nyc_output/ +packages/*/dist From d137d6a2b40d00ef2ce47d6ade5e0c94d530d46d Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 08:28:45 +0800 Subject: [PATCH 19/55] manually fix problem with yarn.lock? --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 2b8b4393..a658b352 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18807,7 +18807,7 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@*, yallist@^4.0.0: +yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== From 228277d0e809c6d9247adf0085aeff3c9e0128f6 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 08:34:50 +0800 Subject: [PATCH 20/55] use prettier action instead of yarn --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8150d00a..6020a508 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,10 +182,11 @@ jobs: working-directory: packages/vscode-ext steps: - uses: actions/checkout@v3 - - name: Install dependencies from monorepo level - run: cd ../../ && yarn - - name: Lint the VSCode Extension source code - run: yarn lint + - name: Check javascript, typescript, and markdown lint + uses: creyD/prettier_action@v4.2 + with: + dry: true + prettier_options: --check packages/vscode-ext vscode-ext-build: name: VS Code extension build From 4368bb53fa3e72e8ab2235b543ffb0284399934b Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 29 Aug 2022 17:52:59 -0700 Subject: [PATCH 21/55] Changed samples and xyPointLength from 10K to 1K See: https://eaforecasting.slack.com/archives/C030T49UHSS/p1661817834362619 --- packages/squiggle-lang/src/js/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/src/js/index.ts b/packages/squiggle-lang/src/js/index.ts index acee005c..e4bfa49c 100644 --- a/packages/squiggle-lang/src/js/index.ts +++ b/packages/squiggle-lang/src/js/index.ts @@ -40,8 +40,8 @@ export type { result, shape, environment, lambdaValue, squiggleExpression }; export { parse } from "./parse"; export let defaultSamplingInputs: environment = { - sampleCount: 10000, - xyPointLength: 10000, + sampleCount: 1000, + xyPointLength: 1000, }; export function run( From 4341d62893b98df463a0a12b2ef03d08284dbfdc Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 08:55:45 +0800 Subject: [PATCH 22/55] fixed new bug --- packages/components/src/components/ui/Checkbox.tsx | 4 ++-- packages/components/src/components/ui/InputItem.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/components/src/components/ui/Checkbox.tsx b/packages/components/src/components/ui/Checkbox.tsx index 36ab68d9..55c616ec 100644 --- a/packages/components/src/components/ui/Checkbox.tsx +++ b/packages/components/src/components/ui/Checkbox.tsx @@ -1,8 +1,8 @@ import clsx from "clsx"; import React from "react"; -import { Path, UseFormRegister } from "react-hook-form"; +import { Path, UseFormRegister, FieldValues } from "react-hook-form"; -export function Checkbox({ +export function Checkbox({ name, label, register, diff --git a/packages/components/src/components/ui/InputItem.tsx b/packages/components/src/components/ui/InputItem.tsx index 5d0ca613..f2167538 100644 --- a/packages/components/src/components/ui/InputItem.tsx +++ b/packages/components/src/components/ui/InputItem.tsx @@ -1,7 +1,7 @@ import React from "react"; -import { Path, UseFormRegister } from "react-hook-form"; +import { Path, UseFormRegister, FieldValues } from "react-hook-form"; -export function InputItem({ +export function InputItem({ name, label, type, From 39566696f6e0b771e71d345d54151c7813d77d9d Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 09:12:21 +0800 Subject: [PATCH 23/55] manually fix `yarn.lock` for prettier action --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 0699908e..1762691d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18807,7 +18807,7 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@*, yallist@^4.0.0: +yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== From 73e1f0b206f6ecb6e1af6b63d142b7a140313eb2 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 09:34:35 +0800 Subject: [PATCH 24/55] rm spurious override of `nixpkgs` from `flake-utils` input; cleanup `ci-cachix.yml` --- .github/workflows/ci-cachix.yml | 9 +++++---- flake.nix | 7 ++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-cachix.yml b/.github/workflows/ci-cachix.yml index 39051677..817a7251 100644 --- a/.github/workflows/ci-cachix.yml +++ b/.github/workflows/ci-cachix.yml @@ -1,4 +1,4 @@ -name: Builds, lints, tests in nix +name: Nix build on: [push, pull_request] @@ -12,12 +12,13 @@ jobs: - name: Install nix uses: cachix/install-nix-action@v17 with: - nix_path: nixpkgs=channel:nixos-unstable + nix_path: nixpkgs=channel:nixos-22.05 - name: Use cachix uses: cachix/cachix-action@v10 with: name: quantified-uncertainty authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Check that lang lints run: nix build .#lang-lint - name: Check that components lints @@ -27,10 +28,10 @@ jobs: - name: Check that vscode extension lints run: nix build .#vscode-lint - - name: Check that lang bundles - run: nix build .#lang-bundle - name: Check all lang tests run: nix build .#lang-test + - name: Check that lang bundles + run: nix build .#lang-bundle - name: Check that components builds run: nix build .#components - name: Check that components bundles diff --git a/flake.nix b/flake.nix index fa8efa59..ea9dee1c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Squiggle CI"; + description = "Squiggle packages"; inputs = { nixpkgs.url = "nixpkgs/nixos-22.05"; @@ -7,10 +7,7 @@ url = github:quinn-dougherty/genType; inputs.nixpkgs.follows = "nixpkgs"; }; - flake-utils = { - url = github:numtide/flake-utils; - inputs.nixpkgs.follows = "nixpkgs"; - }; + flake-utils.url = github:numtide/flake-utils; }; outputs = { self, nixpkgs, gentype, flake-utils }: From 05a7d5c09aa70c124f8df294fc98a2155bc36c62 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 11:19:54 +0800 Subject: [PATCH 25/55] rm need for `@types/lodash` in `lang/package.json` --- nix/squiggle-lang.nix | 7 ++++++- packages/squiggle-lang/package.json | 1 - yarn.lock | 12 ++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/nix/squiggle-lang.nix b/nix/squiggle-lang.nix index e7ad21ee..8722f908 100644 --- a/nix/squiggle-lang.nix +++ b/nix/squiggle-lang.nix @@ -2,10 +2,15 @@ rec { common = commonFn pkgs; + langPackageJson = let + raw = pkgs.lib.importJSON ../packages/squiggle-lang/package.json; + modified = pkgs.lib.recursiveUpdate raw { devDependencies."@types/lodash" = "^4.14.182"; }; + packageJsonString = builtins.toJSON modified; + in pkgs.writeText "packages/squiggle-lang/patched-package.json"; yarn-source = pkgs.mkYarnPackage { name = "squiggle-lang_yarnsource"; src = ../packages/squiggle-lang; - packageJSON = ../packages/squiggle-lang/package.json; + packageJSON = langPackageJson; yarnLock = ../yarn.lock; pkgConfig = { rescript = { diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 224c87c4..4d8c9224 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -51,7 +51,6 @@ "@glennsl/rescript-jest": "^0.9.2", "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/jest": "^27.5.0", - "@types/lodash": "^4.14.182", "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", "bisect_ppx": "^2.7.1", "chalk": "^5.0.1", diff --git a/yarn.lock b/yarn.lock index e3dca048..565cf57b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4401,7 +4401,7 @@ resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.11.1.tgz#34de04477dcf79e2ef6c8d23b41a3d81f9ebeaf5" integrity sha512-DUlIj2nk0YnJdlWgsFuVKcX27MLW0KbKmGVoUHmFr+74FYYNUDAaj9ZqTADvsbE8rfxuVmSFc7KczYn5Y09ozg== -"@types/lodash@^4.14.167", "@types/lodash@^4.14.175", "@types/lodash@^4.14.182", "@types/lodash@^4.14.184": +"@types/lodash@^4.14.167", "@types/lodash@^4.14.175", "@types/lodash@^4.14.184": version "4.14.184" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.184.tgz#23f96cd2a21a28e106dc24d825d4aa966de7a9fe" integrity sha512-RoZphVtHbxPZizt4IcILciSWiC6dcn+eZ8oX9IWEYfDMcocdd42f7NPI6fQj+6zI8y4E0L7gu2pcZKLGTRaV9Q== @@ -18807,16 +18807,16 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - yallist@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" From 21eeb63cf2fd7799324805b5b2049876e5ed29d0 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 11:23:15 +0800 Subject: [PATCH 26/55] fix call to `pkgs.writeText` --- nix/squiggle-lang.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/squiggle-lang.nix b/nix/squiggle-lang.nix index 8722f908..b811fe2b 100644 --- a/nix/squiggle-lang.nix +++ b/nix/squiggle-lang.nix @@ -6,7 +6,7 @@ rec { raw = pkgs.lib.importJSON ../packages/squiggle-lang/package.json; modified = pkgs.lib.recursiveUpdate raw { devDependencies."@types/lodash" = "^4.14.182"; }; packageJsonString = builtins.toJSON modified; - in pkgs.writeText "packages/squiggle-lang/patched-package.json"; + in pkgs.writeText "packages/squiggle-lang/patched-package.json" packageJsonString; yarn-source = pkgs.mkYarnPackage { name = "squiggle-lang_yarnsource"; src = ../packages/squiggle-lang; From 905b5fc569c068607fde2b9e86cd89f8c0882d35 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 11:23:33 +0800 Subject: [PATCH 27/55] `nixfmt` compels me --- flake.nix | 11 ++++------- nix/squiggle-lang.nix | 10 +++++++--- nix/squiggle-vscode.nix | 3 ++- nix/squiggle-website.nix | 36 ++++++++++++++++++------------------ 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/flake.nix b/flake.nix index ea9dee1c..0c6724c3 100644 --- a/flake.nix +++ b/flake.nix @@ -4,10 +4,10 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-22.05"; gentype = { - url = github:quinn-dougherty/genType; + url = "github:quinn-dougherty/genType"; inputs.nixpkgs.follows = "nixpkgs"; }; - flake-utils.url = github:numtide/flake-utils; + flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, gentype, flake-utils }: @@ -33,9 +33,7 @@ inherit pkgs commonFn gentypeOutputFn; }; componentsFn = { pkgs, ... }: - import ./nix/squiggle-components.nix { - inherit pkgs commonFn langFn; - }; + import ./nix/squiggle-components.nix { inherit pkgs commonFn langFn; }; websiteFn = { pkgs, ... }: import ./nix/squiggle-website.nix { inherit pkgs commonFn langFn componentsFn; @@ -77,8 +75,7 @@ # developing devShells = flake-utils.lib.flattenTree { - default = - (import ./nix/shell.nix { inherit pkgs; }).shell; + default = (import ./nix/shell.nix { inherit pkgs; }).shell; }; }; in flake-utils.lib.eachDefaultSystem (system: diff --git a/nix/squiggle-lang.nix b/nix/squiggle-lang.nix index b811fe2b..757f76e7 100644 --- a/nix/squiggle-lang.nix +++ b/nix/squiggle-lang.nix @@ -4,9 +4,12 @@ rec { common = commonFn pkgs; langPackageJson = let raw = pkgs.lib.importJSON ../packages/squiggle-lang/package.json; - modified = pkgs.lib.recursiveUpdate raw { devDependencies."@types/lodash" = "^4.14.182"; }; + modified = pkgs.lib.recursiveUpdate raw { + devDependencies."@types/lodash" = "^4.14.182"; + }; packageJsonString = builtins.toJSON modified; - in pkgs.writeText "packages/squiggle-lang/patched-package.json" packageJsonString; + in pkgs.writeText "packages/squiggle-lang/patched-package.json" + packageJsonString; yarn-source = pkgs.mkYarnPackage { name = "squiggle-lang_yarnsource"; src = ../packages/squiggle-lang; @@ -14,7 +17,8 @@ rec { yarnLock = ../yarn.lock; pkgConfig = { rescript = { - buildInputs = common.which ++ (if pkgs.system != "i686-linux" then [ pkgs.gcc_multi ] else []); + buildInputs = common.which + ++ (if pkgs.system != "i686-linux" then [ pkgs.gcc_multi ] else [ ]); postInstall = '' echo "PATCHELF'ING RESCRIPT EXECUTABLES (INCL NINJA)" # Patching interpreter for linux/*.exe's diff --git a/nix/squiggle-vscode.nix b/nix/squiggle-vscode.nix index 433d6caa..2e725261 100644 --- a/nix/squiggle-vscode.nix +++ b/nix/squiggle-vscode.nix @@ -16,7 +16,8 @@ rec { lint = pkgs.stdenv.mkDerivation { name = "squiggle-vscode-lint"; buildInputs = common.buildInputs ++ common.prettier; - src = ../packages/vscode-ext; # yarn-source + "/libexec/vscode-squiggle/deps/vscode-squiggle"; + src = + ../packages/vscode-ext; # yarn-source + "/libexec/vscode-squiggle/deps/vscode-squiggle"; buildPhase = "prettier --check ."; installPhase = "mkdir -p $out"; }; diff --git a/nix/squiggle-website.nix b/nix/squiggle-website.nix index a3ee1856..41c9d28d 100644 --- a/nix/squiggle-website.nix +++ b/nix/squiggle-website.nix @@ -2,24 +2,24 @@ rec { common = commonFn pkgs; -# lang = langFn pkgs; -# components = componentsFn pkgs; -# websitePackageJson = let -# raw = pkgs.lib.importJSON ../packages/website/package.json; -# modified = pkgs.lib.recursiveUpdate raw { -# dependencies.postcss-import = "^14.1.0"; -# dependencies.tailwindcss = "^3.1.8"; -# }; -# packageJsonString = builtins.toJSON modified; -# in pkgs.writeText "packages/website/patched-package.json" packageJsonString; -# yarn-source = pkgs.mkYarnPackage { -# name = "squiggle-website_yarnsource"; -# src = ../packages/website; -# packageJSON = websitePackageJson; -# yarnLock = ../yarn.lock; -# packageResolutions."@quri/squiggle-lang" = lang.build; -# packageResolutions."@quri/squiggle-components" = components.build; -# }; + # lang = langFn pkgs; + # components = componentsFn pkgs; + # websitePackageJson = let + # raw = pkgs.lib.importJSON ../packages/website/package.json; + # modified = pkgs.lib.recursiveUpdate raw { + # dependencies.postcss-import = "^14.1.0"; + # dependencies.tailwindcss = "^3.1.8"; + # }; + # packageJsonString = builtins.toJSON modified; + # in pkgs.writeText "packages/website/patched-package.json" packageJsonString; + # yarn-source = pkgs.mkYarnPackage { + # name = "squiggle-website_yarnsource"; + # src = ../packages/website; + # packageJSON = websitePackageJson; + # yarnLock = ../yarn.lock; + # packageResolutions."@quri/squiggle-lang" = lang.build; + # packageResolutions."@quri/squiggle-components" = components.build; + # }; lint = pkgs.stdenv.mkDerivation { name = "squiggle-website-lint"; buildInputs = common.buildInputs ++ common.prettier; From b935621d2a290632b95efaf5f8c0a4732aa7d02c Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 11:28:52 +0800 Subject: [PATCH 28/55] changed `@types/lodash` version --- nix/squiggle-lang.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/squiggle-lang.nix b/nix/squiggle-lang.nix index 757f76e7..4d855d7f 100644 --- a/nix/squiggle-lang.nix +++ b/nix/squiggle-lang.nix @@ -5,7 +5,7 @@ rec { langPackageJson = let raw = pkgs.lib.importJSON ../packages/squiggle-lang/package.json; modified = pkgs.lib.recursiveUpdate raw { - devDependencies."@types/lodash" = "^4.14.182"; + devDependencies."@types/lodash" = "^4.14.167"; }; packageJsonString = builtins.toJSON modified; in pkgs.writeText "packages/squiggle-lang/patched-package.json" From b89e4f1bd80cfb3afd8332596b735d4b85d4ffd6 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 11:36:32 +0800 Subject: [PATCH 29/55] edited trigger conditions in two ci `.yml` files --- .github/workflows/ci-cachix.yml | 66 +++++++++++++++++++-------------- .github/workflows/ci.yml | 1 + nix/README.md | 2 +- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci-cachix.yml b/.github/workflows/ci-cachix.yml index 817a7251..f197e7c4 100644 --- a/.github/workflows/ci-cachix.yml +++ b/.github/workflows/ci-cachix.yml @@ -1,38 +1,48 @@ name: Nix build -on: [push, pull_request] +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + - reducer-dev + - epic-reducer-project jobs: flake: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Install nix - uses: cachix/install-nix-action@v17 - with: - nix_path: nixpkgs=channel:nixos-22.05 - - name: Use cachix - uses: cachix/cachix-action@v10 - with: - name: quantified-uncertainty - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Checkout code + uses: actions/checkout@v3 + - name: Install nix + uses: cachix/install-nix-action@v17 + with: + nix_path: nixpkgs=channel:nixos-22.05 + - name: Use cachix + uses: cachix/cachix-action@v10 + with: + name: quantified-uncertainty + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - - name: Check that lang lints - run: nix build .#lang-lint - - name: Check that components lints - run: nix build .#components-lint - - name: Check that website lints - run: nix build .#docusaurus-lint - - name: Check that vscode extension lints - run: nix build .#vscode-lint + - name: Check that lang lints + run: nix build .#lang-lint + - name: Check that components lints + run: nix build .#components-lint + - name: Check that website lints + run: nix build .#docusaurus-lint + - name: Check that vscode extension lints + run: nix build .#vscode-lint - - name: Check all lang tests - run: nix build .#lang-test - - name: Check that lang bundles - run: nix build .#lang-bundle - - name: Check that components builds - run: nix build .#components - - name: Check that components bundles - run: nix build .#components-bundle + - name: Check all lang tests + run: nix build .#lang-test + - name: Check that lang bundles + run: nix build .#lang-bundle + - name: Check that components builds + run: nix build .#components + - name: Check that components bundles + run: nix build .#components-bundle diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6020a508..0a649ec7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: - master - develop - reducer-dev + - epic-reducer-project jobs: pre_check: diff --git a/nix/README.md b/nix/README.md index cadf6b82..6ad6a456 100644 --- a/nix/README.md +++ b/nix/README.md @@ -1 +1 @@ -Visit `quantified-uncertainty.cachix.org` for information about how to add our binary cache to your local dev environment. +Visit `quantified-uncertainty.cachix.org` for information about how to add our binary cache to your local dev environment. From 842157ee1b6644dda474efeff5537d1e45c485fe Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 13:18:35 +0800 Subject: [PATCH 30/55] added `devShell` build to `ci-cachix.yml` --- .github/workflows/ci-cachix.yml | 19 ++++++++++++++++++- .prettierignore | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cachix.yml b/.github/workflows/ci-cachix.yml index f197e7c4..ca00408b 100644 --- a/.github/workflows/ci-cachix.yml +++ b/.github/workflows/ci-cachix.yml @@ -13,7 +13,7 @@ on: - epic-reducer-project jobs: - flake: + flake-packages: runs-on: ubuntu-latest steps: @@ -46,3 +46,20 @@ jobs: run: nix build .#components - name: Check that components bundles run: nix build .#components-bundle + + flake-devshells: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Install nix + uses: cachix/install-nix-action@v17 + with: + nix_path: nixpkgs=channel:nixos-22.05 + - name: Use cachix + uses: cachix/cachix-action@v10 + with: + name: quantified-uncertainty + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + - name: Build devshell + run: nix develop -c echo "built devshell" diff --git a/.prettierignore b/.prettierignore index 7bbb5874..ba58d386 100644 --- a/.prettierignore +++ b/.prettierignore @@ -13,3 +13,4 @@ packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_Generate packages/vscode-ext/media/vendor/ packages/squiggle-lang/.nyc_output/ packages/*/dist +result From d6490be96fbb3139b34f614bad42643f8c6f0dd6 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 13:23:32 +0800 Subject: [PATCH 31/55] a modest dag --- .github/workflows/ci-cachix.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cachix.yml b/.github/workflows/ci-cachix.yml index ca00408b..ee703747 100644 --- a/.github/workflows/ci-cachix.yml +++ b/.github/workflows/ci-cachix.yml @@ -13,9 +13,9 @@ on: - epic-reducer-project jobs: - flake-packages: + flake-lints: runs-on: ubuntu-latest - + id: lints steps: - name: Checkout code uses: actions/checkout@v3 @@ -38,6 +38,22 @@ jobs: - name: Check that vscode extension lints run: nix build .#vscode-lint + flake-packages: + runs-on: ubuntu-latest + needs: lints + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Install nix + uses: cachix/install-nix-action@v17 + with: + nix_path: nixpkgs=channel:nixos-22.05 + - name: Use cachix + uses: cachix/cachix-action@v10 + with: + name: quantified-uncertainty + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + - name: Check all lang tests run: nix build .#lang-test - name: Check that lang bundles From 37dfc49c58effb0b1997bf9b1a1ce4387dc9e301 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 13:25:02 +0800 Subject: [PATCH 32/55] a modest dag (2) --- .github/workflows/ci-cachix.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci-cachix.yml b/.github/workflows/ci-cachix.yml index ee703747..4d221991 100644 --- a/.github/workflows/ci-cachix.yml +++ b/.github/workflows/ci-cachix.yml @@ -15,7 +15,6 @@ on: jobs: flake-lints: runs-on: ubuntu-latest - id: lints steps: - name: Checkout code uses: actions/checkout@v3 @@ -40,7 +39,7 @@ jobs: flake-packages: runs-on: ubuntu-latest - needs: lints + needs: flake-lints steps: - name: Checkout code uses: actions/checkout@v3 From 3f50cde0a664aac24f11b85c8498c703b68ebad4 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 13:45:12 +0800 Subject: [PATCH 33/55] refactored shells nix code --- .github/workflows/ci-cachix.yml | 9 ++++++-- flake.nix | 6 +++-- nix/shell.nix | 40 ++++++++++++++++++--------------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-cachix.yml b/.github/workflows/ci-cachix.yml index 4d221991..f6da9c0d 100644 --- a/.github/workflows/ci-cachix.yml +++ b/.github/workflows/ci-cachix.yml @@ -14,6 +14,7 @@ on: jobs: flake-lints: + name: All lint runs-on: ubuntu-latest steps: - name: Checkout code @@ -38,6 +39,7 @@ jobs: run: nix build .#vscode-lint flake-packages: + name: Builds, tests, and bundles runs-on: ubuntu-latest needs: flake-lints steps: @@ -63,6 +65,7 @@ jobs: run: nix build .#components-bundle flake-devshells: + name: Development shell environment runs-on: ubuntu-latest steps: - name: Checkout code @@ -76,5 +79,7 @@ jobs: with: name: quantified-uncertainty authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - - name: Build devshell - run: nix develop -c echo "built devshell" + - name: Build js devshell + run: nix develop .#js -c echo "built js devshell" + - name: Build js & wasm devshell + run: nix develop -c echo "built js & wasm devshell" diff --git a/flake.nix b/flake.nix index 0c6724c3..4e02f68b 100644 --- a/flake.nix +++ b/flake.nix @@ -74,8 +74,10 @@ }; # developing - devShells = flake-utils.lib.flattenTree { - default = (import ./nix/shell.nix { inherit pkgs; }).shell; + devShells = let shellNix = import ./nix/shell.nix { inherit pkgs; }; + in flake-utils.lib.flattenTree { + default = shellNix.all; + js = shellNix.just-js; }; }; in flake-utils.lib.eachDefaultSystem (system: diff --git a/nix/shell.nix b/nix/shell.nix index 16c20eab..26f62625 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -1,21 +1,25 @@ { pkgs }: -with pkgs; { - shell = mkShell { - name = "SQUIGGLE_yarn-wasm-devshell"; - buildInputs = [ - wasm-pack - cargo - yarn - nodejs - nodePackages.ts-node - rustup - pkg-config - libressl - nixfmt - rustfmt - wasmtime - binaryen - wasm-bindgen-cli - ]; +with pkgs; +let + js = [ yarn nodejs nodePackages.ts-node ]; + rust = [ + wasm-pack + cargo + rustup + pkg-config + libressl + rustfmt + wasmtime + binaryen + wasm-bindgen-cli + ]; +in { + all = mkShell { + name = "squiggle_yarn-wasm-devshell"; + buildInputs = builtins.concatLists [ js rust [ nixfmt ] ]; + }; + just-js = mkShell { + name = "squiggle_yarn-devshell"; + buildInputs = js ++ [ nixfmt ]; }; } From 83ee5dfb6376ec109a7b3150c50bdfc4c1cd2bd7 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 14:16:29 +0800 Subject: [PATCH 34/55] cut down trad `ci.yml` by commenting out stuff covered by nix; added cli lint --- .github/workflows/ci-cachix.yml | 6 +- .github/workflows/ci.yml | 250 ++++++++++++++++---------------- flake.nix | 7 + nix/squiggle-cli.nix | 13 ++ 4 files changed, 149 insertions(+), 127 deletions(-) create mode 100644 nix/squiggle-cli.nix diff --git a/.github/workflows/ci-cachix.yml b/.github/workflows/ci-cachix.yml index f6da9c0d..e09ba31b 100644 --- a/.github/workflows/ci-cachix.yml +++ b/.github/workflows/ci-cachix.yml @@ -37,6 +37,8 @@ jobs: run: nix build .#docusaurus-lint - name: Check that vscode extension lints run: nix build .#vscode-lint + - name: Check that cli lints + run: nix build .#cli-lint flake-packages: name: Builds, tests, and bundles @@ -80,6 +82,6 @@ jobs: name: quantified-uncertainty authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - name: Build js devshell - run: nix develop .#js -c echo "built js devshell" + run: nix develop --profile just-js - name: Build js & wasm devshell - run: nix develop -c echo "built js & wasm devshell" + run: nix develop --profile full-shell diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a649ec7..2663eb54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,26 +49,26 @@ jobs: with: paths: '["packages/cli/**"]' - lang-lint: - name: Language lint - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/squiggle-lang - steps: - - uses: actions/checkout@v3 - - name: Install Dependencies - run: cd ../../ && yarn - - name: Check rescript lint - run: yarn lint:rescript - - name: Check javascript, typescript, and markdown lint - uses: creyD/prettier_action@v4.2 - with: - dry: true - prettier_options: --check packages/squiggle-lang +# lang-lint: +# name: Language lint +# runs-on: ubuntu-latest +# needs: pre_check +# if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} +# defaults: +# run: +# shell: bash +# working-directory: packages/squiggle-lang +# steps: +# - uses: actions/checkout@v3 +# - name: Install Dependencies +# run: cd ../../ && yarn +# - name: Check rescript lint +# run: yarn lint:rescript +# - name: Check javascript, typescript, and markdown lint +# uses: creyD/prettier_action@v4.2 +# with: +# dry: true +# prettier_options: --check packages/squiggle-lang lang-build-test-bundle: name: Language build, test, and bundle @@ -98,96 +98,96 @@ jobs: - name: Upload typescript coverage report run: yarn coverage:ts:ci - components-lint: - name: Components lint - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/components - steps: - - uses: actions/checkout@v3 - - name: Check javascript, typescript, and markdown lint - uses: creyD/prettier_action@v4.2 - with: - dry: true - prettier_options: --check packages/components --ignore-path packages/components/.prettierignore +# components-lint: +# name: Components lint +# runs-on: ubuntu-latest +# needs: pre_check +# if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }} +# defaults: +# run: +# shell: bash +# working-directory: packages/components +# steps: +# - uses: actions/checkout@v3 +# - name: Check javascript, typescript, and markdown lint +# uses: creyD/prettier_action@v4.2 +# with: +# dry: true +# prettier_options: --check packages/components --ignore-path packages/components/.prettierignore +# +# components-bundle-build: +# name: Components bundle and build +# runs-on: ubuntu-latest +# needs: pre_check +# if: ${{ (needs.pre_check.outputs.should_skip_components != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') }} +# defaults: +# run: +# shell: bash +# working-directory: packages/components +# steps: +# - uses: actions/checkout@v3 +# - name: Install dependencies from monorepo level +# run: cd ../../ && yarn +# - name: Build rescript codebase in squiggle-lang +# run: cd ../squiggle-lang && yarn build +# - name: Run webpack +# run: yarn bundle +# - name: Build storybook +# run: yarn build - components-bundle-build: - name: Components bundle and build - runs-on: ubuntu-latest - needs: pre_check - if: ${{ (needs.pre_check.outputs.should_skip_components != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') }} - defaults: - run: - shell: bash - working-directory: packages/components - steps: - - uses: actions/checkout@v3 - - name: Install dependencies from monorepo level - run: cd ../../ && yarn - - name: Build rescript codebase in squiggle-lang - run: cd ../squiggle-lang && yarn build - - name: Run webpack - run: yarn bundle - - name: Build storybook - run: yarn build - - website-lint: - name: Website lint - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/website - steps: - - uses: actions/checkout@v3 - - name: Check javascript, typescript, and markdown lint - uses: creyD/prettier_action@v4.2 - with: - dry: true - prettier_options: --check packages/website - - website-build: - name: Website build - runs-on: ubuntu-latest - needs: pre_check - if: ${{ (needs.pre_check.outputs.should_skip_website != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') || (needs.pre_check.outputs.should_skip_components != 'true') }} - defaults: - run: - shell: bash - working-directory: packages/website - steps: - - uses: actions/checkout@v3 - - name: Install dependencies from monorepo level - run: cd ../../ && yarn - - name: Build rescript in squiggle-lang - run: cd ../squiggle-lang && yarn build - - name: Build components - run: cd ../components && yarn build - - name: Build website assets - run: yarn build - - vscode-ext-lint: - name: VS Code extension lint - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/vscode-ext - steps: - - uses: actions/checkout@v3 - - name: Check javascript, typescript, and markdown lint - uses: creyD/prettier_action@v4.2 - with: - dry: true - prettier_options: --check packages/vscode-ext +# website-lint: +# name: Website lint +# runs-on: ubuntu-latest +# needs: pre_check +# if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }} +# defaults: +# run: +# shell: bash +# working-directory: packages/website +# steps: +# - uses: actions/checkout@v3 +# - name: Check javascript, typescript, and markdown lint +# uses: creyD/prettier_action@v4.2 +# with: +# dry: true +# prettier_options: --check packages/website +# +# website-build: +# name: Website build +# runs-on: ubuntu-latest +# needs: pre_check +# if: ${{ (needs.pre_check.outputs.should_skip_website != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') || (needs.pre_check.outputs.should_skip_components != 'true') }} +# defaults: +# run: +# shell: bash +# working-directory: packages/website +# steps: +# - uses: actions/checkout@v3 +# - name: Install dependencies from monorepo level +# run: cd ../../ && yarn +# - name: Build rescript in squiggle-lang +# run: cd ../squiggle-lang && yarn build +# - name: Build components +# run: cd ../components && yarn build +# - name: Build website assets +# run: yarn build +# +# vscode-ext-lint: +# name: VS Code extension lint +# runs-on: ubuntu-latest +# needs: pre_check +# if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }} +# defaults: +# run: +# shell: bash +# working-directory: packages/vscode-ext +# steps: +# - uses: actions/checkout@v3 +# - name: Check javascript, typescript, and markdown lint +# uses: creyD/prettier_action@v4.2 +# with: +# dry: true +# prettier_options: --check packages/vscode-ext vscode-ext-build: name: VS Code extension build @@ -205,19 +205,19 @@ jobs: - name: Build run: yarn compile - cli-lint: - name: CLI lint - runs-on: ubuntu-latest - needs: pre_check - if: ${{ needs.pre_check.outputs.should_skip_cli != 'true' }} - defaults: - run: - shell: bash - working-directory: packages/cli - steps: - - uses: actions/checkout@v3 - - name: Check javascript, typescript, and markdown lint - uses: creyD/prettier_action@v4.2 - with: - dry: true - prettier_options: --check packages/cli +# cli-lint: +# name: CLI lint +# runs-on: ubuntu-latest +# needs: pre_check +# if: ${{ needs.pre_check.outputs.should_skip_cli != 'true' }} +# defaults: +# run: +# shell: bash +# working-directory: packages/cli +# steps: +# - uses: actions/checkout@v3 +# - name: Check javascript, typescript, and markdown lint +# uses: creyD/prettier_action@v4.2 +# with: +# dry: true +# prettier_options: --check packages/cli diff --git a/flake.nix b/flake.nix index 4e02f68b..9e0ee063 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,10 @@ import ./nix/squiggle-vscode.nix { inherit pkgs commonFn langFn componentsFn; }; + cliFn = { pkgs, ... }: + import ./nix/squiggle-cli.nix { + inherit pkgs commonFn; + }; # local machines localFlakeOutputs = { pkgs, ... }: @@ -50,6 +54,7 @@ components = componentsFn pkgs; website = websiteFn pkgs; vscodeext = vscodeextFn pkgs; + cli = cliFn pkgs; in { # validating checks = flake-utils.lib.flattenTree { @@ -57,6 +62,7 @@ lang-test = lang.test; components-lint = components.lint; docusaurus-lint = website.lint; + cli-lint = cli.lint; }; # building packages = flake-utils.lib.flattenTree { @@ -71,6 +77,7 @@ components-lint = components.lint; docusaurus-lint = website.lint; vscode-lint = vscodeext.lint; + cli-lint = cli.lint; }; # developing diff --git a/nix/squiggle-cli.nix b/nix/squiggle-cli.nix new file mode 100644 index 00000000..4dd7998b --- /dev/null +++ b/nix/squiggle-cli.nix @@ -0,0 +1,13 @@ +{ pkgs, commonFn }: + +rec { + common = commonFn pkgs; + + lint = pkgs.stdenv.mkDerivation { + name = "squiggle-cli-lint"; + buildInputs = common.buildInputs ++ common.prettier; + src = ../packages/cli; + buildPhase = "prettier --check ."; + installPhase = "mkdir -p $out"; + }; +} From 4b6a565c3361973eb62f9ed5d6224c23011a51ef Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 17:12:50 +0800 Subject: [PATCH 35/55] minor cleanup --- flake.nix | 1 + nix/squiggle-website.nix | 36 ++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index 9e0ee063..275c3f28 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,7 @@ # building packages = flake-utils.lib.flattenTree { default = components.build; + lang = lang.build; lang-bundle = lang.bundle; lang-test = lang.test; components = components.build; diff --git a/nix/squiggle-website.nix b/nix/squiggle-website.nix index 41c9d28d..3209affd 100644 --- a/nix/squiggle-website.nix +++ b/nix/squiggle-website.nix @@ -2,24 +2,24 @@ rec { common = commonFn pkgs; - # lang = langFn pkgs; - # components = componentsFn pkgs; - # websitePackageJson = let - # raw = pkgs.lib.importJSON ../packages/website/package.json; - # modified = pkgs.lib.recursiveUpdate raw { - # dependencies.postcss-import = "^14.1.0"; - # dependencies.tailwindcss = "^3.1.8"; - # }; - # packageJsonString = builtins.toJSON modified; - # in pkgs.writeText "packages/website/patched-package.json" packageJsonString; - # yarn-source = pkgs.mkYarnPackage { - # name = "squiggle-website_yarnsource"; - # src = ../packages/website; - # packageJSON = websitePackageJson; - # yarnLock = ../yarn.lock; - # packageResolutions."@quri/squiggle-lang" = lang.build; - # packageResolutions."@quri/squiggle-components" = components.build; - # }; + lang = langFn pkgs; + components = componentsFn pkgs; + websitePackageJson = let + raw = pkgs.lib.importJSON ../packages/website/package.json; + modified = pkgs.lib.recursiveUpdate raw { + dependencies.postcss-import = "^14.1.0"; + dependencies.tailwindcss = "^3.1.8"; + }; + packageJsonString = builtins.toJSON modified; + in pkgs.writeText "packages/website/patched-package.json" packageJsonString; + yarn-source = pkgs.mkYarnPackage { + name = "squiggle-website_yarnsource"; + src = ../packages/website; + packageJSON = websitePackageJson; + yarnLock = ../yarn.lock; + packageResolutions."@quri/squiggle-lang" = lang.build; + packageResolutions."@quri/squiggle-components" = components.build; + }; lint = pkgs.stdenv.mkDerivation { name = "squiggle-website-lint"; buildInputs = common.buildInputs ++ common.prettier; From 02cbf227ad0bf5405a36e207f345b657f087f081 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 19:10:59 +0800 Subject: [PATCH 36/55] `rescript-association` merged the `gentype` flake, so our flake inputs are updated accordingly --- flake.lock | 10 +++++----- flake.nix | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index fcadffff..67f81079 100644 --- a/flake.lock +++ b/flake.lock @@ -38,15 +38,15 @@ ] }, "locked": { - "lastModified": 1660630689, - "narHash": "sha256-oM21qcr+VtI69GIm56UDy6oGiupq2GkZDIaKXWWnM8k=", - "owner": "quinn-dougherty", + "lastModified": 1661855866, + "narHash": "sha256-+q0OOTyaq8eOn9BOWdPOCtSDOISW4A59v3mq3JOZyug=", + "owner": "rescript-association", "repo": "genType", - "rev": "c2a022cfec32b5a61d575205daa93416a9a9309c", + "rev": "6b5f164b4f6ced456019b7579a0ab7e0a86518ad", "type": "github" }, "original": { - "owner": "quinn-dougherty", + "owner": "rescript-association", "repo": "genType", "type": "github" } diff --git a/flake.nix b/flake.nix index 275c3f28..97bcf485 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-22.05"; gentype = { - url = "github:quinn-dougherty/genType"; + url = "github:rescript-association/genType"; inputs.nixpkgs.follows = "nixpkgs"; }; flake-utils.url = "github:numtide/flake-utils"; From 2f525c4f8e88e112cb0d67ebbfd6007392032251 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 30 Aug 2022 19:44:34 +0800 Subject: [PATCH 37/55] put `.#js` in devshells job where it was supposed to be --- .github/workflows/ci-cachix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cachix.yml b/.github/workflows/ci-cachix.yml index e09ba31b..dfcee3d8 100644 --- a/.github/workflows/ci-cachix.yml +++ b/.github/workflows/ci-cachix.yml @@ -82,6 +82,6 @@ jobs: name: quantified-uncertainty authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - name: Build js devshell - run: nix develop --profile just-js + run: nix develop .#js --profile just-js - name: Build js & wasm devshell run: nix develop --profile full-shell From 2f77888365a675acb0f3292f9b9fbb0e4dd230c3 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 30 Aug 2022 17:58:51 -0700 Subject: [PATCH 38/55] Changed getByWithFn to not need two function calls --- .../squiggle-lang/src/rescript/Utility/E.res | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Utility/E.res b/packages/squiggle-lang/src/rescript/Utility/E.res index 22c8c525..4cad3472 100644 --- a/packages/squiggle-lang/src/rescript/Utility/E.res +++ b/packages/squiggle-lang/src/rescript/Utility/E.res @@ -572,12 +572,22 @@ module A = { |> (x => Ok(x)) } - let getByOpen = (a, op, bin) => - switch getBy(a, r => bin(op(r))) { - | Some(r) => Some(op(r)) - | None => None + let getByWithFn = (a, fn, boolCondition) => { + let i = ref(0); + let finalFunctionValue = ref(None); + let length = Belt.Array.length(a); + + while (i.contents < length) && (finalFunctionValue.contents == None) { + let itemWithFnApplied = Belt.Array.getUnsafe(a, i.contents) |> fn + if boolCondition(itemWithFnApplied) { + finalFunctionValue := Some(itemWithFnApplied) + } + i := i.contents + 1 } + finalFunctionValue.contents + } + let tail = Belt.Array.sliceToEnd(_, 1) let zip = Belt.Array.zip @@ -680,7 +690,7 @@ module A = { let firstSome = x => Belt.Array.getBy(x, O.isSome) let firstSomeFn = (r: array option<'a>>): option<'a> => - O.flatten(getByOpen(r, l => l(), O.isSome)) + O.flatten(getByWithFn(r, l => l(), O.isSome)) let firstSomeFnWithDefault = (r, default) => firstSomeFn(r)->O2.default(default) From 22458aa9e51e06e2d70bbdbf187310aeb68b4214 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 30 Aug 2022 18:17:00 -0700 Subject: [PATCH 39/55] Proper formatting --- packages/squiggle-lang/src/rescript/Utility/E.res | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Utility/E.res b/packages/squiggle-lang/src/rescript/Utility/E.res index 4cad3472..a2012efd 100644 --- a/packages/squiggle-lang/src/rescript/Utility/E.res +++ b/packages/squiggle-lang/src/rescript/Utility/E.res @@ -573,11 +573,11 @@ module A = { } let getByWithFn = (a, fn, boolCondition) => { - let i = ref(0); - let finalFunctionValue = ref(None); - let length = Belt.Array.length(a); + let i = ref(0) + let finalFunctionValue = ref(None) + let length = Belt.Array.length(a) - while (i.contents < length) && (finalFunctionValue.contents == None) { + while i.contents < length && finalFunctionValue.contents == None { let itemWithFnApplied = Belt.Array.getUnsafe(a, i.contents) |> fn if boolCondition(itemWithFnApplied) { finalFunctionValue := Some(itemWithFnApplied) From 39a9cd4eb9c5fe3829160d39536877c61d5b267a Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Wed, 31 Aug 2022 10:31:32 +0800 Subject: [PATCH 40/55] a few unit tests --- packages/squiggle-lang/__tests__/E/A_test.res | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 packages/squiggle-lang/__tests__/E/A_test.res diff --git a/packages/squiggle-lang/__tests__/E/A_test.res b/packages/squiggle-lang/__tests__/E/A_test.res new file mode 100644 index 00000000..c40dba7f --- /dev/null +++ b/packages/squiggle-lang/__tests__/E/A_test.res @@ -0,0 +1,21 @@ +open Jest +open TestHelpers + +describe("E.A.getByWithFn", () => { + makeTest("Empty list returns None", E.A.getByWithFn([], x => x + 1, x => mod(x, 2) == 0), None) + makeTest( + "Never predicate returns None", + E.A.getByWithFn([1, 2, 3, 4, 5, 6], x => x + 1, _ => false), + None, + ) + makeTest( + "function evaluates", + E.A.getByWithFn([1, 1, 1, 1, 1, 1, 1, 2, 1, 1], x => 3 * x, x => x > 4), + Some(6), + ) + makeTest( + "always predicate returns fn(fst(a))", + E.A.getByWithFn([0, 1, 2, 3, 4, 5, 6], x => 10 + x, _ => true), + Some(10), + ) +}) From 6631c9bad78a4b0f34d0c5f3c4e8b05aeddacade Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Wed, 31 Aug 2022 19:56:12 -0700 Subject: [PATCH 41/55] Renamed getByWithFn --- packages/squiggle-lang/__tests__/E/A_test.res | 10 +++++----- packages/squiggle-lang/src/rescript/Utility/E.res | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/squiggle-lang/__tests__/E/A_test.res b/packages/squiggle-lang/__tests__/E/A_test.res index c40dba7f..81a38d36 100644 --- a/packages/squiggle-lang/__tests__/E/A_test.res +++ b/packages/squiggle-lang/__tests__/E/A_test.res @@ -1,21 +1,21 @@ open Jest open TestHelpers -describe("E.A.getByWithFn", () => { - makeTest("Empty list returns None", E.A.getByWithFn([], x => x + 1, x => mod(x, 2) == 0), None) +describe("E.A.getByFmap", () => { + makeTest("Empty list returns None", E.A.getByFmap([], x => x + 1, x => mod(x, 2) == 0), None) makeTest( "Never predicate returns None", - E.A.getByWithFn([1, 2, 3, 4, 5, 6], x => x + 1, _ => false), + E.A.getByFmap([1, 2, 3, 4, 5, 6], x => x + 1, _ => false), None, ) makeTest( "function evaluates", - E.A.getByWithFn([1, 1, 1, 1, 1, 1, 1, 2, 1, 1], x => 3 * x, x => x > 4), + E.A.getByFmap([1, 1, 1, 1, 1, 1, 1, 2, 1, 1], x => 3 * x, x => x > 4), Some(6), ) makeTest( "always predicate returns fn(fst(a))", - E.A.getByWithFn([0, 1, 2, 3, 4, 5, 6], x => 10 + x, _ => true), + E.A.getByFmap([0, 1, 2, 3, 4, 5, 6], x => 10 + x, _ => true), Some(10), ) }) diff --git a/packages/squiggle-lang/src/rescript/Utility/E.res b/packages/squiggle-lang/src/rescript/Utility/E.res index a2012efd..bceb12c7 100644 --- a/packages/squiggle-lang/src/rescript/Utility/E.res +++ b/packages/squiggle-lang/src/rescript/Utility/E.res @@ -572,7 +572,7 @@ module A = { |> (x => Ok(x)) } - let getByWithFn = (a, fn, boolCondition) => { + let getByFmap = (a, fn, boolCondition) => { let i = ref(0) let finalFunctionValue = ref(None) let length = Belt.Array.length(a) @@ -690,7 +690,7 @@ module A = { let firstSome = x => Belt.Array.getBy(x, O.isSome) let firstSomeFn = (r: array option<'a>>): option<'a> => - O.flatten(getByWithFn(r, l => l(), O.isSome)) + O.flatten(getByFmap(r, l => l(), O.isSome)) let firstSomeFnWithDefault = (r, default) => firstSomeFn(r)->O2.default(default) From 64539bc121facaabb11653d9a05bbffb9b6fda77 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Wed, 31 Aug 2022 20:53:48 -0700 Subject: [PATCH 43/55] Playground should show stat summary by default --- packages/components/src/components/SquigglePlayground.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index c3e38b1a..dad989a8 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -231,7 +231,7 @@ export const PlaygroundContext = React.createContext({ export const SquigglePlayground: FC = ({ defaultCode = "", height = 500, - showSummary = false, + showSummary = true, logX = false, expY = false, title, From b6a2eac8fc2e6e89b864ad1cb67b9674b82701e5 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 1 Sep 2022 12:12:12 +0800 Subject: [PATCH 44/55] hotfix: switch release-please to `master` --- .github/workflows/release-please.yml | 53 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index f4bbbf9e..f2efd4f8 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -3,7 +3,7 @@ name: Run Release Please on: push: branches: - - develop + - master jobs: pre_check: @@ -57,19 +57,20 @@ jobs: path: packages/squiggle-lang bump-patch-for-minor-pre-major: true skip-github-release: true - # - name: Publish: Checkout source - # uses: actions/checkout@v2 - # # these if statements ensure that a publication only occurs when - # # a new release is created: - # if: ${{ steps.release.outputs.release_created }} - # - name: Publish: Install dependencies - # run: yarn - # if: ${{ steps.release.outputs.release_created }} - # - name: Publish - # run: cd packages/squiggle-lang && yarn publish - # env: - # NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - # if: ${{ steps.release.outputs.release_created }} + - name: Publish- Checkout source + uses: actions/checkout@v3 + # these if statements ensure that a publication only occurs when + # a new release is created: + if: ${{ steps.release.outputs.release_created }} + - name: Publish: Install dependencies + run: yarn + if: ${{ steps.release.outputs.release_created }} + - name: Publish + run: cd packages/squiggle-lang && yarn publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ steps.release.outputs.release_created }} + relplz-components: name: for components runs-on: ubuntu-latest @@ -84,18 +85,18 @@ jobs: path: packages/components bump-patch-for-minor-pre-major: true skip-github-release: true - # - name: Publish: Checkout source - # uses: actions/checkout@v2 - # # these if statements ensure that a publication only occurs when - # # a new release is created: - # if: ${{ steps.release.outputs.release_created }} - # - name: Publish: Install dependencies - # run: yarn - # if: ${{ steps.release.outputs.release_created }} - # - name: Publish - # run: cd packages/components && yarn publish - # env: - # NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + - name: Publish: Checkout source + uses: actions/checkout@v2 + # these if statements ensure that a publication only occurs when + # a new release is created: + if: ${{ steps.release.outputs.release_created }} + - name: Publish- Install dependencies + run: yarn + if: ${{ steps.release.outputs.release_created }} + - name: Publish + run: cd packages/components && yarn publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} relplz-website: name: for website runs-on: ubuntu-latest From 2209fd179ee92a40291bf13ab7be6d97ce96afec Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 1 Sep 2022 12:14:23 +0800 Subject: [PATCH 45/55] hotfix: switch release-please to `master` (2) --- .github/workflows/release-please.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index f2efd4f8..f33a838b 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -62,7 +62,7 @@ jobs: # these if statements ensure that a publication only occurs when # a new release is created: if: ${{ steps.release.outputs.release_created }} - - name: Publish: Install dependencies + - name: Publish- Install dependencies run: yarn if: ${{ steps.release.outputs.release_created }} - name: Publish @@ -85,8 +85,8 @@ jobs: path: packages/components bump-patch-for-minor-pre-major: true skip-github-release: true - - name: Publish: Checkout source - uses: actions/checkout@v2 + - name: Publish- Checkout source + uses: actions/checkout@v3 # these if statements ensure that a publication only occurs when # a new release is created: if: ${{ steps.release.outputs.release_created }} From 152432b6d6ae5c500da51970583e35bfc3e33aab Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 1 Sep 2022 12:17:42 +0800 Subject: [PATCH 46/55] hotfix: switch release-please to `master` (3) --- .github/workflows/release-please.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index f33a838b..bd3fa87b 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -55,7 +55,7 @@ jobs: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr path: packages/squiggle-lang - bump-patch-for-minor-pre-major: true + # bump-patch-for-minor-pre-major: true skip-github-release: true - name: Publish- Checkout source uses: actions/checkout@v3 @@ -83,7 +83,7 @@ jobs: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr path: packages/components - bump-patch-for-minor-pre-major: true + # bump-patch-for-minor-pre-major: true skip-github-release: true - name: Publish- Checkout source uses: actions/checkout@v3 @@ -109,7 +109,7 @@ jobs: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr path: packages/website - bump-patch-for-minor-pre-major: true + # bump-patch-for-minor-pre-major: true skip-github-release: true relplz-vscodeext: name: for vscode-ext @@ -123,7 +123,7 @@ jobs: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr path: packages/vscode-ext - bump-patch-for-minor-pre-major: true + # bump-patch-for-minor-pre-major: true skip-github-release: true relplz-cl: name: for cli From 255541a679857414124cac85be8764615954d482 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Wed, 31 Aug 2022 21:43:36 -0700 Subject: [PATCH 47/55] Added SampleSet.min and Sampleset.max --- .../SampleSetDist/SampleSetDist.res | 6 ++ .../FunctionRegistry/Library/FR_Sampleset.res | 62 ++++++++++++++++++- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res index f0fbff99..2b76b1fb 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res @@ -140,3 +140,9 @@ let truncate = (t, ~leftCutoff: option, ~rightCutoff: option) => { let withTruncatedRight = t => rightCutoff |> E.O.dimap(left => truncateRight(t, left), _ => Ok(t)) t->withTruncatedLeft |> E.R2.bind(withTruncatedRight) } + +let minOfTwo = (t1: t, t2: t) => map2(~fn=(a, b) => Ok(Js.Math.min_float(a, b)), ~t1, ~t2) +let maxOfTwo = (t1: t, t2: t) => map2(~fn=(a, b) => Ok(Js.Math.max_float(a, b)), ~t1, ~t2) + +let minOfFloat = (t: t, f: float) => samplesMap(~fn=a => Ok(Js.Math.min_float(a, f)), t) +let maxOfFloat = (t: t, f: float) => samplesMap(~fn=a => Ok(Js.Math.max_float(a, f)), t) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res index c40fe349..1d5487ad 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -75,7 +75,7 @@ module Internal = { } } -let library = [ +let library1 = [ Function.make( ~name="fromDist", ~nameSpace, @@ -274,3 +274,63 @@ let library = [ (), ), ] + +module Comparison = { + let template = (name, inputs, run) => { + FnDefinition.make( + ~name, + ~inputs, + ~run=(inputs, _, _, _) => { + run(inputs) + }, + (), + ) + } + + let wrapper = r => + r + ->E.R2.fmap(r => r->Wrappers.sampleSet->Wrappers.evDistribution) + ->E.R2.errMap(SampleSetDist.Error.toString) + + let mkBig = (name, withDist, withFloat) => + Function.make( + ~name, + ~nameSpace, + ~requiresNamespace=false, + ~examples=[ + `SampleSet.${name}(SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(6,2)))`, + `SampleSet.${name}(SampleSet.fromDist(normal(5,2)), 3.0)`, + `SampleSet.${name}(4.0, SampleSet.fromDist(normal(6,2)))`, + ], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + template(name, [FRTypeDist, FRTypeDist], inputs => { + switch inputs { + | [IEvDistribution(SampleSet(dist1)), IEvDistribution(SampleSet(dist2))] => + withDist(dist1, dist2)->wrapper + | _ => Error(impossibleError) + } + }), + template(name, [FRTypeDist, FRTypeNumber], inputs => { + switch inputs { + | [IEvDistribution(SampleSet(dist)), IEvNumber(f)] => withFloat(dist, f)->wrapper + | _ => Error(impossibleError) + } + }), + template(name, [FRTypeNumber, FRTypeDist], inputs => { + switch inputs { + | [IEvNumber(f), IEvDistribution(SampleSet(dist))] => withFloat(dist, f)->wrapper + | _ => Error(impossibleError) + } + }), + ], + (), + ) + + let library = [ + mkBig("min", SampleSetDist.minOfTwo, SampleSetDist.minOfFloat), + mkBig("max", SampleSetDist.maxOfTwo, SampleSetDist.maxOfFloat), + ] +} + +let library = E.A.append(library1, Comparison.library) From 989fa9644a336de843d2730fccd2f12f93d6424b Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 1 Sep 2022 12:48:07 +0800 Subject: [PATCH 48/55] rm `|>` in favor of `->` --- .../rescript/Distributions/SampleSetDist/SampleSetDist.res | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res index 8c8b6f7e..c0d6e4bf 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res @@ -145,10 +145,10 @@ let mixture = (values: array<(t, float)>, intendedLength: int) => { discreteSamples ->Belt.Array.mapWithIndex((index, distIndexToChoose) => { let chosenDist = E.A.get(dists, E.Float.toInt(distIndexToChoose)) - chosenDist |> E.O2.bind(E.A.get(_, index)) + chosenDist -> E.O.bind(E.A.get(_, index)) }) ->E.A.O.openIfAllSome - (samples |> E.O.toExn("Mixture unreachable error"))->T.make + (samples -> E.O2.toExn("Mixture unreachable error"))->T.make } let truncateLeft = (t, f) => T.get(t)->E.A2.filter(x => x >= f)->T.make From 9366ce61f3ac8bca94bd78089403a23de23c1761 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 1 Sep 2022 12:48:20 +0800 Subject: [PATCH 49/55] `yarn format` compels me --- .../rescript/Distributions/PointSetDist/PointSetDist.res | 6 +++--- .../rescript/Distributions/SampleSetDist/SampleSetDist.res | 4 ++-- packages/squiggle-lang/src/rescript/Utility/Stdlib.res | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res index bbf2b074..a52ee784 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res @@ -258,6 +258,6 @@ let toSparkline = (t: t, bucketCount): resultE.O2.toResult(PointSetTypes.CannotSparklineDiscrete) ->E.R2.fmap(r => Continuous.getShape(r).ys->Sparklines.create()) -let makeDiscrete = (d):t => Discrete(d) -let makeContinuous = (d):t => Continuous(d) -let makeMixed = (d):t => Mixed(d) \ No newline at end of file +let makeDiscrete = (d): t => Discrete(d) +let makeContinuous = (d): t => Continuous(d) +let makeMixed = (d): t => Mixed(d) diff --git a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res index c0d6e4bf..364ecc56 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res @@ -145,10 +145,10 @@ let mixture = (values: array<(t, float)>, intendedLength: int) => { discreteSamples ->Belt.Array.mapWithIndex((index, distIndexToChoose) => { let chosenDist = E.A.get(dists, E.Float.toInt(distIndexToChoose)) - chosenDist -> E.O.bind(E.A.get(_, index)) + chosenDist->E.O.bind(E.A.get(_, index)) }) ->E.A.O.openIfAllSome - (samples -> E.O2.toExn("Mixture unreachable error"))->T.make + samples->E.O2.toExn("Mixture unreachable error")->T.make } let truncateLeft = (t, f) => T.get(t)->E.A2.filter(x => x >= f)->T.make diff --git a/packages/squiggle-lang/src/rescript/Utility/Stdlib.res b/packages/squiggle-lang/src/rescript/Utility/Stdlib.res index a0bde73d..bc7046ce 100644 --- a/packages/squiggle-lang/src/rescript/Utility/Stdlib.res +++ b/packages/squiggle-lang/src/rescript/Utility/Stdlib.res @@ -45,4 +45,4 @@ module Random = { size: int, } @module external sample: (array, sampleArgs) => array = "@stdlib/random/sample" -} \ No newline at end of file +} From ab5b54413bc7ee9b6ea699dc74c5a7e4d63c5338 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 1 Sep 2022 12:54:04 +0800 Subject: [PATCH 50/55] it string in tests --- packages/squiggle-lang/__tests__/Stdlib_test.res | 10 +++++++--- .../rescript/Distributions/PointSetDist/Discrete.res | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Stdlib_test.res b/packages/squiggle-lang/__tests__/Stdlib_test.res index 6b571fab..5919f3b4 100644 --- a/packages/squiggle-lang/__tests__/Stdlib_test.res +++ b/packages/squiggle-lang/__tests__/Stdlib_test.res @@ -7,10 +7,14 @@ let makeTest = (~only=false, str, item1, item2) => : test(str, () => expect(item1)->toEqual(item2)) describe("Stdlib", () => { - makeTest("min", Stdlib.Random.sample([1.0, 2.0], {probs: [0.5, 0.5], size: 10}) |> E.A.length, 10) makeTest( - "min", - Stdlib.Random.sample([1.0, 2.0], {probs: [0.5, 0.5], size: 10}) |> E.A.uniq |> E.A.Floats.sort, + "Length of Random.sample", + Stdlib.Random.sample([1.0, 2.0], {probs: [0.5, 0.5], size: 10})->E.A.length, + 10, + ) + makeTest( + "Random.sample returns elements from input array (will fail with very slim probability)", + Stdlib.Random.sample([1.0, 2.0], {probs: [0.5, 0.5], size: 10})->E.A.uniq->E.A.Floats.sort, [1.0, 2.0], ) }) diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res index ba708f0b..7142f097 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res @@ -226,6 +226,6 @@ module T = Dist({ }) let sampleN = (t: t, n): array => { - let normalized = t |> T.normalize |> getShape + let normalized = t->T.normalize->getShape Stdlib.Random.sample(normalized.xs, {probs: normalized.ys, size: n}) } From ab9a83bcf7d306601b7112650f2a728cd6817970 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 1 Sep 2022 13:07:13 +0800 Subject: [PATCH 51/55] I think we're done here? --- .../squiggle-lang/src/rescript/Distributions/GenericDist.res | 2 +- packages/squiggle-lang/src/rescript/Utility/Stdlib.res | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res b/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res index 9db131da..0c279a9c 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/GenericDist.res @@ -516,7 +516,7 @@ let mixture = ( switch value { | SampleSet(sampleSet) => Ok((sampleSet, weight)) | _ => Error("Unreachable") - } |> E.R.toExn("Mixture coding error: SampleSet expected. This should be inaccessible.") + }->E.R2.toExn("Mixture coding error: SampleSet expected. This should be inaccessible.") ) let sampleSetMixture = SampleSetDist.mixture(withSampleSetValues, env.sampleCount) switch sampleSetMixture { diff --git a/packages/squiggle-lang/src/rescript/Utility/Stdlib.res b/packages/squiggle-lang/src/rescript/Utility/Stdlib.res index bc7046ce..ee43e681 100644 --- a/packages/squiggle-lang/src/rescript/Utility/Stdlib.res +++ b/packages/squiggle-lang/src/rescript/Utility/Stdlib.res @@ -45,4 +45,5 @@ module Random = { size: int, } @module external sample: (array, sampleArgs) => array = "@stdlib/random/sample" + let sample = sample } From 96815b6ee519ff05784b1fa8cd4edccb8b3b088e Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Wed, 31 Aug 2022 22:14:41 -0700 Subject: [PATCH 52/55] Really simple tests for SampleSet.min and max --- .../SquiggleLibrary_FunctionRegistryLibrary_test.res | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res index 2418b4d8..7ddb57d4 100644 --- a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -63,6 +63,9 @@ describe("FunctionRegistry Library", () => { testEvalToBe("SampleSet.fromList([3,5,2,3,5,2,3,5,2,3,3,5])", "Ok(Sample Set Distribution)") testEvalToBe("SampleSet.fromList([3,5,2,3,5,2,3,5,2,3,3,5])", "Ok(Sample Set Distribution)") testEvalToBe("SampleSet.fromFn({|| sample(normal(5,2))})", "Ok(Sample Set Distribution)") + testEvalToBe("SampleSet.min(SampleSet.fromDist(normal(50,2)), 2)", "Ok(Sample Set Distribution)") + testEvalToBe("mean(SampleSet.min(SampleSet.fromDist(normal(50,2)), 2))", "Ok(2)") + testEvalToBe("SampleSet.max(SampleSet.fromDist(normal(50,2)), 10)", "Ok(Sample Set Distribution)") testEvalToBe( "addOne(t)=t+1; SampleSet.toList(SampleSet.map(SampleSet.fromList([1,2,3,4,5,6]), addOne))", "Ok([2,3,4,5,6,7])", From e582fc5be332e4264b8a55bc111338fc55ad6f88 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Wed, 31 Aug 2022 22:15:13 -0700 Subject: [PATCH 53/55] library1 -> libraryBase --- .../src/rescript/FunctionRegistry/Library/FR_Sampleset.res | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res index 1d5487ad..a11742db 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -75,7 +75,7 @@ module Internal = { } } -let library1 = [ +let libaryBase = [ Function.make( ~name="fromDist", ~nameSpace, @@ -333,4 +333,4 @@ module Comparison = { ] } -let library = E.A.append(library1, Comparison.library) +let library = E.A.append(libaryBase, Comparison.library) From 57dca26d2bfdf5c228c1f0e67f1f7d3c291234d2 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 1 Sep 2022 14:08:14 +0800 Subject: [PATCH 54/55] fix the resolve to `@stdlib/buffer` --- packages/squiggle-lang/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/squiggle-lang/webpack.config.js b/packages/squiggle-lang/webpack.config.js index c352544d..483980c3 100644 --- a/packages/squiggle-lang/webpack.config.js +++ b/packages/squiggle-lang/webpack.config.js @@ -14,6 +14,7 @@ module.exports = { }, resolve: { extensions: [".tsx", ".ts", ".js"], + fallback: { "buffer": [ "@stdlib/buffer" ] } }, output: { filename: "bundle.js", From 38d0ea79e4a8705d366e0b6b990b72b3dabae7ab Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 1 Sep 2022 14:22:32 +0800 Subject: [PATCH 55/55] `yarn format:all` compels me --- .github/workflows/ci.yml | 219 +++++++++++------------ packages/squiggle-lang/webpack.config.js | 2 +- 2 files changed, 110 insertions(+), 111 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2663eb54..a2d0ef16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,26 +49,26 @@ jobs: with: paths: '["packages/cli/**"]' -# lang-lint: -# name: Language lint -# runs-on: ubuntu-latest -# needs: pre_check -# if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} -# defaults: -# run: -# shell: bash -# working-directory: packages/squiggle-lang -# steps: -# - uses: actions/checkout@v3 -# - name: Install Dependencies -# run: cd ../../ && yarn -# - name: Check rescript lint -# run: yarn lint:rescript -# - name: Check javascript, typescript, and markdown lint -# uses: creyD/prettier_action@v4.2 -# with: -# dry: true -# prettier_options: --check packages/squiggle-lang + # lang-lint: + # name: Language lint + # runs-on: ubuntu-latest + # needs: pre_check + # if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} + # defaults: + # run: + # shell: bash + # working-directory: packages/squiggle-lang + # steps: + # - uses: actions/checkout@v3 + # - name: Install Dependencies + # run: cd ../../ && yarn + # - name: Check rescript lint + # run: yarn lint:rescript + # - name: Check javascript, typescript, and markdown lint + # uses: creyD/prettier_action@v4.2 + # with: + # dry: true + # prettier_options: --check packages/squiggle-lang lang-build-test-bundle: name: Language build, test, and bundle @@ -98,96 +98,96 @@ jobs: - name: Upload typescript coverage report run: yarn coverage:ts:ci -# components-lint: -# name: Components lint -# runs-on: ubuntu-latest -# needs: pre_check -# if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }} -# defaults: -# run: -# shell: bash -# working-directory: packages/components -# steps: -# - uses: actions/checkout@v3 -# - name: Check javascript, typescript, and markdown lint -# uses: creyD/prettier_action@v4.2 -# with: -# dry: true -# prettier_options: --check packages/components --ignore-path packages/components/.prettierignore -# -# components-bundle-build: -# name: Components bundle and build -# runs-on: ubuntu-latest -# needs: pre_check -# if: ${{ (needs.pre_check.outputs.should_skip_components != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') }} -# defaults: -# run: -# shell: bash -# working-directory: packages/components -# steps: -# - uses: actions/checkout@v3 -# - name: Install dependencies from monorepo level -# run: cd ../../ && yarn -# - name: Build rescript codebase in squiggle-lang -# run: cd ../squiggle-lang && yarn build -# - name: Run webpack -# run: yarn bundle -# - name: Build storybook -# run: yarn build + # components-lint: + # name: Components lint + # runs-on: ubuntu-latest + # needs: pre_check + # if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }} + # defaults: + # run: + # shell: bash + # working-directory: packages/components + # steps: + # - uses: actions/checkout@v3 + # - name: Check javascript, typescript, and markdown lint + # uses: creyD/prettier_action@v4.2 + # with: + # dry: true + # prettier_options: --check packages/components --ignore-path packages/components/.prettierignore + # + # components-bundle-build: + # name: Components bundle and build + # runs-on: ubuntu-latest + # needs: pre_check + # if: ${{ (needs.pre_check.outputs.should_skip_components != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') }} + # defaults: + # run: + # shell: bash + # working-directory: packages/components + # steps: + # - uses: actions/checkout@v3 + # - name: Install dependencies from monorepo level + # run: cd ../../ && yarn + # - name: Build rescript codebase in squiggle-lang + # run: cd ../squiggle-lang && yarn build + # - name: Run webpack + # run: yarn bundle + # - name: Build storybook + # run: yarn build -# website-lint: -# name: Website lint -# runs-on: ubuntu-latest -# needs: pre_check -# if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }} -# defaults: -# run: -# shell: bash -# working-directory: packages/website -# steps: -# - uses: actions/checkout@v3 -# - name: Check javascript, typescript, and markdown lint -# uses: creyD/prettier_action@v4.2 -# with: -# dry: true -# prettier_options: --check packages/website -# -# website-build: -# name: Website build -# runs-on: ubuntu-latest -# needs: pre_check -# if: ${{ (needs.pre_check.outputs.should_skip_website != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') || (needs.pre_check.outputs.should_skip_components != 'true') }} -# defaults: -# run: -# shell: bash -# working-directory: packages/website -# steps: -# - uses: actions/checkout@v3 -# - name: Install dependencies from monorepo level -# run: cd ../../ && yarn -# - name: Build rescript in squiggle-lang -# run: cd ../squiggle-lang && yarn build -# - name: Build components -# run: cd ../components && yarn build -# - name: Build website assets -# run: yarn build -# -# vscode-ext-lint: -# name: VS Code extension lint -# runs-on: ubuntu-latest -# needs: pre_check -# if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }} -# defaults: -# run: -# shell: bash -# working-directory: packages/vscode-ext -# steps: -# - uses: actions/checkout@v3 -# - name: Check javascript, typescript, and markdown lint -# uses: creyD/prettier_action@v4.2 -# with: -# dry: true -# prettier_options: --check packages/vscode-ext + # website-lint: + # name: Website lint + # runs-on: ubuntu-latest + # needs: pre_check + # if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }} + # defaults: + # run: + # shell: bash + # working-directory: packages/website + # steps: + # - uses: actions/checkout@v3 + # - name: Check javascript, typescript, and markdown lint + # uses: creyD/prettier_action@v4.2 + # with: + # dry: true + # prettier_options: --check packages/website + # + # website-build: + # name: Website build + # runs-on: ubuntu-latest + # needs: pre_check + # if: ${{ (needs.pre_check.outputs.should_skip_website != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') || (needs.pre_check.outputs.should_skip_components != 'true') }} + # defaults: + # run: + # shell: bash + # working-directory: packages/website + # steps: + # - uses: actions/checkout@v3 + # - name: Install dependencies from monorepo level + # run: cd ../../ && yarn + # - name: Build rescript in squiggle-lang + # run: cd ../squiggle-lang && yarn build + # - name: Build components + # run: cd ../components && yarn build + # - name: Build website assets + # run: yarn build + # + # vscode-ext-lint: + # name: VS Code extension lint + # runs-on: ubuntu-latest + # needs: pre_check + # if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }} + # defaults: + # run: + # shell: bash + # working-directory: packages/vscode-ext + # steps: + # - uses: actions/checkout@v3 + # - name: Check javascript, typescript, and markdown lint + # uses: creyD/prettier_action@v4.2 + # with: + # dry: true + # prettier_options: --check packages/vscode-ext vscode-ext-build: name: VS Code extension build @@ -204,7 +204,6 @@ jobs: run: cd ../../ && yarn - name: Build run: yarn compile - # cli-lint: # name: CLI lint # runs-on: ubuntu-latest diff --git a/packages/squiggle-lang/webpack.config.js b/packages/squiggle-lang/webpack.config.js index 483980c3..e1e0675e 100644 --- a/packages/squiggle-lang/webpack.config.js +++ b/packages/squiggle-lang/webpack.config.js @@ -14,7 +14,7 @@ module.exports = { }, resolve: { extensions: [".tsx", ".ts", ".js"], - fallback: { "buffer": [ "@stdlib/buffer" ] } + fallback: { buffer: ["@stdlib/buffer"] }, }, output: { filename: "bundle.js",