From 9cbeee04515c7f290a80ff39981c51d4ffbfef59 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Tue, 12 Jul 2022 17:09:24 +1000 Subject: [PATCH 001/102] Add multiple plotting --- .../src/components/DistributionChart.tsx | 76 +++++++++++++++--- .../src/components/SquiggleItem.tsx | 17 +++- .../src/lib/distributionSpecBuilder.ts | 79 +++++++++++++------ 3 files changed, 135 insertions(+), 37 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index af644d29..0b9535b2 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -4,6 +4,7 @@ import { result, distributionError, distributionErrorToString, + squiggleExpression, } from "@quri/squiggle-lang"; import { Vega } from "react-vega"; import { ErrorAlert } from "./Alert"; @@ -23,16 +24,58 @@ export type DistributionPlottingSettings = { showControls: boolean; } & DistributionChartSpecOptions; +export type Plot = { + distributions: Distribution[]; +}; + export type DistributionChartProps = { - distribution: Distribution; + plot: Plot; width?: number; height: number; actions?: boolean; } & DistributionPlottingSettings; +export function defaultPlot(distribution: Distribution): Plot { + return { distributions: [distribution] }; +} +export function makePlot(expression: { + [key: string]: squiggleExpression; +}): Plot | void { + if (expression["distributions"].tag === "array") { + let distributions: Distribution[] = expression["distributions"].value + .map((x) => { + if (x.tag === "distribution") { + return x.value; + } + }) + .filter((x): x is Distribution => x !== undefined); + return { distributions }; + } +} +function all(arr: boolean[]): boolean { + return arr.reduce((x, y) => x && y, true); +} + +function flattenResult(x: result[]): result { + if (x.length === 0) { + return { tag: "Ok", value: [] }; + } else { + if (x[0].tag === "Error") { + return x[0]; + } else { + let rest = flattenResult(x.splice(1)); + if (rest.tag === "Error") { + return rest; + } else { + return { tag: "Ok", value: [x[0].value].concat(rest.value) }; + } + } + } +} + export const DistributionChart: React.FC = (props) => { const { - distribution, + plot, height, showSummary, width, @@ -47,19 +90,23 @@ export const DistributionChart: React.FC = (props) => { React.useEffect(() => setLogX(logX), [logX]); React.useEffect(() => setExpY(expY), [expY]); - const shape = distribution.pointSet(); const [sized] = useSize((size) => { - if (shape.tag === "Error") { + let shapes = flattenResult(plot.distributions.map((x) => x.pointSet())); + if (shapes.tag === "Error") { return ( - {distributionErrorToString(shape.value)} + {distributionErrorToString(shapes.value)} ); } - const massBelow0 = - shape.value.continuous.some((x) => x.x <= 0) || - shape.value.discrete.some((x) => x.x <= 0); + const massBelow0 = all( + shapes.value.map( + (shape) => + shape.continuous.some((x) => x.x <= 0) || + shape.discrete.some((x) => x.x <= 0) + ) + ); const spec = buildVegaSpec(props); let widthProp = width ? width : size.width; @@ -69,13 +116,20 @@ export const DistributionChart: React.FC = (props) => { ); widthProp = 20; } + let continuousPoints = shapes.value.flatMap((shape, i) => + shape.continuous.map((point) => ({ ...point, name: i + 1 })) + ); + let discretePoints = shapes.value.flatMap((shape, i) => + shape.discrete.map((point) => ({ ...point, name: i + 1 })) + ); + console.log(continuousPoints); return (
{!(isLogX && massBelow0) ? ( = (props) => { )}
- {showSummary && } + {showSummary && plot.distributions.length == 1 && ( + + )}
{showControls && (
diff --git a/packages/components/src/components/SquiggleItem.tsx b/packages/components/src/components/SquiggleItem.tsx index 48a8a0fb..09b9fa27 100644 --- a/packages/components/src/components/SquiggleItem.tsx +++ b/packages/components/src/components/SquiggleItem.tsx @@ -8,6 +8,8 @@ import { NumberShower } from "./NumberShower"; import { DistributionChart, DistributionPlottingSettings, + makePlot, + defaultPlot, } from "./DistributionChart"; import { FunctionChart, FunctionChartSettings } from "./FunctionChart"; @@ -102,7 +104,7 @@ export const SquiggleItem: React.FC = ({
{expression.value.toString()}
) : null} = ({ ); case "record": + let plot = makePlot(expression.value); + if (plot) { + return ( + + ); + } return (
@@ -246,7 +259,7 @@ export const SquiggleItem: React.FC = ({
{Object.entries(expression.value) - .filter(([key, r]) => key !== "Math") + .filter(([key, _]) => key !== "Math") .map(([key, r]) => (
diff --git a/packages/components/src/lib/distributionSpecBuilder.ts b/packages/components/src/lib/distributionSpecBuilder.ts index 4286dbdb..515a1b9f 100644 --- a/packages/components/src/lib/distributionSpecBuilder.ts +++ b/packages/components/src/lib/distributionSpecBuilder.ts @@ -137,7 +137,21 @@ export function buildVegaSpec( }, ], signals: [], - scales: [xScale, expY ? expYScale : linearYScale], + scales: [ + xScale, + expY ? expYScale : linearYScale, + { + name: "color", + type: "ordinal", + domain: { + fields: [ + { data: "con", field: "name" }, + { data: "dis", field: "name" }, + ], + }, + range: { scheme: "category20b" }, + }, + ], axes: [ { orient: "bottom", @@ -153,33 +167,48 @@ export function buildVegaSpec( ], marks: [ { - type: "area", + name: "group", + type: "group", from: { - data: "con", - }, - encode: { - update: { - interpolate: { value: "linear" }, - x: { - scale: "xscale", - field: "x", - }, - y: { - scale: "yscale", - field: "y", - }, - y2: { - scale: "yscale", - value: 0, - }, - fill: { - value: color, - }, - fillOpacity: { - value: 1, - }, + facet: { + name: "faceted_path_main", + data: "con", + groupby: ["name"], }, }, + marks: [ + { + name: "distribution_charts", + type: "area", + from: { + data: "faceted_path_main", + }, + encode: { + update: { + interpolate: { value: "linear" }, + x: { + scale: "xscale", + field: "x", + }, + y: { + scale: "yscale", + field: "y", + }, + y2: { + scale: "yscale", + value: 0, + }, + fill: { + field: "name", + scale: "color", + }, + fillOpacity: { + value: 1, + }, + }, + }, + }, + ], }, { type: "rect", From 98ae0459c96765126e530918ab1e8494bc870fd1 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Wed, 13 Jul 2022 14:15:07 +1000 Subject: [PATCH 002/102] Refactor specification to include discrete --- .../src/components/DistributionChart.tsx | 48 +++- .../src/components/FunctionChart1Dist.tsx | 3 +- .../src/lib/distributionSpecBuilder.ts | 267 ++++++++---------- 3 files changed, 157 insertions(+), 161 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 0b9535b2..f1253629 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -5,6 +5,7 @@ import { distributionError, distributionErrorToString, squiggleExpression, + resultMap, } from "@quri/squiggle-lang"; import { Vega } from "react-vega"; import { ErrorAlert } from "./Alert"; @@ -24,8 +25,10 @@ export type DistributionPlottingSettings = { showControls: boolean; } & DistributionChartSpecOptions; +export type LabeledDistribution = { name: string; distribution: Distribution }; + export type Plot = { - distributions: Distribution[]; + distributions: LabeledDistribution[]; }; export type DistributionChartProps = { @@ -36,19 +39,29 @@ export type DistributionChartProps = { } & DistributionPlottingSettings; export function defaultPlot(distribution: Distribution): Plot { - return { distributions: [distribution] }; + return { distributions: [{ name: "default", distribution }] }; } + export function makePlot(expression: { [key: string]: squiggleExpression; }): Plot | void { if (expression["distributions"].tag === "array") { - let distributions: Distribution[] = expression["distributions"].value + let distributions: LabeledDistribution[] = expression["distributions"].value .map((x) => { - if (x.tag === "distribution") { - return x.value; + if ( + x.tag === "record" && + x.value["name"] && + x.value["name"].tag === "string" && + x.value["distribution"] && + x.value["distribution"].tag === "distribution" + ) { + return { + name: x.value["name"].value, + distribution: x.value["distribution"].value, + }; } }) - .filter((x): x is Distribution => x !== undefined); + .filter((x): x is LabeledDistribution => x !== undefined); return { distributions }; } } @@ -91,7 +104,15 @@ export const DistributionChart: React.FC = (props) => { React.useEffect(() => setExpY(expY), [expY]); const [sized] = useSize((size) => { - let shapes = flattenResult(plot.distributions.map((x) => x.pointSet())); + let shapes = flattenResult( + plot.distributions.map((x) => + resultMap(x.distribution.pointSet(), (shape) => ({ + name: x.name, + continuous: shape.continuous, + discrete: shape.discrete, + })) + ) + ); if (shapes.tag === "Error") { return ( @@ -116,20 +137,17 @@ export const DistributionChart: React.FC = (props) => { ); widthProp = 20; } - let continuousPoints = shapes.value.flatMap((shape, i) => - shape.continuous.map((point) => ({ ...point, name: i + 1 })) - ); - let discretePoints = shapes.value.flatMap((shape, i) => - shape.discrete.map((point) => ({ ...point, name: i + 1 })) + const domain = shapes.value.flatMap((shape) => + shape.discrete.concat(shape.continuous) ); + console.log(shapes.value); - console.log(continuousPoints); return (
{!(isLogX && massBelow0) ? ( = (props) => { )}
{showSummary && plot.distributions.length == 1 && ( - + )}
{showControls && ( diff --git a/packages/components/src/components/FunctionChart1Dist.tsx b/packages/components/src/components/FunctionChart1Dist.tsx index 650d2753..3b203de5 100644 --- a/packages/components/src/components/FunctionChart1Dist.tsx +++ b/packages/components/src/components/FunctionChart1Dist.tsx @@ -16,6 +16,7 @@ import * as percentilesSpec from "../vega-specs/spec-percentiles.json"; import { DistributionChart, DistributionPlottingSettings, + defaultPlot, } from "./DistributionChart"; import { NumberShower } from "./NumberShower"; import { ErrorAlert } from "./Alert"; @@ -177,7 +178,7 @@ export const FunctionChart1Dist: React.FC = ({ let showChart = mouseItem.tag === "Ok" && mouseItem.value.tag === "distribution" ? ( Date: Wed, 13 Jul 2022 15:29:39 +1000 Subject: [PATCH 003/102] Make parser of distributions stricter --- .../src/components/DistributionChart.tsx | 116 +++++++++++++++--- 1 file changed, 97 insertions(+), 19 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index f1253629..b8310609 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -42,27 +42,105 @@ export function defaultPlot(distribution: Distribution): Plot { return { distributions: [{ name: "default", distribution }] }; } -export function makePlot(expression: { +function error(err: b): result { + return { tag: "Error", value: err }; +} + +function ok(x: a): result { + return { tag: "Ok", value: x }; +} + +function parseString(expr: squiggleExpression): result { + if (expr.tag === "string") { + return ok(expr.value); + } else { + return error("Expression was not string"); + } +} + +function parseRecord( + expr: squiggleExpression +): result<{ [key: string]: squiggleExpression }, string> { + if (expr.tag === "record") { + return ok(expr.value); + } else { + return error("Expression was not a record"); + } +} + +function parseDistribution( + expr: squiggleExpression +): result { + if (expr.tag === "distribution") { + return ok(expr.value); + } else { + return error("Expression was not a distribution"); + } +} + +function parseArray( + expr: squiggleExpression +): result { + if (expr.tag === "array") { + return ok(expr.value); + } else { + return error("Expression was not a distribution"); + } +} + +function parseField( + record: { [key: string]: squiggleExpression }, + field: string, + parser: (expr: squiggleExpression) => result +): result { + if (record[field]) { + return parser(record[field]); + } else { + return error("record does not have field " + field); + } +} + +function resultBind( + x: result, + fn: (y: a) => result +): result { + if (x.tag === "Ok") { + return fn(x.value); + } else { + return x; + } +} + +function parseLabeledDistribution( + x: squiggleExpression +): result { + return resultBind(parseRecord(x), (record) => + resultBind(parseField(record, "name", parseString), (name) => + resultBind( + parseField(record, "distribution", parseDistribution), + (distribution) => ok({ name, distribution }) + ) + ) + ); +} + +function parsePlot(record: { + [key: string]: squiggleExpression; +}): result { + return resultBind(parseField(record, "distributions", parseArray), (array) => + resultBind( + flattenResult(array.map(parseLabeledDistribution)), + (distributions) => ok({ distributions }) + ) + ); +} + +export function makePlot(record: { [key: string]: squiggleExpression; }): Plot | void { - if (expression["distributions"].tag === "array") { - let distributions: LabeledDistribution[] = expression["distributions"].value - .map((x) => { - if ( - x.tag === "record" && - x.value["name"] && - x.value["name"].tag === "string" && - x.value["distribution"] && - x.value["distribution"].tag === "distribution" - ) { - return { - name: x.value["name"].value, - distribution: x.value["distribution"].value, - }; - } - }) - .filter((x): x is LabeledDistribution => x !== undefined); - return { distributions }; + const plotResult = parsePlot(record); + if (plotResult.tag == "Ok") { + return plotResult.value; } } function all(arr: boolean[]): boolean { From 0c7ac98aaf1e9055b434cc526ab87fd9a79441ce Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Wed, 13 Jul 2022 15:32:28 +1000 Subject: [PATCH 004/102] Color discrete components of distributions --- packages/components/src/lib/distributionSpecBuilder.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/components/src/lib/distributionSpecBuilder.ts b/packages/components/src/lib/distributionSpecBuilder.ts index 36f298d2..229e9ffe 100644 --- a/packages/components/src/lib/distributionSpecBuilder.ts +++ b/packages/components/src/lib/distributionSpecBuilder.ts @@ -213,6 +213,10 @@ export function buildVegaSpec( scale: "yscale", value: 0, }, + fill: { + scale: "color", + field: { parent: "name" }, + }, }, }, }, @@ -240,6 +244,10 @@ export function buildVegaSpec( scale: "yscale", field: "y", }, + fill: { + scale: "color", + field: { parent: "name" }, + }, }, }, }, From a5a131daf15766c50bde4df2802cdf05446a4893 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Wed, 13 Jul 2022 15:33:38 +1000 Subject: [PATCH 005/102] Remove console.log --- packages/components/src/components/DistributionChart.tsx | 1 - packages/components/src/components/SquigglePlayground.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index b8310609..6d4e7c55 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -218,7 +218,6 @@ export const DistributionChart: React.FC = (props) => { const domain = shapes.value.flatMap((shape) => shape.discrete.concat(shape.continuous) ); - console.log(shapes.value); return (
diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 534be721..d24ba141 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -529,7 +529,6 @@ export const SquigglePlayground: FC = ({ const withoutEditor =
{tabs}
; - console.log(vars); return ( From 9cc000070b4544e97873e077f6bd5d2350c554eb Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Wed, 13 Jul 2022 15:54:45 +1000 Subject: [PATCH 006/102] Refactor parsing to lib files --- .../src/components/DistributionChart.tsx | 121 +----------------- packages/components/src/lib/plotting.ts | 90 +++++++++++++ packages/components/src/lib/utility.ts | 33 +++++ 3 files changed, 125 insertions(+), 119 deletions(-) create mode 100644 packages/components/src/lib/plotting.ts create mode 100644 packages/components/src/lib/utility.ts diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 6d4e7c55..7556da26 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -17,6 +17,8 @@ import { DistributionChartSpecOptions, } from "../lib/distributionSpecBuilder"; import { NumberShower } from "./NumberShower"; +import { Plot, parsePlot } from "../lib/plotting"; +import { flattenResult, all } from "../lib/utility"; export type DistributionPlottingSettings = { /** Whether to show a summary of means, stdev, percentiles etc */ @@ -25,12 +27,6 @@ export type DistributionPlottingSettings = { showControls: boolean; } & DistributionChartSpecOptions; -export type LabeledDistribution = { name: string; distribution: Distribution }; - -export type Plot = { - distributions: LabeledDistribution[]; -}; - export type DistributionChartProps = { plot: Plot; width?: number; @@ -42,99 +38,6 @@ export function defaultPlot(distribution: Distribution): Plot { return { distributions: [{ name: "default", distribution }] }; } -function error(err: b): result { - return { tag: "Error", value: err }; -} - -function ok(x: a): result { - return { tag: "Ok", value: x }; -} - -function parseString(expr: squiggleExpression): result { - if (expr.tag === "string") { - return ok(expr.value); - } else { - return error("Expression was not string"); - } -} - -function parseRecord( - expr: squiggleExpression -): result<{ [key: string]: squiggleExpression }, string> { - if (expr.tag === "record") { - return ok(expr.value); - } else { - return error("Expression was not a record"); - } -} - -function parseDistribution( - expr: squiggleExpression -): result { - if (expr.tag === "distribution") { - return ok(expr.value); - } else { - return error("Expression was not a distribution"); - } -} - -function parseArray( - expr: squiggleExpression -): result { - if (expr.tag === "array") { - return ok(expr.value); - } else { - return error("Expression was not a distribution"); - } -} - -function parseField
( - record: { [key: string]: squiggleExpression }, - field: string, - parser: (expr: squiggleExpression) => result -): result { - if (record[field]) { - return parser(record[field]); - } else { - return error("record does not have field " + field); - } -} - -function resultBind( - x: result, - fn: (y: a) => result -): result { - if (x.tag === "Ok") { - return fn(x.value); - } else { - return x; - } -} - -function parseLabeledDistribution( - x: squiggleExpression -): result { - return resultBind(parseRecord(x), (record) => - resultBind(parseField(record, "name", parseString), (name) => - resultBind( - parseField(record, "distribution", parseDistribution), - (distribution) => ok({ name, distribution }) - ) - ) - ); -} - -function parsePlot(record: { - [key: string]: squiggleExpression; -}): result { - return resultBind(parseField(record, "distributions", parseArray), (array) => - resultBind( - flattenResult(array.map(parseLabeledDistribution)), - (distributions) => ok({ distributions }) - ) - ); -} - export function makePlot(record: { [key: string]: squiggleExpression; }): Plot | void { @@ -143,26 +46,6 @@ export function makePlot(record: { return plotResult.value; } } -function all(arr: boolean[]): boolean { - return arr.reduce((x, y) => x && y, true); -} - -function flattenResult(x: result[]): result { - if (x.length === 0) { - return { tag: "Ok", value: [] }; - } else { - if (x[0].tag === "Error") { - return x[0]; - } else { - let rest = flattenResult(x.splice(1)); - if (rest.tag === "Error") { - return rest; - } else { - return { tag: "Ok", value: [x[0].value].concat(rest.value) }; - } - } - } -} export const DistributionChart: React.FC = (props) => { const { diff --git a/packages/components/src/lib/plotting.ts b/packages/components/src/lib/plotting.ts new file mode 100644 index 00000000..5b7ca31d --- /dev/null +++ b/packages/components/src/lib/plotting.ts @@ -0,0 +1,90 @@ +import { Distribution, result, squiggleExpression } from "@quri/squiggle-lang"; +import { flattenResult, resultBind } from "./utility"; + +export type LabeledDistribution = { name: string; distribution: Distribution }; + +export type Plot = { + distributions: LabeledDistribution[]; +}; + +function error(err: b): result { + return { tag: "Error", value: err }; +} + +function ok(x: a): result { + return { tag: "Ok", value: x }; +} + +function parseString(expr: squiggleExpression): result { + if (expr.tag === "string") { + return ok(expr.value); + } else { + return error("Expression was not string"); + } +} + +function parseRecord( + expr: squiggleExpression +): result<{ [key: string]: squiggleExpression }, string> { + if (expr.tag === "record") { + return ok(expr.value); + } else { + return error("Expression was not a record"); + } +} + +function parseDistribution( + expr: squiggleExpression +): result { + if (expr.tag === "distribution") { + return ok(expr.value); + } else { + return error("Expression was not a distribution"); + } +} + +function parseArray( + expr: squiggleExpression +): result { + if (expr.tag === "array") { + return ok(expr.value); + } else { + return error("Expression was not a distribution"); + } +} + +function parseField( + record: { [key: string]: squiggleExpression }, + field: string, + parser: (expr: squiggleExpression) => result +): result { + if (record[field]) { + return parser(record[field]); + } else { + return error("record does not have field " + field); + } +} + +function parseLabeledDistribution( + x: squiggleExpression +): result { + return resultBind(parseRecord(x), (record) => + resultBind(parseField(record, "name", parseString), (name) => + resultBind( + parseField(record, "distribution", parseDistribution), + (distribution) => ok({ name, distribution }) + ) + ) + ); +} + +export function parsePlot(record: { + [key: string]: squiggleExpression; +}): result { + return resultBind(parseField(record, "distributions", parseArray), (array) => + resultBind( + flattenResult(array.map(parseLabeledDistribution)), + (distributions) => ok({ distributions }) + ) + ); +} diff --git a/packages/components/src/lib/utility.ts b/packages/components/src/lib/utility.ts new file mode 100644 index 00000000..4a5ecc6b --- /dev/null +++ b/packages/components/src/lib/utility.ts @@ -0,0 +1,33 @@ +import { result } from "@quri/squiggle-lang"; + +export function flattenResult(x: result[]): result { + if (x.length === 0) { + return { tag: "Ok", value: [] }; + } else { + if (x[0].tag === "Error") { + return x[0]; + } else { + let rest = flattenResult(x.splice(1)); + if (rest.tag === "Error") { + return rest; + } else { + return { tag: "Ok", value: [x[0].value].concat(rest.value) }; + } + } + } +} + +export function resultBind( + x: result, + fn: (y: a) => result +): result { + if (x.tag === "Ok") { + return fn(x.value); + } else { + return x; + } +} + +export function all(arr: boolean[]): boolean { + return arr.reduce((x, y) => x && y, true); +} From ad1d391f49d5ba34f11cfd41aadf06d746ea946c Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Thu, 14 Jul 2022 16:36:12 +1000 Subject: [PATCH 007/102] Rename plotting to plotParser --- packages/components/src/components/DistributionChart.tsx | 2 +- packages/components/src/lib/{plotting.ts => plotParser.ts} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/components/src/lib/{plotting.ts => plotParser.ts} (100%) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 7556da26..f3f84adf 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -17,7 +17,7 @@ import { DistributionChartSpecOptions, } from "../lib/distributionSpecBuilder"; import { NumberShower } from "./NumberShower"; -import { Plot, parsePlot } from "../lib/plotting"; +import { Plot, parsePlot } from "../lib/plotParser"; import { flattenResult, all } from "../lib/utility"; export type DistributionPlottingSettings = { diff --git a/packages/components/src/lib/plotting.ts b/packages/components/src/lib/plotParser.ts similarity index 100% rename from packages/components/src/lib/plotting.ts rename to packages/components/src/lib/plotParser.ts From fc88b065f583159c98832e7eb1bc8e3dacbe2d43 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 28 Jul 2022 13:42:27 +0200 Subject: [PATCH 008/102] remove unused test file --- .../Reducer_Category_Module_TypeChecker_test.res | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/squiggle-lang/__tests__/Reducer/Reducer_Category/Reducer_Category_Module_TypeChecker_test.res diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Category/Reducer_Category_Module_TypeChecker_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Category/Reducer_Category_Module_TypeChecker_test.res deleted file mode 100644 index b5351787..00000000 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Category/Reducer_Category_Module_TypeChecker_test.res +++ /dev/null @@ -1,4 +0,0 @@ -open Jest -open Expect - -test("todo", () => expect("1")->toBe("1")) From 673331940319978b2bcd3c9648a3a346f885c971 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 28 Jul 2022 21:27:46 +0200 Subject: [PATCH 009/102] switch replacement by type checking --- .../Reducer_Type_switch_replacement_test.res | 123 ++++++++++++++++++ .../Reducer_Dispatch_ChainPiece.res | 19 +++ .../Reducer_Dispatch/Reducer_Dispatch_T.res | 20 +++ .../Reducer_Type/Reducer_Type_Compile.res | 9 ++ .../Reducer_Type/Reducer_Type_TypeChecker.res | 7 + .../ReducerInterface_StdLib.res | 3 +- 6 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res create mode 100644 packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_ChainPiece.res create mode 100644 packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_T.res diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res new file mode 100644 index 00000000..a439bb3c --- /dev/null +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res @@ -0,0 +1,123 @@ +open Jest +open Expect + +module DispatchT = Reducer_Dispatch_T +module Expression = Reducer_Expression +module ExpressionT = Reducer_Expression_T +module TypeCompile = Reducer_Type_Compile +module TypeChecker = Reducer_Type_TypeChecker +open ReducerInterface_InternalExpressionValue + +type errorValue = Reducer_ErrorValue.errorValue + +// Let's build a function to replace switch statements +// In dispatchChainPiece, we execute an return the result of execution if there is a type match. +// Otherwise we return None so that the call chain can continue. +// So we want to build a function like +// dispatchChainPiece = (call: functionCall, environment): option> + +// Now lets make the dispatchChainPiece itself. +// Note that I am not passing the reducer to the dispatchChainPiece as an argument because it is in the context anyway. +// Keep in mind that reducerFn is necessary for map/reduce so dispatchChainPiece should have a reducerFn in context. + +let makeMyDispatchChainPiece = (reducer: ExpressionT.reducerFn): DispatchT.dispatchChainPiece => { + // Let's have a pure implementations + module Implementation = { + let stringConcat = (a: string, b: string): string => Js.String2.concat(a, b) + let arrayConcat = ( + a: Js.Array2.t, + b: Js.Array2.t, + ): Js.Array2.t => Js.Array2.concat(a, b) + let plot = _r => "yey, plotted" + } + + let extractStringString = args => + switch args { + | [IEvString(a), IEvString(b)] => (a, b) + | _ => raise(Reducer_Exception.ImpossibleException("extractStringString developer error")) + } + + let extractArrayArray = args => + switch args { + | [IEvArray(a), IEvArray(b)] => (a, b) + | _ => raise(Reducer_Exception.ImpossibleException("extractArrayArray developer error")) + } + + // Let's bridge the pure implementation to expression values + module Bridge = { + let stringConcat: DispatchT.genericIEvFunction = (args, _environment) => { + let (a, b) = extractStringString(args) + Implementation.stringConcat(a, b)->IEvString->Ok + } + let arrayConcat: DispatchT.genericIEvFunction = (args, _environment) => { + let (a, b) = extractArrayArray(args) + Implementation.arrayConcat(a, b)->IEvArray->Ok + } + let plot: DispatchT.genericIEvFunction = (args, _environment) => { + switch args { + // Just assume that we are doing the business of extracting and converting the deep record + | [IEvRecord(_)] => Implementation.plot({"title": "This is a plot"})->IEvString->Ok + | _ => raise(Reducer_Exception.ImpossibleException("plot developer error")) + } + } + } + + // concat functions are to illustrate polymoprhism. And the plot function is to illustrate complex types + let jumpTable = [ + ( + "concat", + TypeCompile.fromTypeExpressionExn("string=>string=>string", reducer), + Bridge.stringConcat, + ), + ( + "concat", + TypeCompile.fromTypeExpressionExn("[any]=>[any]=>[any]", reducer), + Bridge.arrayConcat, + ), + ( + "plot", + TypeCompile.fromTypeExpressionExn( + // Nested complex types are available + // records {property: type} + // arrays [type] + // tuples [type, type] + // <- type contracts are available naturally and they become part of dispatching + // Here we are not enumerating the possibilities because type checking has a dedicated test + "{title: string, line: {width: number, color: string}}=>string", + reducer, + ), + Bridge.plot, + ), + ] + + //Here we are creating a dispatchChainPiece function that will do the actual dispatch from the jumpTable + Reducer_Dispatch_ChainPiece.makeFromTypes(jumpTable) +} + +// And finally, let's write a library dispatch for our external library +// Exactly the same as the one used in real life +let _dispatch = ( + call: functionCall, + environment, + reducer: Reducer_Expression_T.reducerFn, + chain, +): result => { + let dispatchChainPiece = makeMyDispatchChainPiece(reducer) + dispatchChainPiece(call, environment)->E.O2.default(chain(call, environment, reducer)) +} + +// What is important about this implementation? +// A) Exactly the same function jump table can be used to create type guarded lambda functions +// Guarded lambda functions will be the basis of the next version of Squiggle +// B) Complicated recursive record types are not a problem. + +describe("Type Dispatch", () => { + let reducerFn = Expression.reduceExpression + let dispatchChainPiece = makeMyDispatchChainPiece(reducerFn) + test("stringConcat", () => { + let call: functionCall = ("concat", [IEvString("hello"), IEvString("world")]) + + let result = dispatchChainPiece(call, defaultEnvironment) + expect(result)->toEqual(Some(Ok(IEvString("helloworld")))) + }) +}) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_ChainPiece.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_ChainPiece.res new file mode 100644 index 00000000..6cebfef5 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_ChainPiece.res @@ -0,0 +1,19 @@ +module TypeChecker = Reducer_Type_TypeChecker +module T = Reducer_Dispatch_T +open ReducerInterface_InternalExpressionValue + +type errorValue = Reducer_ErrorValue.errorValue + +let makeFromTypes = jumpTable => { + let dispatchChainPiece: T.dispatchChainPiece = ((fnName, fnArgs): functionCall, environment) => { + let jumpTableEntry = jumpTable->Js.Array2.find(elem => { + let (candidName, candidType, _) = elem + candidName == fnName && TypeChecker.checkITypeArgumentsBool(candidType, fnArgs) + }) + switch jumpTableEntry { + | Some((_, _, bridgeFn)) => bridgeFn(fnArgs, environment)->Some + | _ => None + } + } + dispatchChainPiece +} diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_T.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_T.res new file mode 100644 index 00000000..f6234976 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_T.res @@ -0,0 +1,20 @@ +module InternalExpressionValue = ReducerInterface_InternalExpressionValue +module ExpressionT = Reducer_Expression_T + +// Each piece of the dispatch chain computes the result or returns None so that the chain can continue +type dispatchChainPiece = ( + InternalExpressionValue.functionCall, + InternalExpressionValue.environment, +) => option> + +type dispatchChainPieceWithReducer = ( + InternalExpressionValue.functionCall, + InternalExpressionValue.environment, + ExpressionT.reducerFn, +) => option> + +// This is a switch statement case implementation: get the arguments and compute the result +type genericIEvFunction = ( + array, + InternalExpressionValue.environment, +) => result diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Compile.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Compile.res index 2119ee62..896f4a12 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Compile.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Compile.res @@ -38,3 +38,12 @@ let fromTypeExpression = ( (reducerFn: ExpressionT.reducerFn), )->Belt.Result.map(T.fromIEvValue) } + +let fromTypeExpressionExn = ( + typeExpressionSourceCode: string, + reducerFn: ExpressionT.reducerFn, +): T.t => + switch fromTypeExpression(typeExpressionSourceCode, reducerFn) { + | Ok(value) => value + | _ => `Cannot compile ${typeExpressionSourceCode}`->Reducer_Exception.ImpossibleException->raise + } diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res index e4336df5..fa118079 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res @@ -149,6 +149,13 @@ let checkITypeArguments = (anIType: T.iType, args: array): bool => { + switch checkITypeArguments(anIType, args) { + | Ok(_) => true + | _ => false + } +} + let checkArguments = ( typeExpressionSourceCode: string, args: array, diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res index 6c133332..ec6c4fd4 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res @@ -1,6 +1,7 @@ module Bindings = Reducer_Bindings -let internalStdLib = Bindings.emptyBindings->SquiggleLibrary_Math.makeBindings->SquiggleLibrary_Versions.makeBindings +let internalStdLib = + Bindings.emptyBindings->SquiggleLibrary_Math.makeBindings->SquiggleLibrary_Versions.makeBindings @genType let externalStdLib = internalStdLib->Bindings.toTypeScriptBindings From e1c53c90875ba9b2dd70fa99aeea323774ebd5b3 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 28 Jul 2022 22:25:51 +0200 Subject: [PATCH 010/102] any type any will be depreciated after the implementation of binding type variables --- .../Reducer_Type/Reducer_Type_TypeChecker_test.res | 2 ++ .../Reducer_Type/Reducer_Type_TypeChecker.res | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_test.res index efd9bb18..a3ee2712 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_test.res @@ -68,3 +68,5 @@ myTypeCheckTest(test, "number | string", "1", "Ok") myTypeCheckTest(test, "date | string", "1", "Expected type: (date | string) but got: 1") myTypeCheckTest(test, "number<-min(10)", "10", "Ok") myTypeCheckTest(test, "number<-min(10)", "0", "Expected type: number<-min(10) but got: 0") +myTypeCheckTest(test, "any", "0", "Ok") +myTypeCheckTest(test, "any", "'a'", "Ok") diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res index fa118079..33cbbeca 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res @@ -7,10 +7,15 @@ open InternalExpressionValue let rec isITypeOf = (anIType: T.iType, aValue): result => { let caseTypeIdentifier = (anUpperTypeName, aValue) => { let aTypeName = anUpperTypeName->Js.String2.toLowerCase - let valueTypeName = aValue->valueToValueType->valueTypeToString->Js.String2.toLowerCase - switch aTypeName == valueTypeName { - | true => Ok(true) - | false => T.TypeMismatch(anIType, aValue)->Error + switch aTypeName { + | "any" => Ok(true) + | _ => { + let valueTypeName = aValue->valueToValueType->valueTypeToString->Js.String2.toLowerCase + switch aTypeName == valueTypeName { + | true => Ok(true) + | false => T.TypeMismatch(anIType, aValue)->Error + } + } } } From c6eb69628d67e77a04893b7c2c15f5e35b10925e Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Fri, 29 Jul 2022 05:53:47 +0200 Subject: [PATCH 011/102] merge issue 904 --- .../Reducer_Type/Reducer_Type_switch_replacement_test.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res index a439bb3c..16f0f118 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res @@ -103,7 +103,7 @@ let _dispatch = ( chain, ): result => { let dispatchChainPiece = makeMyDispatchChainPiece(reducer) - dispatchChainPiece(call, environment)->E.O2.default(chain(call, environment, reducer)) + dispatchChainPiece(call, environment)->E.O2.defaultFn(() => chain(call, environment, reducer)) } // What is important about this implementation? From 2aaa43008d0497cc65df19d4fe75865e16c77fcb Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 8 Aug 2022 10:31:05 -0700 Subject: [PATCH 012/102] Very simple implementation of pointset mapY --- .../FunctionRegistry/Library/FR_Pointset.res | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res index 4f4e1731..c0270e48 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -23,6 +23,31 @@ let inputsTodist = (inputs: array, makeDist) => { expressionValue } +module Internal = { + type t = PointSetDist.t + + let toType = (r): result< + ReducerInterface_InternalExpressionValue.t, + Reducer_ErrorValue.errorValue, + > => + switch r { + | Ok(r) => Ok(Wrappers.evDistribution(PointSet(r))) + | Error(err) => Error(REOperationError(err)) + } + + let doLambdaCall = (aLambdaValue, list, environment, reducer) => + switch Reducer_Expression_Lambda.doLambdaCall(aLambdaValue, list, environment, reducer) { + | Ok(IEvNumber(f)) => Ok(f) + | _ => Error(Operation.SampleMapNeedsNtoNFunction) + } + + let mapY = (pointSetDist: t, aLambdaValue, env, reducer) => { + let fn = r => doLambdaCall(aLambdaValue, list{IEvNumber(r)}, env, reducer) + let foo = PointSetDist.T.mapYResult(~fn, pointSetDist) + foo->toType + } +} + let library = [ Function.make( ~name="fromDist", @@ -53,6 +78,26 @@ let library = [ ], (), ), + Function.make( + ~name="mapY", + ~nameSpace, + ~requiresNamespace=true, + ~examples=[`PointSet.mapY(mx(normal(5,2)), {|x| x + 1})`], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="mapY", + ~inputs=[FRTypeDist, FRTypeLambda], + ~run=(inputs, _, env, reducer) => + switch inputs { + | [IEvDistribution(PointSet(dist)), IEvLambda(lambda)] => Internal.mapY(dist, lambda, env, reducer)->E.R2.errMap(_ => "") + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), Function.make( ~name="makeContinuous", ~nameSpace, From 63e2b1f8c94de8e03f25fcd4555fabf5715fef87 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 9 Aug 2022 11:55:49 -0700 Subject: [PATCH 013/102] Updated npm versions to 0.3.0 --- packages/components/package.json | 2 +- packages/squiggle-lang/package.json | 2 +- yarn.lock | 107 ++++++++++++++++++++++++++-- 3 files changed, 102 insertions(+), 9 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 0ffbed0a..05e4cd88 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@quri/squiggle-components", - "version": "0.2.24", + "version": "0.3.0", "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^1.0.0", diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index bdedfd6e..a94197f8 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -1,6 +1,6 @@ { "name": "@quri/squiggle-lang", - "version": "0.2.11", + "version": "0.3.0", "homepage": "https://squiggle-language.com", "license": "MIT", "scripts": { diff --git a/yarn.lock b/yarn.lock index 6accd635..05a625a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2188,11 +2188,23 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@floating-ui/core@^0.7.3": + version "0.7.3" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-0.7.3.tgz#d274116678ffae87f6b60e90f88cc4083eefab86" + integrity sha512-buc8BXHmG9l82+OQXOFU3Kr2XQx9ys01U/Q9HMIrZ300iLc8HLMgh7dcCqgYzAzf4BkoQvDcXf5Y+CuEZ5JBYg== + "@floating-ui/core@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.0.0.tgz#ec1d31f54c72dd0460276e2149e59bd13c0f01f6" integrity sha512-sm3nW0hHAxTv3gRDdCH8rNVQxijF+qPFo5gAeXCErRjKC7Qc28lIQ3R9Vd7Gw+KgwfA7RhRydDFuGeI0peGq7A== +"@floating-ui/dom@^0.5.3": + version "0.5.4" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-0.5.4.tgz#4eae73f78bcd4bd553ae2ade30e6f1f9c73fe3f1" + integrity sha512-419BMceRLq0RrmTSDxn8hf9R3VCJv2K9PUfugh5JyEFmdjzDo+e8U5EdR8nzKq8Yj1htzLm3b6eQEEam3/rrtg== + dependencies: + "@floating-ui/core" "^0.7.3" + "@floating-ui/dom@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.0.0.tgz#66923a56755b6cb7a5958ecf25fe293912672d65" @@ -2200,6 +2212,15 @@ dependencies: "@floating-ui/core" "^1.0.0" +"@floating-ui/react-dom-interactions@^0.6.6": + version "0.6.6" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.6.6.tgz#8542e8c4bcbee2cd0d512de676c6a493e0a2d168" + integrity sha512-qnao6UPjSZNHnXrF+u4/n92qVroQkx0Umlhy3Avk1oIebm/5ee6yvDm4xbHob0OjY7ya8WmUnV3rQlPwX3Atwg== + dependencies: + "@floating-ui/react-dom" "^0.7.2" + aria-hidden "^1.1.3" + use-isomorphic-layout-effect "^1.1.1" + "@floating-ui/react-dom-interactions@^0.9.1": version "0.9.1" resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.9.1.tgz#93f17ed89b664795251ce5a2f228c50fc8ada059" @@ -2208,6 +2229,14 @@ "@floating-ui/react-dom" "^1.0.0" aria-hidden "^1.1.3" +"@floating-ui/react-dom@^0.7.2": + version "0.7.2" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-0.7.2.tgz#0bf4ceccb777a140fc535c87eb5d6241c8e89864" + integrity sha512-1T0sJcpHgX/u4I1OzIEhlcrvkUN8ln39nz7fMoE/2HDHrPiMFoOGR7++GYyfUmIQHkkrTinaeQsO3XWubjSvGg== + dependencies: + "@floating-ui/dom" "^0.5.3" + use-isomorphic-layout-effect "^1.1.1" + "@floating-ui/react-dom@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-1.0.0.tgz#e0975966694433f1f0abffeee5d8e6bb69b7d16e" @@ -2250,7 +2279,7 @@ resolved "https://registry.yarnpkg.com/@heroicons/react/-/react-1.0.6.tgz#35dd26987228b39ef2316db3b1245c42eb19e324" integrity sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ== -"@hookform/resolvers@^2.9.7": +"@hookform/resolvers@^2.9.6", "@hookform/resolvers@^2.9.7": version "2.9.7" resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.7.tgz#8b257ae67234ce0270e6b044c1a61fb98ec02b4b" integrity sha512-BloehX3MOLwuFEwT4yZnmolPjVmqyn8VsSuodLfazbCIqxBHsQ4qUZsi+bvNNCduRli1AGWFrkDLGD5QoNzsoA== @@ -2654,7 +2683,7 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@motionone/animation@^10.13.1": +"@motionone/animation@^10.12.0", "@motionone/animation@^10.13.1": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.13.2.tgz#174a55a3bac1b6fb314cc1c3627093dc790ae081" integrity sha512-YGWss58IR2X4lOjW89rv1Q+/Nq/QhfltaggI7i8sZTpKC1yUvM+XYDdvlRpWc6dk8LviMBrddBJAlLdbaqeRmw== @@ -2664,6 +2693,18 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" +"@motionone/dom@10.12.0": + version "10.12.0" + resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.12.0.tgz#ae30827fd53219efca4e1150a5ff2165c28351ed" + integrity sha512-UdPTtLMAktHiqV0atOczNYyDd/d8Cf5fFsd1tua03PqTwwCe/6lwhLSQ8a7TbnQ5SN0gm44N1slBfj+ORIhrqw== + dependencies: + "@motionone/animation" "^10.12.0" + "@motionone/generators" "^10.12.0" + "@motionone/types" "^10.12.0" + "@motionone/utils" "^10.12.0" + hey-listen "^1.0.8" + tslib "^2.3.1" + "@motionone/dom@10.13.1": version "10.13.1" resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.13.1.tgz#fc29ea5d12538f21b211b3168e502cfc07a24882" @@ -2684,7 +2725,7 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/generators@^10.13.1": +"@motionone/generators@^10.12.0", "@motionone/generators@^10.13.1": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/generators/-/generators-10.13.2.tgz#dd972195b899e7a556d65bd27fae2fd423055e10" integrity sha512-QMoXV1MXEEhR6D3dct/RMMS1FwJlAsW+kMPbFGzBA4NbweblgeYQCft9DcDAVpV9wIwD6qvlBG9u99sOXLfHiA== @@ -2693,12 +2734,12 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/types@^10.13.0", "@motionone/types@^10.13.2": +"@motionone/types@^10.12.0", "@motionone/types@^10.13.0", "@motionone/types@^10.13.2": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/types/-/types-10.13.2.tgz#c560090d81bd0149e7451aae23ab7af458570363" integrity sha512-yYV4q5v5F0iADhab4wHfqaRJnM/eVtQLjUPhyEcS72aUz/xyOzi09GzD/Gu+K506BDfqn5eULIilUI77QNaqhw== -"@motionone/utils@^10.13.1", "@motionone/utils@^10.13.2": +"@motionone/utils@^10.12.0", "@motionone/utils@^10.13.1", "@motionone/utils@^10.13.2": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/utils/-/utils-10.13.2.tgz#ce79bfe1d133493c217cdc0584960434e065648d" integrity sha512-6Lw5bDA/w7lrPmT/jYWQ76lkHlHs9fl2NZpJ22cVy1kKDdEH+Cl1U6hMTpdphO6VQktQ6v2APngag91WBKLqlA== @@ -2777,6 +2818,44 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== +"@quri/squiggle-components@^0.2.23": + version "0.2.24" + resolved "https://registry.yarnpkg.com/@quri/squiggle-components/-/squiggle-components-0.2.24.tgz#16a2d72fb16f46a0bf71388c85d1238927676923" + integrity sha512-slBGryELfCsM6WX+AwQcqiPPoImLRHNyXZDueL7a+OKEAx09w3pKOqVzLWNGL7+dJe3dF8as9X/Gv1JbbIj5yw== + dependencies: + "@floating-ui/react-dom" "^0.7.2" + "@floating-ui/react-dom-interactions" "^0.6.6" + "@headlessui/react" "^1.6.6" + "@heroicons/react" "^1.0.6" + "@hookform/resolvers" "^2.9.6" + "@quri/squiggle-lang" "^0.2.8" + "@react-hook/size" "^2.1.2" + clsx "^1.2.1" + framer-motion "^6.5.1" + lodash "^4.17.21" + react "^18.1.0" + react-ace "^10.1.0" + react-hook-form "^7.33.1" + react-use "^17.4.0" + react-vega "^7.6.0" + vega "^5.22.1" + vega-embed "^6.21.0" + vega-lite "^5.3.0" + vscode-uri "^3.0.3" + yup "^0.32.11" + +"@quri/squiggle-lang@^0.2.11", "@quri/squiggle-lang@^0.2.8": + version "0.2.12" + resolved "https://registry.yarnpkg.com/@quri/squiggle-lang/-/squiggle-lang-0.2.12.tgz#e8fdb22a84aa75df71c071d1ed4ae5c55f15d447" + integrity sha512-fgv9DLvPlX/TqPSacKSW3GZ5S9H/YwqaMoRdFrn5SJjHnnMh/xJW/9iyzzgOxPCXov9xFeDvL159tkbStMm7vw== + dependencies: + "@rescript/std" "^9.1.4" + "@stdlib/stats" "^0.0.13" + jstat "^1.9.5" + lodash "^4.17.21" + mathjs "^11.0.1" + pdfast "^0.2.0" + "@react-hook/latest@^1.0.2": version "1.0.3" resolved "https://registry.yarnpkg.com/@react-hook/latest/-/latest-1.0.3.tgz#c2d1d0b0af8b69ec6e2b3a2412ba0768ac82db80" @@ -9608,6 +9687,20 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" +framer-motion@^6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-6.5.1.tgz#802448a16a6eb764124bf36d8cbdfa6dd6b931a7" + integrity sha512-o1BGqqposwi7cgDrtg0dNONhkmPsUFDaLcKXigzuTFC5x58mE8iyTazxSudFzmT6MEyJKfjjU8ItoMe3W+3fiw== + dependencies: + "@motionone/dom" "10.12.0" + framesync "6.0.1" + hey-listen "^1.0.8" + popmotion "11.0.3" + style-value-types "5.0.0" + tslib "^2.1.0" + optionalDependencies: + "@emotion/is-prop-valid" "^0.8.2" + framer-motion@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.0.0.tgz#5fb580d0fe5a2a3ec055d2b7b5b57313a96683b7" @@ -15021,7 +15114,7 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -react-hook-form@^7.34.0: +react-hook-form@^7.33.1, react-hook-form@^7.34.0: version "7.34.0" resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.0.tgz#22883b5e014e5c5e35f3061d0e3862153b0df2ec" integrity sha512-s0/TJ09NVlEk2JPp3yit1WnMuPNBXFmUKEQPulgDi9pYBw/ZmmAFHe6AXWq73Y+kp8ye4OcMf0Jv+i/qLPektg== @@ -18092,7 +18185,7 @@ vega-label@~1.2.0: vega-scenegraph "^4.9.2" vega-util "^1.15.2" -vega-lite@^5.4.0: +vega-lite@^5.3.0, vega-lite@^5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.4.0.tgz#d09331e2a1c87843d5865de0fa7704919796ab56" integrity sha512-e/P5iOtBE62WEWZhKP7sLcBd92YS9prfUQafelxoOeloooSSrkUwM/ZDmN5Q5ffByEZTiKfODtnwD6/xKDYUmw== From 80e17be903428b519051a9592e616d20acd41ad2 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 9 Aug 2022 13:53:29 -0700 Subject: [PATCH 014/102] Updated Squiggle components package --- packages/components/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 05e4cd88..370befea 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@quri/squiggle-components", - "version": "0.3.0", + "version": "0.3.1", "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^1.0.0", @@ -8,7 +8,7 @@ "@headlessui/react": "^1.6.6", "@heroicons/react": "^1.0.6", "@hookform/resolvers": "^2.9.7", - "@quri/squiggle-lang": "^0.2.8", + "@quri/squiggle-lang": "^0.3.0", "@react-hook/size": "^2.1.2", "clsx": "^1.2.1", "framer-motion": "^7.0.0", From c288fd58c36a342a3198134ce7027f7cb05096b9 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 9 Aug 2022 13:57:45 -0700 Subject: [PATCH 015/102] versions correction (manual) --- .release-please-manifest.json | 6 +++--- packages/website/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 60a035fb..1f1ac6f3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,7 +1,7 @@ { "packages/cli": "0.0.3", - "packages/components": "0.2.24", - "packages/squiggle-lang": "0.2.11", + "packages/components": "0.3.1", + "packages/squiggle-lang": "0.3.0", "packages/vscode-ext": "0.3.1", - "packages/website": "0.2.1" + "packages/website": "0.3.0" } diff --git a/packages/website/package.json b/packages/website/package.json index 9f21ad98..7bd1f80c 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "squiggle-website", - "version": "0.2.1", + "version": "0.3.0", "private": true, "license": "MIT", "scripts": { From 4aab78b45cd98dce56e5e38de7a48086869aaaa9 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Thu, 11 Aug 2022 12:31:44 +0100 Subject: [PATCH 016/102] Format code --- packages/components/src/components/DistributionChart.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 741e8f6a..50715229 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -46,14 +46,7 @@ export function makePlot(record: { } export const DistributionChart: React.FC = (props) => { - const { - plot, - height, - showSummary, - width, - logX, - actions = false, - } = props; + const { plot, height, showSummary, width, logX, actions = false } = props; const shape = distribution.pointSet(); const [sized] = useSize((size) => { let shapes = flattenResult( From c97d1d457ef69d49c1639b50af98036c8940962a Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Thu, 11 Aug 2022 14:22:55 +0100 Subject: [PATCH 017/102] Remove unneccesary line --- packages/components/src/components/DistributionChart.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 50715229..12f52754 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -47,7 +47,6 @@ export function makePlot(record: { export const DistributionChart: React.FC = (props) => { const { plot, height, showSummary, width, logX, actions = false } = props; - const shape = distribution.pointSet(); const [sized] = useSize((size) => { let shapes = flattenResult( plot.distributions.map((x) => From 70f26a08ba66734aa9f23da6ca81e64ca792a46b Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Sat, 13 Aug 2022 10:52:56 +0100 Subject: [PATCH 018/102] Fix multiple charting --- .../src/components/DistributionChart.tsx | 2 +- .../SquiggleViewer/ExpressionViewer.tsx | 75 ++++++++++++++----- packages/components/src/lib/utility.ts | 4 + 3 files changed, 61 insertions(+), 20 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 12f52754..84bc5fef 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -80,7 +80,7 @@ export const DistributionChart: React.FC = (props) => { return (
- {logX && hasMassBelowZero(shape.value) ? ( + {logX && shapes.value.some(hasMassBelowZero) ? ( Cannot graph distribution with negative values on logarithmic scale. diff --git a/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx b/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx index 9a3e266e..51f8dcb4 100644 --- a/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx +++ b/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx @@ -1,7 +1,7 @@ import React from "react"; import { squiggleExpression, declaration } from "@quri/squiggle-lang"; import { NumberShower } from "../NumberShower"; -import { DistributionChart } from "../DistributionChart"; +import { DistributionChart, defaultPlot, makePlot } from "../DistributionChart"; import { FunctionChart, FunctionChartSettings } from "../FunctionChart"; import clsx from "clsx"; import { VariableBox } from "./VariableBox"; @@ -102,7 +102,7 @@ export const ExpressionViewer: React.FC = ({ {(settings) => { return ( = ({ case "module": { return ( - {(settings) => + {(_) => Object.entries(expression.value) - .filter(([key, r]) => !key.match(/^(Math|System)\./)) + .filter(([key, _]) => !key.match(/^(Math|System)\./)) .map(([key, r]) => ( = ({ ); } case "record": - return ( - - {(settings) => - Object.entries(expression.value).map(([key, r]) => ( - - )) - } - - ); + const plot = makePlot(expression.value); + if (plot) { + return ( + { + let disableLogX = plot.distributions.some((x) => { + let pointSet = x.distribution.pointSet(); + return ( + pointSet.tag === "Ok" && hasMassBelowZero(pointSet.value) + ); + }); + return ( + + ); + }} + > + {(settings) => { + return ( + + ); + }} + + ); + } else { + return ( + + {(_) => + Object.entries(expression.value).map(([key, r]) => ( + + )) + } + + ); + } case "array": return ( - {(settings) => + {(_) => expression.value.map((r, i) => ( ( export function all(arr: boolean[]): boolean { return arr.reduce((x, y) => x && y, true); } + +export function some(arr: boolean[]): boolean { + return arr.reduce((x, y) => x || y, false); +} From b55bd592191e3f47445997bc103b9f6af17650a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:39:20 +0000 Subject: [PATCH 019/102] :arrow_up: Bump @floating-ui/react-dom-interactions from 0.9.1 to 0.9.2 Bumps [@floating-ui/react-dom-interactions](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/react-dom-interactions) from 0.9.1 to 0.9.2. - [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.2/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 370befea..10d70bc0 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.1", + "@floating-ui/react-dom-interactions": "^0.9.2", "@headlessui/react": "^1.6.6", "@heroicons/react": "^1.0.6", "@hookform/resolvers": "^2.9.7", diff --git a/yarn.lock b/yarn.lock index 05a625a3..1e6e67a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2221,10 +2221,10 @@ aria-hidden "^1.1.3" use-isomorphic-layout-effect "^1.1.1" -"@floating-ui/react-dom-interactions@^0.9.1": - version "0.9.1" - resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.9.1.tgz#93f17ed89b664795251ce5a2f228c50fc8ada059" - integrity sha512-LNWB7FvGn/mI4Gw4DKbt/VblEhQOe3LUljBwp6BayFC2hEe+vhUMq2ExPFwMkgpKpoZVQPRYU8ejCKffBY5UMQ== +"@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== dependencies: "@floating-ui/react-dom" "^1.0.0" aria-hidden "^1.1.3" From 5e16c2f76eb02e8d7f9a5bf2729588a4f93f078b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:40:22 +0000 Subject: [PATCH 020/102] :arrow_up: Bump react-hook-form from 7.34.0 to 7.34.1 Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.34.0 to 7.34.1. - [Release notes](https://github.com/react-hook-form/react-hook-form/releases) - [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md) - [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.34.0...v7.34.1) --- updated-dependencies: - dependency-name: react-hook-form 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 370befea..7fe083e9 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -15,7 +15,7 @@ "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", - "react-hook-form": "^7.34.0", + "react-hook-form": "^7.34.1", "react-use": "^17.4.0", "react-vega": "^7.6.0", "vega": "^5.22.1", diff --git a/yarn.lock b/yarn.lock index 05a625a3..06fe74fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15114,10 +15114,10 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -react-hook-form@^7.33.1, react-hook-form@^7.34.0: - version "7.34.0" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.0.tgz#22883b5e014e5c5e35f3061d0e3862153b0df2ec" - integrity sha512-s0/TJ09NVlEk2JPp3yit1WnMuPNBXFmUKEQPulgDi9pYBw/ZmmAFHe6AXWq73Y+kp8ye4OcMf0Jv+i/qLPektg== +react-hook-form@^7.33.1, react-hook-form@^7.34.1: + version "7.34.1" + resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.1.tgz#06cb216daf706bf9ae4969747115afae0d09410d" + integrity sha512-tH7TaZgAURMhjzVE2M/EFmxHz2HdaPMAVs9FXTweNW551VlhXSuVcpcYlkiMZf2zHQiTztupVFpBHJFTma+N7w== react-inspector@^5.1.0: version "5.1.1" From 1d9d24e08c3e8906a19144caa4f83b59ebe6372f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:41:28 +0000 Subject: [PATCH 021/102] :arrow_up: Bump framer-motion from 7.0.0 to 7.1.1 Bumps [framer-motion](https://github.com/framer/motion) from 7.0.0 to 7.1.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.0.0...v7.1.1) --- updated-dependencies: - dependency-name: framer-motion dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 53 +++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 370befea..f385864d 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.0.0", + "framer-motion": "^7.1.1", "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", diff --git a/yarn.lock b/yarn.lock index 05a625a3..5801d936 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9701,17 +9701,17 @@ framer-motion@^6.5.1: optionalDependencies: "@emotion/is-prop-valid" "^0.8.2" -framer-motion@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.0.0.tgz#5fb580d0fe5a2a3ec055d2b7b5b57313a96683b7" - integrity sha512-mOUKle6LouYVP4KLz+cMiNI6fL3qP9hQY4PBaN3E1FyPhcvuAgvs/JPgYktvK5zdRbIRU0gpBsr0CW5hP2KzKA== +framer-motion@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.1.1.tgz#4d56ed18a7cf2c6a1a4a1af5b57714f8e6b52d9e" + integrity sha512-ONFaG7as1GBBYYIqzX8ENVsfa4eh6f7/nSc3QCADAHOaCt1Lh3UdWbQ0+HVGOOORvEW2L99GlCr4wQc0GLddXg== dependencies: "@motionone/dom" "10.13.1" - framesync "6.0.1" + framesync "6.1.2" hey-listen "^1.0.8" - popmotion "11.0.3" - style-value-types "5.1.0" - tslib "^2.1.0" + popmotion "11.0.5" + style-value-types "5.1.2" + tslib "2.4.0" optionalDependencies: "@emotion/is-prop-valid" "^0.8.2" @@ -9722,6 +9722,13 @@ framesync@6.0.1: dependencies: tslib "^2.1.0" +framesync@6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.1.2.tgz#755eff2fb5b8f3b4d2b266dd18121b300aefea27" + integrity sha512-jBTqhX6KaQVDyus8muwZbBeGGP0XgujBRbQ7gM7BRdS3CadCZIHiawyzYLnafYcvZIh5j8WE7cxZKFn7dXhu9g== + dependencies: + tslib "2.4.0" + fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" @@ -13932,6 +13939,16 @@ popmotion@11.0.3: style-value-types "5.0.0" tslib "^2.1.0" +popmotion@11.0.5: + version "11.0.5" + resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-11.0.5.tgz#8e3e014421a0ffa30ecd722564fd2558954e1f7d" + integrity sha512-la8gPM1WYeFznb/JqF4GiTkRRPZsfaj2+kCxqQgr2MJylMmIKUwBfWW8Wa5fml/8gmtlD5yI01MP1QCZPWmppA== + dependencies: + framesync "6.1.2" + hey-listen "^1.0.8" + style-value-types "5.1.2" + tslib "2.4.0" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -16929,13 +16946,13 @@ style-value-types@5.0.0: hey-listen "^1.0.8" tslib "^2.1.0" -style-value-types@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.1.0.tgz#228b02bd9418c57db46c1f450b85577e634a877f" - integrity sha512-DRIfBtjxQ4ztBZpexkFcI+UR7pODC5qLMf2Syt+bH98PAHHRH2tQnzxBuDQlqcAoYar6GzWnj8iAfqfwnEzCiQ== +style-value-types@5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.1.2.tgz#6be66b237bd546048a764883528072ed95713b62" + integrity sha512-Vs9fNreYF9j6W2VvuDTP7kepALi7sk0xtk2Tu8Yxi9UoajJdEVpNpCov0HsLTqXvNGKX+Uv09pkozVITi1jf3Q== dependencies: hey-listen "^1.0.8" - tslib "^2.3.1" + tslib "2.4.0" stylehacks@^5.1.0: version "5.1.0" @@ -17498,16 +17515,16 @@ tsconfig-paths@^4.0.0: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@2.4.0, tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0, tslib@~2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + tslib@^1.0.0, tslib@^1.8.1: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0, tslib@~2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== - tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" From a1e79422a9d179631c10c9523d3243b0780761a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:43:38 +0000 Subject: [PATCH 022/102] :arrow_up: Bump webpack-dev-server from 4.9.3 to 4.10.0 Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.9.3 to 4.10.0. - [Release notes](https://github.com/webpack/webpack-dev-server/releases) - [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.9.3...v4.10.0) --- updated-dependencies: - dependency-name: webpack-dev-server dependency-type: direct:development update-type: version-update:semver-minor ... 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 370befea..7759d781 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -58,7 +58,7 @@ "web-vitals": "^2.1.4", "webpack": "^5.74.0", "webpack-cli": "^4.10.0", - "webpack-dev-server": "^4.9.3" + "webpack-dev-server": "^4.10.0" }, "peerDependencies": { "react": "^16.8.0 || ^17 || ^18", diff --git a/yarn.lock b/yarn.lock index 05a625a3..47239aa8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18676,10 +18676,10 @@ webpack-dev-middleware@^5.3.1: range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@^4.6.0, webpack-dev-server@^4.9.3: - version "4.9.3" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.9.3.tgz#2360a5d6d532acb5410a668417ad549ee3b8a3c9" - integrity sha512-3qp/eoboZG5/6QgiZ3llN8TUzkSpYg1Ko9khWX1h40MIEUNS2mDoIa8aXsPfskER+GbTvs/IJZ1QTBBhhuetSw== +webpack-dev-server@^4.10.0, webpack-dev-server@^4.6.0, webpack-dev-server@^4.9.3: + version "4.10.0" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.10.0.tgz#de270d0009eba050546912be90116e7fd740a9ca" + integrity sha512-7dezwAs+k6yXVFZ+MaL8VnE+APobiO3zvpp3rBHe/HmWQ+avwh0Q3d0xxacOiBybZZ3syTZw9HXzpa3YNbAZDQ== dependencies: "@types/bonjour" "^3.5.9" "@types/connect-history-api-fallback" "^1.3.5" From e7bae5fcb53828c1b8664fba3d2b607069714677 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:44:23 +0000 Subject: [PATCH 023/102] :arrow_up: Bump @types/node from 18.6.4 to 18.7.4 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.6.4 to 18.7.4. - [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-minor ... 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 370befea..e0b366c6 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -39,7 +39,7 @@ "@testing-library/user-event": "^14.4.2", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.182", - "@types/node": "^18.6.4", + "@types/node": "^18.7.4", "@types/react": "^18.0.9", "@types/styled-components": "^5.1.24", "@types/webpack": "^5.28.0", diff --git a/yarn.lock b/yarn.lock index 05a625a3..8322ebdd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4793,10 +4793,10 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@18.x", "@types/node@^18.6.4": - version "18.6.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.4.tgz#fd26723a8a3f8f46729812a7f9b4fc2d1608ed39" - integrity sha512-I4BD3L+6AWiUobfxZ49DlU43gtI+FTHSv9pE2Zekg6KjMpre4ByusaljW3vYSLJrvQ1ck1hUaeVu8HVlY3vzHg== +"@types/node@*", "@types/node@18.x", "@types/node@^18.7.4": + version "18.7.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.4.tgz#95baa50846ae112a7376869d49fec23b2506c69d" + integrity sha512-RzRcw8c0B8LzryWOR4Wj7YOTFXvdYKwvrb6xQQyuDfnlTxwYXGCV5RZ/TEbq5L5kn+w3rliHAUyRcG1RtbmTFg== "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0": version "16.11.41" From 00c6ea7d3e62d7393f6d206b01dc04232caafce5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:44:53 +0000 Subject: [PATCH 024/102] :arrow_up: Bump eslint from 8.21.0 to 8.22.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.21.0 to 8.22.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.21.0...v8.22.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 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index b4e00587..efce7a88 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.32.0", "@typescript-eslint/parser": "^5.32.0", - "eslint": "^8.21.0", + "eslint": "^8.22.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", "typescript": "^4.7.4", diff --git a/yarn.lock b/yarn.lock index 05a625a3..73c07d6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9032,10 +9032,10 @@ eslint-webpack-plugin@^3.1.1: normalize-path "^3.0.0" schema-utils "^3.1.1" -eslint@^8.21.0, eslint@^8.3.0: - version "8.21.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.21.0.tgz#1940a68d7e0573cef6f50037addee295ff9be9ef" - integrity sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA== +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== dependencies: "@eslint/eslintrc" "^1.3.0" "@humanwhocodes/config-array" "^0.10.4" From 39b37960dde3dc5803fc4a884c521f964f35366e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:45:23 +0000 Subject: [PATCH 025/102] :arrow_up: Bump @testing-library/user-event from 14.4.2 to 14.4.3 Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 14.4.2 to 14.4.3. - [Release notes](https://github.com/testing-library/user-event/releases) - [Changelog](https://github.com/testing-library/user-event/blob/main/CHANGELOG.md) - [Commits](https://github.com/testing-library/user-event/compare/v14.4.2...v14.4.3) --- updated-dependencies: - dependency-name: "@testing-library/user-event" 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 370befea..0605696e 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -36,7 +36,7 @@ "@storybook/react": "^6.5.10", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.3.0", - "@testing-library/user-event": "^14.4.2", + "@testing-library/user-event": "^14.4.3", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.182", "@types/node": "^18.6.4", diff --git a/yarn.lock b/yarn.lock index 05a625a3..68d796af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4485,10 +4485,10 @@ "@testing-library/dom" "^8.5.0" "@types/react-dom" "^18.0.0" -"@testing-library/user-event@^14.4.2": - version "14.4.2" - resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.4.2.tgz#d3fb5d24e2d7d019a7d2e9978a8deb90b0aa230b" - integrity sha512-1gVTWtueNimveOjcm2ApFCnCTeky7WqY3EX31/GRKLWyCd+HfH+Gd2l1J8go9FpDNe+0Mx8X4zbQHTg0WWNJwg== +"@testing-library/user-event@^14.4.3": + version "14.4.3" + resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.4.3.tgz#af975e367743fa91989cd666666aec31a8f50591" + integrity sha512-kCUc5MEwaEMakkO5x7aoD+DLi02ehmEM2QCGWvNqAS1dV/fAvORWEjnjsEIvml59M7Y5kCkWN6fCCyPOe8OL6Q== "@tootallnate/once@1": version "1.1.2" From bef4dc91f272b614462aa51affc53761dafc709c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 15:00:01 +0000 Subject: [PATCH 026/102] :arrow_up: Bump @typescript-eslint/parser from 5.32.0 to 5.33.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.32.0 to 5.33.0. - [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.33.0/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, 42 insertions(+), 8 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index efce7a88..106fec41 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.32.0", - "@typescript-eslint/parser": "^5.32.0", + "@typescript-eslint/parser": "^5.33.0", "eslint": "^8.22.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index 3d43b8b0..14437cd8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5094,14 +5094,14 @@ dependencies: "@typescript-eslint/utils" "5.29.0" -"@typescript-eslint/parser@^5.32.0", "@typescript-eslint/parser@^5.5.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.32.0.tgz#1de243443bc6186fb153b9e395b842e46877ca5d" - integrity sha512-IxRtsehdGV9GFQ35IGm5oKKR2OGcazUoiNBxhRV160iF9FoyuXxjY+rIqs1gfnd+4eL98OjeGnMpE7RF/NBb3A== +"@typescript-eslint/parser@^5.33.0", "@typescript-eslint/parser@^5.5.0": + version "5.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.0.tgz#26ec3235b74f0667414613727cb98f9b69dc5383" + integrity sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w== dependencies: - "@typescript-eslint/scope-manager" "5.32.0" - "@typescript-eslint/types" "5.32.0" - "@typescript-eslint/typescript-estree" "5.32.0" + "@typescript-eslint/scope-manager" "5.33.0" + "@typescript-eslint/types" "5.33.0" + "@typescript-eslint/typescript-estree" "5.33.0" debug "^4.3.4" "@typescript-eslint/scope-manager@5.29.0": @@ -5120,6 +5120,14 @@ "@typescript-eslint/types" "5.32.0" "@typescript-eslint/visitor-keys" "5.32.0" +"@typescript-eslint/scope-manager@5.33.0": + version "5.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz#509d7fa540a2c58f66bdcfcf278a3fa79002e18d" + integrity sha512-/Jta8yMNpXYpRDl8EwF/M8It2A9sFJTubDo0ATZefGXmOqlaBffEw0ZbkbQ7TNDK6q55NPHFshGBPAZvZkE8Pw== + dependencies: + "@typescript-eslint/types" "5.33.0" + "@typescript-eslint/visitor-keys" "5.33.0" + "@typescript-eslint/type-utils@5.32.0": version "5.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.32.0.tgz#45a14506fe3fb908600b4cef2f70778f7b5cdc79" @@ -5139,6 +5147,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.32.0.tgz#484273021eeeae87ddb288f39586ef5efeb6dcd8" integrity sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ== +"@typescript-eslint/types@5.33.0": + version "5.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.0.tgz#d41c584831805554b063791338b0220b613a275b" + integrity sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw== + "@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" @@ -5165,6 +5178,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.33.0": + version "5.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz#02d9c9ade6f4897c09e3508c27de53ad6bfa54cf" + integrity sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ== + dependencies: + "@typescript-eslint/types" "5.33.0" + "@typescript-eslint/visitor-keys" "5.33.0" + 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" @@ -5205,6 +5231,14 @@ "@typescript-eslint/types" "5.32.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.33.0": + version "5.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz#fbcbb074e460c11046e067bc3384b5d66b555484" + integrity sha512-/XsqCzD4t+Y9p5wd9HZiptuGKBlaZO5showwqODii5C0nZawxWLF+Q6k5wYHBrQv96h6GYKyqqMHCSTqta8Kiw== + dependencies: + "@typescript-eslint/types" "5.33.0" + 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 7c92808c67ecf2cafc835f946867ee2462f11515 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 15:01:43 +0000 Subject: [PATCH 027/102] :arrow_up: Bump @types/styled-components from 5.1.25 to 5.1.26 Bumps [@types/styled-components](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/styled-components) from 5.1.25 to 5.1.26. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/styled-components) --- updated-dependencies: - dependency-name: "@types/styled-components" 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 810713d4..a82a3718 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -41,7 +41,7 @@ "@types/lodash": "^4.14.182", "@types/node": "^18.7.4", "@types/react": "^18.0.9", - "@types/styled-components": "^5.1.24", + "@types/styled-components": "^5.1.26", "@types/webpack": "^5.28.0", "cross-env": "^7.0.3", "mini-css-extract-plugin": "^2.6.1", diff --git a/yarn.lock b/yarn.lock index 3d43b8b0..d253ac28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4961,10 +4961,10 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== -"@types/styled-components@^5.1.24": - version "5.1.25" - resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-5.1.25.tgz#0177c4ab5fa7c6ed0565d36f597393dae3f380ad" - integrity sha512-fgwl+0Pa8pdkwXRoVPP9JbqF0Ivo9llnmsm+7TCI330kbPIFd9qv1Lrhr37shf4tnxCOSu+/IgqM7uJXLWZZNQ== +"@types/styled-components@^5.1.26": + version "5.1.26" + resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-5.1.26.tgz#5627e6812ee96d755028a98dae61d28e57c233af" + integrity sha512-KuKJ9Z6xb93uJiIyxo/+ksS7yLjS1KzG6iv5i78dhVg/X3u5t1H7juRWqVmodIdz6wGVaIApo1u01kmFRdJHVw== dependencies: "@types/hoist-non-react-statics" "*" "@types/react" "*" From 6bed1cb7de0888faa7893dfbc918f467c720bf2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 17:54:58 +0000 Subject: [PATCH 028/102] :arrow_up: Bump @typescript-eslint/eslint-plugin from 5.32.0 to 5.33.1 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.32.0 to 5.33.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.33.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 | 106 +++++++++++++++---------------- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 106fec41..331861ff 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.32.0", + "@typescript-eslint/eslint-plugin": "^5.33.1", "@typescript-eslint/parser": "^5.33.0", "eslint": "^8.22.0", "glob": "^8.0.3", diff --git a/yarn.lock b/yarn.lock index a5c3fe2b..79d240a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5072,14 +5072,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.32.0", "@typescript-eslint/eslint-plugin@^5.5.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.32.0.tgz#e27e38cffa4a61226327c874a7be965e9a861624" - integrity sha512-CHLuz5Uz7bHP2WgVlvoZGhf0BvFakBJKAD/43Ty0emn4wXWv5k01ND0C0fHcl/Im8Td2y/7h44E9pca9qAu2ew== +"@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== dependencies: - "@typescript-eslint/scope-manager" "5.32.0" - "@typescript-eslint/type-utils" "5.32.0" - "@typescript-eslint/utils" "5.32.0" + "@typescript-eslint/scope-manager" "5.33.1" + "@typescript-eslint/type-utils" "5.33.1" + "@typescript-eslint/utils" "5.33.1" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -5112,14 +5112,6 @@ "@typescript-eslint/types" "5.29.0" "@typescript-eslint/visitor-keys" "5.29.0" -"@typescript-eslint/scope-manager@5.32.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.32.0.tgz#763386e963a8def470580cc36cf9228864190b95" - integrity sha512-KyAE+tUON0D7tNz92p1uetRqVJiiAkeluvwvZOqBmW9z2XApmk5WSMV9FrzOroAcVxJZB3GfUwVKr98Dr/OjOg== - dependencies: - "@typescript-eslint/types" "5.32.0" - "@typescript-eslint/visitor-keys" "5.32.0" - "@typescript-eslint/scope-manager@5.33.0": version "5.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz#509d7fa540a2c58f66bdcfcf278a3fa79002e18d" @@ -5128,12 +5120,20 @@ "@typescript-eslint/types" "5.33.0" "@typescript-eslint/visitor-keys" "5.33.0" -"@typescript-eslint/type-utils@5.32.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.32.0.tgz#45a14506fe3fb908600b4cef2f70778f7b5cdc79" - integrity sha512-0gSsIhFDduBz3QcHJIp3qRCvVYbqzHg8D6bHFsDMrm0rURYDj+skBK2zmYebdCp+4nrd9VWd13egvhYFJj/wZg== +"@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/utils" "5.32.0" + "@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== + dependencies: + "@typescript-eslint/utils" "5.33.1" debug "^4.3.4" tsutils "^3.21.0" @@ -5142,16 +5142,16 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== -"@typescript-eslint/types@5.32.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.32.0.tgz#484273021eeeae87ddb288f39586ef5efeb6dcd8" - integrity sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ== - "@typescript-eslint/types@5.33.0": version "5.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.0.tgz#d41c584831805554b063791338b0220b613a275b" integrity sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw== +"@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/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" @@ -5165,19 +5165,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.32.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.32.0.tgz#282943f34babf07a4afa7b0ff347a8e7b6030d12" - integrity sha512-ZVAUkvPk3ITGtCLU5J4atCw9RTxK+SRc6hXqLtllC2sGSeMFWN+YwbiJR9CFrSFJ3w4SJfcWtDwNb/DmUIHdhg== - dependencies: - "@typescript-eslint/types" "5.32.0" - "@typescript-eslint/visitor-keys" "5.32.0" - 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.33.0": version "5.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz#02d9c9ade6f4897c09e3508c27de53ad6bfa54cf" @@ -5191,6 +5178,19 @@ 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/utils@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.29.0.tgz#775046effd5019667bd086bcf326acbe32cd0082" @@ -5203,15 +5203,15 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/utils@5.32.0", "@typescript-eslint/utils@^5.13.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.32.0.tgz#eccb6b672b94516f1afc6508d05173c45924840c" - integrity sha512-W7lYIAI5Zlc5K082dGR27Fczjb3Q57ECcXefKU/f0ajM5ToM0P+N9NmJWip8GmGu/g6QISNT+K6KYB+iSHjXCQ== +"@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== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.32.0" - "@typescript-eslint/types" "5.32.0" - "@typescript-eslint/typescript-estree" "5.32.0" + "@typescript-eslint/scope-manager" "5.33.1" + "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/typescript-estree" "5.33.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -5223,14 +5223,6 @@ "@typescript-eslint/types" "5.29.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@5.32.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.32.0.tgz#b9715d0b11fdb5dd10fd0c42ff13987470525394" - integrity sha512-S54xOHZgfThiZ38/ZGTgB2rqx51CMJ5MCfVT2IplK4Q7hgzGfe0nLzLCcenDnc/cSjP568hdeKfeDcBgqNHD/g== - dependencies: - "@typescript-eslint/types" "5.32.0" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.33.0": version "5.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz#fbcbb074e460c11046e067bc3384b5d66b555484" @@ -5239,6 +5231,14 @@ "@typescript-eslint/types" "5.33.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" + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" From 127fbe50a287f8a89559a5ca34e65941418b619a Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 18 Aug 2022 15:13:23 -0700 Subject: [PATCH 029/102] docs site: algolia search --- packages/website/docusaurus.config.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index f48ac952..3949e98b 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -52,6 +52,29 @@ const config = { themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ + algolia: { + // The application ID provided by Algolia + appId: "NEUN2KAR5K", + + // Public API key: it is safe to commit it + apiKey: "1f5c74a2d72799add24eb7682531a1b0", + + indexName: "squiggle_docs", + + // Optional: see doc section below + contextualSearch: true, + + // Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them. + // externalUrlRegex: 'external\\.com|domain\\.com', + + // Optional: Algolia search parameters + searchParameters: {}, + + // Optional: path for search page that enabled by default (`false` to disable it) + searchPagePath: "search", + + //... other Algolia params + }, navbar: { title: "Squiggle", hideOnScroll: true, From 61051ffe5fe0f3d9cf16303c9bfb261eaf2869b1 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 29 Jul 2022 18:10:57 +0400 Subject: [PATCH 030/102] multiple plots story --- .../src/stories/SquiggleChart.stories.mdx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/components/src/stories/SquiggleChart.stories.mdx b/packages/components/src/stories/SquiggleChart.stories.mdx index bc289c36..14a3f1fe 100644 --- a/packages/components/src/stories/SquiggleChart.stories.mdx +++ b/packages/components/src/stories/SquiggleChart.stories.mdx @@ -93,6 +93,20 @@ could be continuous, discrete or mixed. +## Multiple plots + + + + {Template.bind({})} + + + ## Constants A constant is a simple number as a result. This has special formatting rules From 7866203ac49c5b07da356b1b27487ad313884688 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 19 Aug 2022 15:17:31 +0400 Subject: [PATCH 031/102] reimplement parsePlot with yup --- packages/components/src/lib/plotParser.ts | 109 ++++++++-------------- 1 file changed, 40 insertions(+), 69 deletions(-) diff --git a/packages/components/src/lib/plotParser.ts b/packages/components/src/lib/plotParser.ts index 5b7ca31d..033ac2a3 100644 --- a/packages/components/src/lib/plotParser.ts +++ b/packages/components/src/lib/plotParser.ts @@ -1,5 +1,5 @@ +import * as yup from "yup"; import { Distribution, result, squiggleExpression } from "@quri/squiggle-lang"; -import { flattenResult, resultBind } from "./utility"; export type LabeledDistribution = { name: string; distribution: Distribution }; @@ -15,76 +15,47 @@ function ok(x: a): result { return { tag: "Ok", value: x }; } -function parseString(expr: squiggleExpression): result { - if (expr.tag === "string") { - return ok(expr.value); - } else { - return error("Expression was not string"); - } -} - -function parseRecord( - expr: squiggleExpression -): result<{ [key: string]: squiggleExpression }, string> { - if (expr.tag === "record") { - return ok(expr.value); - } else { - return error("Expression was not a record"); - } -} - -function parseDistribution( - expr: squiggleExpression -): result { - if (expr.tag === "distribution") { - return ok(expr.value); - } else { - return error("Expression was not a distribution"); - } -} - -function parseArray( - expr: squiggleExpression -): result { - if (expr.tag === "array") { - return ok(expr.value); - } else { - return error("Expression was not a distribution"); - } -} - -function parseField( - record: { [key: string]: squiggleExpression }, - field: string, - parser: (expr: squiggleExpression) => result -): result { - if (record[field]) { - return parser(record[field]); - } else { - return error("record does not have field " + field); - } -} - -function parseLabeledDistribution( - x: squiggleExpression -): result { - return resultBind(parseRecord(x), (record) => - resultBind(parseField(record, "name", parseString), (name) => - resultBind( - parseField(record, "distribution", parseDistribution), - (distribution) => ok({ name, distribution }) - ) - ) - ); -} +const schema = yup + .object() + .strict() + .noUnknown() + .shape({ + distributions: yup.object().shape({ + tag: yup.mixed().oneOf(["array"]), + value: yup + .array() + .of( + yup.object().shape({ + tag: yup.mixed().oneOf(["record"]), + value: yup.object().shape({ + name: yup.object().shape({ + tag: yup.mixed().oneOf(["string"]), + value: yup.string().required(), + }), + distribution: yup.object().shape({ + tag: yup.mixed().oneOf(["distribution"]), + value: yup.mixed(), + }), + }), + }) + ) + .required(), + }), + }); export function parsePlot(record: { [key: string]: squiggleExpression; }): result { - return resultBind(parseField(record, "distributions", parseArray), (array) => - resultBind( - flattenResult(array.map(parseLabeledDistribution)), - (distributions) => ok({ distributions }) - ) - ); + try { + const plotRecord = schema.validateSync(record); + return ok({ + distributions: plotRecord.distributions.value.map((x) => ({ + name: x.value.name.value, + distribution: x.value.distribution.value, + })), + }); + } catch (e) { + const message = e instanceof Error ? e.message : "Unknown error"; + return error(message); + } } From fc29a7211ee3bccbd8c25a40f9d75ace34514caf Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 19 Aug 2022 15:17:41 +0400 Subject: [PATCH 032/102] minor improvements --- packages/components/src/components/DistributionChart.tsx | 2 +- packages/components/src/lib/distributionSpecBuilder.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 84bc5fef..a09e8b69 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -40,7 +40,7 @@ export function makePlot(record: { [key: string]: squiggleExpression; }): Plot | void { const plotResult = parsePlot(record); - if (plotResult.tag == "Ok") { + if (plotResult.tag === "Ok") { return plotResult.value; } } diff --git a/packages/components/src/lib/distributionSpecBuilder.ts b/packages/components/src/lib/distributionSpecBuilder.ts index a0af7f0c..a6aaf915 100644 --- a/packages/components/src/lib/distributionSpecBuilder.ts +++ b/packages/components/src/lib/distributionSpecBuilder.ts @@ -83,7 +83,7 @@ export function buildVegaSpec( let spec: VisualizationSpec = { $schema: "https://vega.github.io/schema/vega/v5.json", - description: "A basic area chart example", + description: "Squiggle plot chart", width: 500, height: 100, padding: 5, From bf02f69acaa6a4dbea6806e5df2ba3f4d13318fd Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 19 Aug 2022 21:14:08 +0400 Subject: [PATCH 033/102] legends, blues colors scheme, remove color setting --- .../src/components/DistributionChart.tsx | 5 ++- .../src/components/SquigglePlayground.tsx | 7 +--- .../SquiggleViewer/ItemSettingsMenu.tsx | 7 +--- .../src/components/ViewSettings.tsx | 12 +----- .../src/lib/distributionSpecBuilder.ts | 42 ++++++++++++++----- packages/components/src/lib/plotParser.ts | 17 ++++++-- .../src/stories/SquiggleChart.stories.mdx | 15 ++++++- 7 files changed, 65 insertions(+), 40 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index a09e8b69..79536e12 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -17,7 +17,7 @@ import { } from "../lib/distributionSpecBuilder"; import { NumberShower } from "./NumberShower"; import { Plot, parsePlot } from "../lib/plotParser"; -import { flattenResult, all } from "../lib/utility"; +import { flattenResult } from "../lib/utility"; import { hasMassBelowZero } from "../lib/distributionUtils"; export type DistributionPlottingSettings = { @@ -52,6 +52,7 @@ export const DistributionChart: React.FC = (props) => { plot.distributions.map((x) => resultMap(x.distribution.pointSet(), (shape) => ({ name: x.name, + // color: x.color, // not supported yet continuous: shape.continuous, discrete: shape.discrete, })) @@ -94,7 +95,7 @@ export const DistributionChart: React.FC = (props) => { /> )}
- {showSummary && plot.distributions.length == 1 && ( + {showSummary && plot.distributions.length === 1 && ( )}
diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 626fc354..c3e38b1a 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -37,10 +37,7 @@ import { InputItem } from "./ui/InputItem"; import { Text } from "./ui/Text"; import { ViewSettings, viewSettingsSchema } from "./ViewSettings"; import { HeadedSection } from "./ui/HeadedSection"; -import { - defaultColor, - defaultTickFormat, -} from "../lib/distributionSpecBuilder"; +import { defaultTickFormat } from "../lib/distributionSpecBuilder"; import { Button } from "./ui/Button"; type PlaygroundProps = SquiggleChartProps & { @@ -240,7 +237,6 @@ export const SquigglePlayground: FC = ({ title, minX, maxX, - color = defaultColor, tickFormat = defaultTickFormat, distributionChartActions, code: controlledCode, @@ -268,7 +264,6 @@ export const SquigglePlayground: FC = ({ title, minX, maxX, - color, tickFormat, distributionChartActions, showSummary, diff --git a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx index 2c26b9aa..49c2eacc 100644 --- a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx +++ b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx @@ -6,10 +6,7 @@ import { Modal } from "../ui/Modal"; import { ViewSettings, viewSettingsSchema } from "../ViewSettings"; import { Path, pathAsString } from "./utils"; import { ViewerContext } from "./ViewerContext"; -import { - defaultColor, - defaultTickFormat, -} from "../../lib/distributionSpecBuilder"; +import { defaultTickFormat } from "../../lib/distributionSpecBuilder"; import { PlaygroundContext } from "../SquigglePlayground"; type Props = { @@ -46,7 +43,6 @@ const ItemSettingsModal: React.FC< tickFormat: mergedSettings.distributionPlotSettings.format || defaultTickFormat, title: mergedSettings.distributionPlotSettings.title, - color: mergedSettings.distributionPlotSettings.color || defaultColor, minX: mergedSettings.distributionPlotSettings.minX, maxX: mergedSettings.distributionPlotSettings.maxX, distributionChartActions: mergedSettings.distributionPlotSettings.actions, @@ -66,7 +62,6 @@ const ItemSettingsModal: React.FC< expY: vars.expY, format: vars.tickFormat, title: vars.title, - color: vars.color, minX: vars.minX, maxX: vars.maxX, actions: vars.distributionChartActions, diff --git a/packages/components/src/components/ViewSettings.tsx b/packages/components/src/components/ViewSettings.tsx index 9a2ce562..7d70bfc8 100644 --- a/packages/components/src/components/ViewSettings.tsx +++ b/packages/components/src/components/ViewSettings.tsx @@ -5,10 +5,7 @@ import { InputItem } from "./ui/InputItem"; import { Checkbox } from "./ui/Checkbox"; import { HeadedSection } from "./ui/HeadedSection"; import { Text } from "./ui/Text"; -import { - defaultColor, - defaultTickFormat, -} from "../lib/distributionSpecBuilder"; +import { defaultTickFormat } from "../lib/distributionSpecBuilder"; export const viewSettingsSchema = yup.object({}).shape({ chartHeight: yup.number().required().positive().integer().default(350), @@ -18,7 +15,6 @@ export const viewSettingsSchema = yup.object({}).shape({ expY: yup.boolean().required(), tickFormat: yup.string().default(defaultTickFormat), title: yup.string(), - color: yup.string().default(defaultColor).required(), minX: yup.number(), maxX: yup.number(), distributionChartActions: yup.boolean(), @@ -114,12 +110,6 @@ export const ViewSettings: React.FC<{ register={register} label="Tick Format" /> -
diff --git a/packages/components/src/lib/distributionSpecBuilder.ts b/packages/components/src/lib/distributionSpecBuilder.ts index a6aaf915..2b3ac952 100644 --- a/packages/components/src/lib/distributionSpecBuilder.ts +++ b/packages/components/src/lib/distributionSpecBuilder.ts @@ -10,8 +10,6 @@ export type DistributionChartSpecOptions = { minX?: number; /** The maximum x coordinate shown on the chart */ maxX?: number; - /** The color of the chart */ - color?: string; /** The title of the chart */ title?: string; /** The formatting of the ticks */ @@ -57,14 +55,12 @@ export let expYScale: PowScale = { }; export const defaultTickFormat = ".9~s"; -export const defaultColor = "#739ECC"; export function buildVegaSpec( specOptions: DistributionChartSpecOptions ): VisualizationSpec { const { format = defaultTickFormat, - color = defaultColor, title, minX, maxX, @@ -106,7 +102,7 @@ export function buildVegaSpec( data: "data", field: "name", }, - range: { scheme: "category10" }, + range: { scheme: "blues" }, }, ], axes: [ @@ -120,6 +116,7 @@ export function buildVegaSpec( domainOpacity: 0.0, format: format, tickCount: 10, + labelOverlap: "greedy", }, ], marks: [ @@ -259,15 +256,38 @@ export function buildVegaSpec( ], }, ], - }; - if (title) { - spec = { - ...spec, + legends: [ + { + fill: "color", + orient: "top", + labelFontSize: 12, + encode: { + symbols: { + update: { + fill: [ + { test: "length(domain('color')) == 1", value: "transparent" }, + { scale: "color", field: "value" }, + ], + }, + }, + labels: { + interactive: true, + update: { + fill: [ + { test: "length(domain('color')) == 1", value: "transparent" }, + { value: "black" }, + ], + }, + }, + }, + }, + ], + ...(title && { title: { text: title, }, - }; - } + }), + }; return spec; } diff --git a/packages/components/src/lib/plotParser.ts b/packages/components/src/lib/plotParser.ts index 033ac2a3..9d5e224a 100644 --- a/packages/components/src/lib/plotParser.ts +++ b/packages/components/src/lib/plotParser.ts @@ -1,7 +1,11 @@ import * as yup from "yup"; import { Distribution, result, squiggleExpression } from "@quri/squiggle-lang"; -export type LabeledDistribution = { name: string; distribution: Distribution }; +export type LabeledDistribution = { + name: string; + distribution: Distribution; + color?: string; +}; export type Plot = { distributions: LabeledDistribution[]; @@ -27,12 +31,18 @@ const schema = yup .of( yup.object().shape({ tag: yup.mixed().oneOf(["record"]), - value: yup.object().shape({ + value: yup.object({ name: yup.object().shape({ tag: yup.mixed().oneOf(["string"]), value: yup.string().required(), }), - distribution: yup.object().shape({ + // color: yup + // .object({ + // tag: yup.mixed().oneOf(["string"]), + // value: yup.string().required(), + // }) + // .default(undefined), + distribution: yup.object({ tag: yup.mixed().oneOf(["distribution"]), value: yup.mixed(), }), @@ -51,6 +61,7 @@ export function parsePlot(record: { return ok({ distributions: plotRecord.distributions.value.map((x) => ({ name: x.value.name.value, + // color: x.value.color?.value, // not supported yet distribution: x.value.distribution.value, })), }); diff --git a/packages/components/src/stories/SquiggleChart.stories.mdx b/packages/components/src/stories/SquiggleChart.stories.mdx index 14a3f1fe..3c272982 100644 --- a/packages/components/src/stories/SquiggleChart.stories.mdx +++ b/packages/components/src/stories/SquiggleChart.stories.mdx @@ -99,7 +99,20 @@ could be continuous, discrete or mixed. From c46845705216da85f93bedec60031c7cf444ef97 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 19 Aug 2022 21:54:29 +0400 Subject: [PATCH 034/102] update squiggle-components version (fixes playground) --- packages/website/package.json | 2 +- yarn.lock | 122 +++------------------------------- 2 files changed, 9 insertions(+), 115 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index 7bd1f80c..53d94c2d 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -15,7 +15,7 @@ "@docusaurus/core": "2.0.1", "@docusaurus/preset-classic": "2.0.1", "@heroicons/react": "^1.0.6", - "@quri/squiggle-components": "^0.2.23", + "@quri/squiggle-components": "^0.3", "base64-js": "^1.5.1", "clsx": "^1.2.1", "hast-util-is-element": "2.1.2", diff --git a/yarn.lock b/yarn.lock index 79d240a0..b341972f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2188,23 +2188,11 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@floating-ui/core@^0.7.3": - version "0.7.3" - resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-0.7.3.tgz#d274116678ffae87f6b60e90f88cc4083eefab86" - integrity sha512-buc8BXHmG9l82+OQXOFU3Kr2XQx9ys01U/Q9HMIrZ300iLc8HLMgh7dcCqgYzAzf4BkoQvDcXf5Y+CuEZ5JBYg== - "@floating-ui/core@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.0.0.tgz#ec1d31f54c72dd0460276e2149e59bd13c0f01f6" integrity sha512-sm3nW0hHAxTv3gRDdCH8rNVQxijF+qPFo5gAeXCErRjKC7Qc28lIQ3R9Vd7Gw+KgwfA7RhRydDFuGeI0peGq7A== -"@floating-ui/dom@^0.5.3": - version "0.5.4" - resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-0.5.4.tgz#4eae73f78bcd4bd553ae2ade30e6f1f9c73fe3f1" - integrity sha512-419BMceRLq0RrmTSDxn8hf9R3VCJv2K9PUfugh5JyEFmdjzDo+e8U5EdR8nzKq8Yj1htzLm3b6eQEEam3/rrtg== - dependencies: - "@floating-ui/core" "^0.7.3" - "@floating-ui/dom@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.0.0.tgz#66923a56755b6cb7a5958ecf25fe293912672d65" @@ -2212,15 +2200,6 @@ dependencies: "@floating-ui/core" "^1.0.0" -"@floating-ui/react-dom-interactions@^0.6.6": - version "0.6.6" - resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.6.6.tgz#8542e8c4bcbee2cd0d512de676c6a493e0a2d168" - integrity sha512-qnao6UPjSZNHnXrF+u4/n92qVroQkx0Umlhy3Avk1oIebm/5ee6yvDm4xbHob0OjY7ya8WmUnV3rQlPwX3Atwg== - dependencies: - "@floating-ui/react-dom" "^0.7.2" - aria-hidden "^1.1.3" - use-isomorphic-layout-effect "^1.1.1" - "@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" @@ -2229,14 +2208,6 @@ "@floating-ui/react-dom" "^1.0.0" aria-hidden "^1.1.3" -"@floating-ui/react-dom@^0.7.2": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-0.7.2.tgz#0bf4ceccb777a140fc535c87eb5d6241c8e89864" - integrity sha512-1T0sJcpHgX/u4I1OzIEhlcrvkUN8ln39nz7fMoE/2HDHrPiMFoOGR7++GYyfUmIQHkkrTinaeQsO3XWubjSvGg== - dependencies: - "@floating-ui/dom" "^0.5.3" - use-isomorphic-layout-effect "^1.1.1" - "@floating-ui/react-dom@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-1.0.0.tgz#e0975966694433f1f0abffeee5d8e6bb69b7d16e" @@ -2279,7 +2250,7 @@ resolved "https://registry.yarnpkg.com/@heroicons/react/-/react-1.0.6.tgz#35dd26987228b39ef2316db3b1245c42eb19e324" integrity sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ== -"@hookform/resolvers@^2.9.6", "@hookform/resolvers@^2.9.7": +"@hookform/resolvers@^2.9.7": version "2.9.7" resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.7.tgz#8b257ae67234ce0270e6b044c1a61fb98ec02b4b" integrity sha512-BloehX3MOLwuFEwT4yZnmolPjVmqyn8VsSuodLfazbCIqxBHsQ4qUZsi+bvNNCduRli1AGWFrkDLGD5QoNzsoA== @@ -2683,7 +2654,7 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@motionone/animation@^10.12.0", "@motionone/animation@^10.13.1": +"@motionone/animation@^10.13.1": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.13.2.tgz#174a55a3bac1b6fb314cc1c3627093dc790ae081" integrity sha512-YGWss58IR2X4lOjW89rv1Q+/Nq/QhfltaggI7i8sZTpKC1yUvM+XYDdvlRpWc6dk8LviMBrddBJAlLdbaqeRmw== @@ -2693,18 +2664,6 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/dom@10.12.0": - version "10.12.0" - resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.12.0.tgz#ae30827fd53219efca4e1150a5ff2165c28351ed" - integrity sha512-UdPTtLMAktHiqV0atOczNYyDd/d8Cf5fFsd1tua03PqTwwCe/6lwhLSQ8a7TbnQ5SN0gm44N1slBfj+ORIhrqw== - dependencies: - "@motionone/animation" "^10.12.0" - "@motionone/generators" "^10.12.0" - "@motionone/types" "^10.12.0" - "@motionone/utils" "^10.12.0" - hey-listen "^1.0.8" - tslib "^2.3.1" - "@motionone/dom@10.13.1": version "10.13.1" resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.13.1.tgz#fc29ea5d12538f21b211b3168e502cfc07a24882" @@ -2725,7 +2684,7 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/generators@^10.12.0", "@motionone/generators@^10.13.1": +"@motionone/generators@^10.13.1": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/generators/-/generators-10.13.2.tgz#dd972195b899e7a556d65bd27fae2fd423055e10" integrity sha512-QMoXV1MXEEhR6D3dct/RMMS1FwJlAsW+kMPbFGzBA4NbweblgeYQCft9DcDAVpV9wIwD6qvlBG9u99sOXLfHiA== @@ -2734,12 +2693,12 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/types@^10.12.0", "@motionone/types@^10.13.0", "@motionone/types@^10.13.2": +"@motionone/types@^10.13.0", "@motionone/types@^10.13.2": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/types/-/types-10.13.2.tgz#c560090d81bd0149e7451aae23ab7af458570363" integrity sha512-yYV4q5v5F0iADhab4wHfqaRJnM/eVtQLjUPhyEcS72aUz/xyOzi09GzD/Gu+K506BDfqn5eULIilUI77QNaqhw== -"@motionone/utils@^10.12.0", "@motionone/utils@^10.13.1", "@motionone/utils@^10.13.2": +"@motionone/utils@^10.13.1", "@motionone/utils@^10.13.2": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/utils/-/utils-10.13.2.tgz#ce79bfe1d133493c217cdc0584960434e065648d" integrity sha512-6Lw5bDA/w7lrPmT/jYWQ76lkHlHs9fl2NZpJ22cVy1kKDdEH+Cl1U6hMTpdphO6VQktQ6v2APngag91WBKLqlA== @@ -2818,33 +2777,7 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== -"@quri/squiggle-components@^0.2.23": - version "0.2.24" - resolved "https://registry.yarnpkg.com/@quri/squiggle-components/-/squiggle-components-0.2.24.tgz#16a2d72fb16f46a0bf71388c85d1238927676923" - integrity sha512-slBGryELfCsM6WX+AwQcqiPPoImLRHNyXZDueL7a+OKEAx09w3pKOqVzLWNGL7+dJe3dF8as9X/Gv1JbbIj5yw== - dependencies: - "@floating-ui/react-dom" "^0.7.2" - "@floating-ui/react-dom-interactions" "^0.6.6" - "@headlessui/react" "^1.6.6" - "@heroicons/react" "^1.0.6" - "@hookform/resolvers" "^2.9.6" - "@quri/squiggle-lang" "^0.2.8" - "@react-hook/size" "^2.1.2" - clsx "^1.2.1" - framer-motion "^6.5.1" - lodash "^4.17.21" - react "^18.1.0" - react-ace "^10.1.0" - react-hook-form "^7.33.1" - react-use "^17.4.0" - react-vega "^7.6.0" - vega "^5.22.1" - vega-embed "^6.21.0" - vega-lite "^5.3.0" - vscode-uri "^3.0.3" - yup "^0.32.11" - -"@quri/squiggle-lang@^0.2.11", "@quri/squiggle-lang@^0.2.8": +"@quri/squiggle-lang@^0.2.11": version "0.2.12" resolved "https://registry.yarnpkg.com/@quri/squiggle-lang/-/squiggle-lang-0.2.12.tgz#e8fdb22a84aa75df71c071d1ed4ae5c55f15d447" integrity sha512-fgv9DLvPlX/TqPSacKSW3GZ5S9H/YwqaMoRdFrn5SJjHnnMh/xJW/9iyzzgOxPCXov9xFeDvL159tkbStMm7vw== @@ -9721,20 +9654,6 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -framer-motion@^6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-6.5.1.tgz#802448a16a6eb764124bf36d8cbdfa6dd6b931a7" - integrity sha512-o1BGqqposwi7cgDrtg0dNONhkmPsUFDaLcKXigzuTFC5x58mE8iyTazxSudFzmT6MEyJKfjjU8ItoMe3W+3fiw== - dependencies: - "@motionone/dom" "10.12.0" - framesync "6.0.1" - hey-listen "^1.0.8" - popmotion "11.0.3" - style-value-types "5.0.0" - tslib "^2.1.0" - optionalDependencies: - "@emotion/is-prop-valid" "^0.8.2" - framer-motion@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.1.1.tgz#4d56ed18a7cf2c6a1a4a1af5b57714f8e6b52d9e" @@ -9749,13 +9668,6 @@ framer-motion@^7.1.1: optionalDependencies: "@emotion/is-prop-valid" "^0.8.2" -framesync@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.0.1.tgz#5e32fc01f1c42b39c654c35b16440e07a25d6f20" - integrity sha512-fUY88kXvGiIItgNC7wcTOl0SNRCVXMKSWW2Yzfmn7EKNc+MpCzcz9DhdHcdjbrtN3c6R4H5dTY2jiCpPdysEjA== - dependencies: - tslib "^2.1.0" - framesync@6.1.2: version "6.1.2" resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.1.2.tgz#755eff2fb5b8f3b4d2b266dd18121b300aefea27" @@ -13963,16 +13875,6 @@ polished@^4.2.2: dependencies: "@babel/runtime" "^7.17.8" -popmotion@11.0.3: - version "11.0.3" - resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-11.0.3.tgz#565c5f6590bbcddab7a33a074bb2ba97e24b0cc9" - integrity sha512-Y55FLdj3UxkR7Vl3s7Qr4e9m0onSnP8W7d/xQLsoJM40vs6UKHFdygs6SWryasTZYqugMjm3BepCF4CWXDiHgA== - dependencies: - framesync "6.0.1" - hey-listen "^1.0.8" - style-value-types "5.0.0" - tslib "^2.1.0" - popmotion@11.0.5: version "11.0.5" resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-11.0.5.tgz#8e3e014421a0ffa30ecd722564fd2558954e1f7d" @@ -15165,7 +15067,7 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -react-hook-form@^7.33.1, react-hook-form@^7.34.1: +react-hook-form@^7.34.1: version "7.34.1" resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.1.tgz#06cb216daf706bf9ae4969747115afae0d09410d" integrity sha512-tH7TaZgAURMhjzVE2M/EFmxHz2HdaPMAVs9FXTweNW551VlhXSuVcpcYlkiMZf2zHQiTztupVFpBHJFTma+N7w== @@ -16972,14 +16874,6 @@ style-to-object@0.3.0, style-to-object@^0.3.0: dependencies: inline-style-parser "0.1.1" -style-value-types@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.0.0.tgz#76c35f0e579843d523187989da866729411fc8ad" - integrity sha512-08yq36Ikn4kx4YU6RD7jWEv27v4V+PUsOGa4n/as8Et3CuODMJQ00ENeAVXAeydX4Z2j1XHZF1K2sX4mGl18fA== - dependencies: - hey-listen "^1.0.8" - tslib "^2.1.0" - style-value-types@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.1.2.tgz#6be66b237bd546048a764883528072ed95713b62" @@ -18236,7 +18130,7 @@ vega-label@~1.2.0: vega-scenegraph "^4.9.2" vega-util "^1.15.2" -vega-lite@^5.3.0, vega-lite@^5.4.0: +vega-lite@^5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.4.0.tgz#d09331e2a1c87843d5865de0fa7704919796ab56" integrity sha512-e/P5iOtBE62WEWZhKP7sLcBd92YS9prfUQafelxoOeloooSSrkUwM/ZDmN5Q5ffByEZTiKfODtnwD6/xKDYUmw== From a04761226d28be90129f15b8b84d99ddf80cde5e Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Aug 2022 15:50:30 -0700 Subject: [PATCH 035/102] Improved error messages of function library --- .../FunctionRegistry/Library/FR_Pointset.res | 6 +++--- .../FunctionRegistry/Library/FR_Sampleset.res | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res index c0270e48..44b6abd2 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -43,8 +43,7 @@ module Internal = { let mapY = (pointSetDist: t, aLambdaValue, env, reducer) => { let fn = r => doLambdaCall(aLambdaValue, list{IEvNumber(r)}, env, reducer) - let foo = PointSetDist.T.mapYResult(~fn, pointSetDist) - foo->toType + PointSetDist.T.mapYResult(~fn, pointSetDist)->toType } } @@ -90,7 +89,8 @@ let library = [ ~inputs=[FRTypeDist, FRTypeLambda], ~run=(inputs, _, env, reducer) => switch inputs { - | [IEvDistribution(PointSet(dist)), IEvLambda(lambda)] => Internal.mapY(dist, lambda, env, reducer)->E.R2.errMap(_ => "") + | [IEvDistribution(PointSet(dist)), IEvLambda(lambda)] => + Internal.mapY(dist, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) | _ => Error(impossibleError) }, (), 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 27b870ee..ec6df20c 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -92,7 +92,7 @@ let library = [ GenericDist.toSampleSetDist(dist, env.sampleCount) ->E.R2.fmap(Wrappers.sampleSet) ->E.R2.fmap(Wrappers.evDistribution) - ->E.R2.errMap(_ => "") + ->E.R2.errMap(DistributionTypes.Error.toString) | _ => Error(impossibleError) }, (), @@ -158,7 +158,7 @@ let library = [ | [IEvLambda(lambda)] => switch Internal.fromFn(lambda, env, reducer) { | Ok(r) => Ok(r->Wrappers.sampleSet->Wrappers.evDistribution) - | Error(_) => Error("issue") + | Error(e) => Error(Operation.Error.toString(e)) } | _ => Error(impossibleError) }, @@ -180,7 +180,7 @@ let library = [ ~run=(inputs, _, env, reducer) => switch inputs { | [IEvDistribution(SampleSet(dist)), IEvLambda(lambda)] => - Internal.map1(dist, lambda, env, reducer)->E.R2.errMap(_ => "") + Internal.map1(dist, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) | _ => Error(impossibleError) }, (), @@ -207,7 +207,7 @@ let library = [ IEvDistribution(SampleSet(dist2)), IEvLambda(lambda), ] => - Internal.map2(dist1, dist2, lambda, env, reducer)->E.R2.errMap(_ => "") + Internal.map2(dist1, dist2, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) | _ => Error(impossibleError) } }, @@ -236,7 +236,7 @@ let library = [ IEvDistribution(SampleSet(dist3)), IEvLambda(lambda), ] => - Internal.map3(dist1, dist2, dist3, lambda, env, reducer)->E.R2.errMap(_ => "") + Internal.map3(dist1, dist2, dist3, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) | _ => Error(impossibleError) }, (), @@ -259,9 +259,7 @@ let library = [ ~run=(inputs, _, env, reducer) => switch inputs { | [IEvArray(dists), IEvLambda(lambda)] => - Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(_e => { - "AHHH doesn't work" - }) + Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) | _ => Error(impossibleError) }, (), From 15debbddea9ead8481d85ee624db9fb2c891ae68 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Aug 2022 15:56:59 -0700 Subject: [PATCH 036/102] Added very minimal documentation for PointSet mapY --- packages/website/docs/Api/DistPointSet.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md index 9c9c3d0d..a966f296 100644 --- a/packages/website/docs/Api/DistPointSet.md +++ b/packages/website/docs/Api/DistPointSet.md @@ -46,3 +46,13 @@ PointSet.makeDiscrete([ { x: 3, y: 0.1 }, ]); ``` + +### mapY + +``` +PointSet.mapY: (pointSetDist, (number => number)) => pointSetDist +``` + +```javascript +normal(5,3) |> PointSet.fromDist |> PointSet.mapY({|x| x ^ 2}) |> normalize +``` \ No newline at end of file From 72b1d6af3e7504af935f32f40cc036c7e0e8dfaf Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Aug 2022 15:59:25 -0700 Subject: [PATCH 037/102] Formatted --- .../FunctionRegistry/Library/FR_Sampleset.res | 12 +++++++++--- packages/website/docs/Api/DistPointSet.md | 2 +- 2 files changed, 10 insertions(+), 4 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 ec6df20c..c40fe349 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -207,7 +207,9 @@ let library = [ IEvDistribution(SampleSet(dist2)), IEvLambda(lambda), ] => - Internal.map2(dist1, dist2, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) + Internal.map2(dist1, dist2, lambda, env, reducer)->E.R2.errMap( + Reducer_ErrorValue.errorToString, + ) | _ => Error(impossibleError) } }, @@ -236,7 +238,9 @@ let library = [ IEvDistribution(SampleSet(dist3)), IEvLambda(lambda), ] => - Internal.map3(dist1, dist2, dist3, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) + Internal.map3(dist1, dist2, dist3, lambda, env, reducer)->E.R2.errMap( + Reducer_ErrorValue.errorToString, + ) | _ => Error(impossibleError) }, (), @@ -259,7 +263,9 @@ let library = [ ~run=(inputs, _, env, reducer) => switch inputs { | [IEvArray(dists), IEvLambda(lambda)] => - Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) + Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap( + Reducer_ErrorValue.errorToString, + ) | _ => Error(impossibleError) }, (), diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md index a966f296..bfd8ae82 100644 --- a/packages/website/docs/Api/DistPointSet.md +++ b/packages/website/docs/Api/DistPointSet.md @@ -55,4 +55,4 @@ PointSet.mapY: (pointSetDist, (number => number)) => pointSetDist ```javascript normal(5,3) |> PointSet.fromDist |> PointSet.mapY({|x| x ^ 2}) |> normalize -``` \ No newline at end of file +``` From 516f4fa39d609d0d26a7a1f088d5574d5e2a3985 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Aug 2022 17:10:08 -0700 Subject: [PATCH 038/102] 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 039/102] 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 040/102] 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 9bffa25dea688369e2ab2ba51748929bed7efb88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:20:27 +0000 Subject: [PATCH 041/102] :arrow_up: Bump @typescript-eslint/parser from 5.33.0 to 5.33.1 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.33.0 to 5.33.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.33.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... 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 331861ff..98d5a2a3 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.33.1", - "@typescript-eslint/parser": "^5.33.0", + "@typescript-eslint/parser": "^5.33.1", "eslint": "^8.22.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index b341972f..ff2a2a00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5027,14 +5027,14 @@ dependencies: "@typescript-eslint/utils" "5.29.0" -"@typescript-eslint/parser@^5.33.0", "@typescript-eslint/parser@^5.5.0": - version "5.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.0.tgz#26ec3235b74f0667414613727cb98f9b69dc5383" - integrity sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w== +"@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== dependencies: - "@typescript-eslint/scope-manager" "5.33.0" - "@typescript-eslint/types" "5.33.0" - "@typescript-eslint/typescript-estree" "5.33.0" + "@typescript-eslint/scope-manager" "5.33.1" + "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/typescript-estree" "5.33.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.0": - version "5.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz#509d7fa540a2c58f66bdcfcf278a3fa79002e18d" - integrity sha512-/Jta8yMNpXYpRDl8EwF/M8It2A9sFJTubDo0ATZefGXmOqlaBffEw0ZbkbQ7TNDK6q55NPHFshGBPAZvZkE8Pw== - dependencies: - "@typescript-eslint/types" "5.33.0" - "@typescript-eslint/visitor-keys" "5.33.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" @@ -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.0": - version "5.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.0.tgz#d41c584831805554b063791338b0220b613a275b" - integrity sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw== - "@typescript-eslint/types@5.33.1": version "5.33.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.1.tgz#3faef41793d527a519e19ab2747c12d6f3741ff7" @@ -5098,19 +5085,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.33.0": - version "5.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz#02d9c9ade6f4897c09e3508c27de53ad6bfa54cf" - integrity sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ== - dependencies: - "@typescript-eslint/types" "5.33.0" - "@typescript-eslint/visitor-keys" "5.33.0" - 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.33.1": version "5.33.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.1.tgz#a573bd360790afdcba80844e962d8b2031984f34" @@ -5156,14 +5130,6 @@ "@typescript-eslint/types" "5.29.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@5.33.0": - version "5.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz#fbcbb074e460c11046e067bc3384b5d66b555484" - integrity sha512-/XsqCzD4t+Y9p5wd9HZiptuGKBlaZO5showwqODii5C0nZawxWLF+Q6k5wYHBrQv96h6GYKyqqMHCSTqta8Kiw== - dependencies: - "@typescript-eslint/types" "5.33.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" From e205133c8e78bac084e030db545ad942c30f6830 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:22:07 +0000 Subject: [PATCH 042/102] :arrow_up: Bump @types/lodash from 4.14.182 to 4.14.184 Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.182 to 4.14.184. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash) --- updated-dependencies: - dependency-name: "@types/lodash" 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 a82a3718..e715d28a 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -38,7 +38,7 @@ "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^14.4.3", "@types/jest": "^27.5.0", - "@types/lodash": "^4.14.182", + "@types/lodash": "^4.14.184", "@types/node": "^18.7.4", "@types/react": "^18.0.9", "@types/styled-components": "^5.1.26", diff --git a/yarn.lock b/yarn.lock index b341972f..fb82e18a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4696,10 +4696,10 @@ 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": - version "4.14.182" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" - integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== +"@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== "@types/mdast@^3.0.0": version "3.0.10" From 6b46817f7096720c2969c1ee0776ab0294d869f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:22:54 +0000 Subject: [PATCH 043/102] :arrow_up: Bump vega-lite from 5.4.0 to 5.5.0 Bumps [vega-lite](https://github.com/vega/vega-lite) from 5.4.0 to 5.5.0. - [Release notes](https://github.com/vega/vega-lite/releases) - [Changelog](https://github.com/vega/vega-lite/blob/v5.5.0/CHANGELOG.md) - [Commits](https://github.com/vega/vega-lite/compare/v5.4.0...v5.5.0) --- updated-dependencies: - dependency-name: vega-lite dependency-type: direct:production update-type: version-update:semver-minor ... 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 a82a3718..a1874c64 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -20,7 +20,7 @@ "react-vega": "^7.6.0", "vega": "^5.22.1", "vega-embed": "^6.21.0", - "vega-lite": "^5.4.0", + "vega-lite": "^5.5.0", "vscode-uri": "^3.0.3", "yup": "^0.32.11" }, diff --git a/yarn.lock b/yarn.lock index b341972f..fae96955 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18130,10 +18130,10 @@ vega-label@~1.2.0: vega-scenegraph "^4.9.2" vega-util "^1.15.2" -vega-lite@^5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.4.0.tgz#d09331e2a1c87843d5865de0fa7704919796ab56" - integrity sha512-e/P5iOtBE62WEWZhKP7sLcBd92YS9prfUQafelxoOeloooSSrkUwM/ZDmN5Q5ffByEZTiKfODtnwD6/xKDYUmw== +vega-lite@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.5.0.tgz#07345713d538cd63278748ec119c261722be66ff" + integrity sha512-MQBJt/iaUegvhRTS/hZVWfMOSF5ai4awlR2qtwTgHd84bErf9v7GtaZ9ArhJqXCb+FizvZ2jatmoYCzovgAhkg== dependencies: "@types/clone" "~2.1.1" array-flat-polyfill "^1.0.1" From 2eb011d965397c1b630ca6b7e1ba52e54344ed17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:23:50 +0000 Subject: [PATCH 044/102] :arrow_up: Bump framer-motion from 7.1.1 to 7.2.0 Bumps [framer-motion](https://github.com/framer/motion) from 7.1.1 to 7.2.0. - [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.1.1...v7.2.0) --- updated-dependencies: - dependency-name: framer-motion dependency-type: direct:production update-type: version-update:semver-minor ... 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 a82a3718..7ce11698 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.1.1", + "framer-motion": "^7.2.0", "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", diff --git a/yarn.lock b/yarn.lock index b341972f..e10281f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9654,10 +9654,10 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -framer-motion@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.1.1.tgz#4d56ed18a7cf2c6a1a4a1af5b57714f8e6b52d9e" - integrity sha512-ONFaG7as1GBBYYIqzX8ENVsfa4eh6f7/nSc3QCADAHOaCt1Lh3UdWbQ0+HVGOOORvEW2L99GlCr4wQc0GLddXg== +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== dependencies: "@motionone/dom" "10.13.1" framesync "6.1.2" From fabd8daf9a7e8fde99db4a7cb0f2183f4e8df02b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:27:31 +0000 Subject: [PATCH 045/102] :arrow_up: Bump react-hook-form from 7.34.1 to 7.34.2 Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.34.1 to 7.34.2. - [Release notes](https://github.com/react-hook-form/react-hook-form/releases) - [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md) - [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.34.1...v7.34.2) --- updated-dependencies: - dependency-name: react-hook-form 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 a82a3718..61f37f62 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -15,7 +15,7 @@ "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", - "react-hook-form": "^7.34.1", + "react-hook-form": "^7.34.2", "react-use": "^17.4.0", "react-vega": "^7.6.0", "vega": "^5.22.1", diff --git a/yarn.lock b/yarn.lock index b341972f..bd68e629 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15067,10 +15067,10 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -react-hook-form@^7.34.1: - version "7.34.1" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.1.tgz#06cb216daf706bf9ae4969747115afae0d09410d" - integrity sha512-tH7TaZgAURMhjzVE2M/EFmxHz2HdaPMAVs9FXTweNW551VlhXSuVcpcYlkiMZf2zHQiTztupVFpBHJFTma+N7w== +react-hook-form@^7.34.2: + version "7.34.2" + resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.2.tgz#9ac6d1a309a7c4aaa369d1269357a70e9e9bf4de" + integrity sha512-1lYWbEqr0GW7HHUjMScXMidGvV0BE2RJV3ap2BL7G0EJirkqpccTaawbsvBO8GZaB3JjCeFBEbnEWI1P8ZoLRQ== react-inspector@^5.1.0: version "5.1.1" From 7eec5b397ccb2a09e8fdea632b09fac3937c813c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 15:03:39 +0000 Subject: [PATCH 046/102] :arrow_up: Bump @types/node from 18.7.4 to 18.7.9 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.7.4 to 18.7.9. - [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 41eb19b6..d8be7b6c 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.4", + "@types/node": "^18.7.9", "@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 442cb77b..87f127f8 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.4": - version "18.7.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.4.tgz#95baa50846ae112a7376869d49fec23b2506c69d" - integrity sha512-RzRcw8c0B8LzryWOR4Wj7YOTFXvdYKwvrb6xQQyuDfnlTxwYXGCV5RZ/TEbq5L5kn+w3rliHAUyRcG1RtbmTFg== +"@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@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0": version "16.11.41" From 063b6b67a176e6acf9ed465e8378dfcedba9cccd Mon Sep 17 00:00:00 2001 From: Orpheus Lummis Date: Mon, 22 Aug 2022 11:08:51 -0500 Subject: [PATCH 047/102] fix: Update vscode ext manifest repository link --- packages/vscode-ext/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 98d5a2a3..73ca9dd6 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -7,7 +7,7 @@ "publisher": "QURI", "repository": { "type": "git", - "url": "git+https://github.com/quantified-uncertainty/squiggle.git" + "url": "https://github.com/quantified-uncertainty/squiggle.git" }, "icon": "media/vendor/icon.png", "engines": { @@ -143,4 +143,4 @@ "vscode-languageserver-textdocument": "^1.0.5", "@quri/squiggle-lang": "^0.2.11" } -} +} \ No newline at end of file From 6a2ff402794c491553eb870fc7117c7abbb1922d Mon Sep 17 00:00:00 2001 From: Quinn Date: Tue, 23 Aug 2022 08:59:52 -0400 Subject: [PATCH 048/102] Replace algolia app They ended up giving us premium for free (I think: the dashboard is pretty bad so it's hard to tell), so I'm replacing the algolia app with another one. --- packages/website/docusaurus.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index 3949e98b..1f712dab 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -54,10 +54,10 @@ const config = { ({ algolia: { // The application ID provided by Algolia - appId: "NEUN2KAR5K", + appId: "KBED3M1CMD", // Public API key: it is safe to commit it - apiKey: "1f5c74a2d72799add24eb7682531a1b0", + apiKey: "c61bc7603893cf287ed6971983af8bad", indexName: "squiggle_docs", From d29b77ca610314c6a53492edf7aa004034352cef Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 25 Aug 2022 22:19:29 +0200 Subject: [PATCH 049/102] fix #1007 variables that start with true/false --- .../Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy index 15837da4..00467d86 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy @@ -250,8 +250,8 @@ float 'float' d = [0-9] boolean 'boolean' - = ('true'/'false') - { return h.nodeBoolean(text() === 'true')} + = ('true'/'false') ! [a-z]i ! [_$] + { return h.nodeBoolean(text() === 'true')} valueConstructor = recordConstructor From 9e342d884f2c290caa753c8335387e351dc7fd5d Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 29 Aug 2022 21:39:18 +0800 Subject: [PATCH 050/102] 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 051/102] 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 052/102] 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 053/102] :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 054/102] :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 055/102] :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 056/102] :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 057/102] :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 058/102] :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 059/102] :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 060/102] :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 061/102] :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 062/102] :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 063/102] :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 064/102] 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 065/102] 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 066/102] 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 067/102] 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 068/102] 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 069/102] 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 070/102] 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 071/102] 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 072/102] 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 073/102] `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 074/102] 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 075/102] 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 076/102] 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 077/102] 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 078/102] 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 079/102] 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 080/102] 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 081/102] 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 082/102] `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 083/102] 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 084/102] 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 085/102] 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 086/102] 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 087/102] 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 089/102] 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 090/102] 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 091/102] 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 092/102] 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 093/102] 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 094/102] 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 095/102] `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 096/102] 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 097/102] 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 098/102] 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 099/102] 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 100/102] 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 101/102] `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", From e522eb4c5fb04b6d06bf9c6bb321413deddfb9cf Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 1 Sep 2022 11:00:23 -0700 Subject: [PATCH 102/102] 0.3.0 -> 0.3.1 --- packages/components/package.json | 2 +- packages/squiggle-lang/package.json | 2 +- .../src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index dc757468..08cc88bd 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@quri/squiggle-components", - "version": "0.3.1", + "version": "0.3.2", "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^1.0.0", diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 5522d7a2..88e1f9b3 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -1,6 +1,6 @@ { "name": "@quri/squiggle-lang", - "version": "0.3.0", + "version": "0.3.1", "homepage": "https://squiggle-language.com", "license": "MIT", "scripts": { diff --git a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res index 91e9959c..b4e5a622 100644 --- a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res +++ b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res @@ -2,7 +2,7 @@ module Bindings = Reducer_Bindings let bindings: Bindings.t = [ - ("System.version", ReducerInterface_InternalExpressionValue.IEvString("0.3.0")), + ("System.version", ReducerInterface_InternalExpressionValue.IEvString("0.3.1")), ]->Bindings.fromArray let makeBindings = (previousBindings: Bindings.t): Bindings.t =>