From 8a2269b7d00e6b3e6c06cc05552d9553d9669629 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Wed, 6 Jul 2022 19:21:54 +0400 Subject: [PATCH 001/203] collapsible results (WIP) --- .../src/components/SquiggleItem.tsx | 225 ++++++++++-------- 1 file changed, 129 insertions(+), 96 deletions(-) diff --git a/packages/components/src/components/SquiggleItem.tsx b/packages/components/src/components/SquiggleItem.tsx index 48a8a0fb..e5eef1a4 100644 --- a/packages/components/src/components/SquiggleItem.tsx +++ b/packages/components/src/components/SquiggleItem.tsx @@ -1,4 +1,4 @@ -import * as React from "react"; +import React, { useState } from "react"; import { squiggleExpression, environment, @@ -10,6 +10,8 @@ import { DistributionPlottingSettings, } from "./DistributionChart"; import { FunctionChart, FunctionChartSettings } from "./FunctionChart"; +import clsx from "clsx"; +import { LayoutGroup, motion } from "framer-motion"; function getRange(x: declaration) { const first = x.args[0]; @@ -35,33 +37,48 @@ function getChartSettings(x: declaration): FunctionChartSettings { } interface VariableBoxProps { + name?: string; heading: string; children: React.ReactNode; showTypes: boolean; } export const VariableBox: React.FC = ({ + name, heading = "Error", children, showTypes = false, }) => { - if (showTypes) { - return ( -
-
-
{heading}
-
-
{children}
-
- ); - } else { - return
{children}
; - } + const [isCollapsed, setIsCollapsed] = useState(false); + return ( + + {name || showTypes ? ( + setIsCollapsed(!isCollapsed)} + > + {name ? {name}: : null} + {showTypes ? {heading} : null} + {isCollapsed ? ( + ... + ) : null} + + ) : null} + {isCollapsed ? null : ( + {children} + )} + + ); }; export interface SquiggleItemProps { - /** The input string for squiggle */ + /** The output of squiggle's run */ expression: squiggleExpression; + name?: string; width?: number; height: number; distributionPlotSettings: DistributionPlottingSettings; @@ -74,6 +91,7 @@ export interface SquiggleItemProps { } export const SquiggleItem: React.FC = ({ + name, expression, width, height, @@ -85,7 +103,7 @@ export const SquiggleItem: React.FC = ({ switch (expression.tag) { case "number": return ( - +
@@ -95,6 +113,7 @@ export const SquiggleItem: React.FC = ({ const distType = expression.value.type(); return ( @@ -112,9 +131,9 @@ export const SquiggleItem: React.FC = ({ } case "string": return ( - + " - + {expression.value} " @@ -122,94 +141,45 @@ export const SquiggleItem: React.FC = ({ ); case "boolean": return ( - + {expression.value.toString()} ); case "symbol": return ( - + Undefined Symbol: {expression.value} ); case "call": return ( - + {expression.value} ); - case "array": - return ( - - {expression.value.map((r, i) => ( -
-
-
{i}
-
-
- -
-
- ))} -
- ); - case "record": - return ( - -
- {Object.entries(expression.value).map(([key, r]) => ( -
-
-
{key}:
-
-
- -
-
- ))} -
-
- ); case "arraystring": return ( - + {expression.value.map((r) => `"${r}"`).join(", ")} ); case "date": return ( - + {expression.value.toDateString()} ); case "timeDuration": { return ( - + ); } case "lambda": return ( - +
{`function(${expression.value.parameters.join( "," )})`}
@@ -227,7 +197,11 @@ export const SquiggleItem: React.FC = ({ ); case "lambdaDeclaration": { return ( - + = ({ } case "module": { return ( - -
- {Object.entries(expression.value) - .filter(([key, r]) => key !== "Math") - .map(([key, r]) => ( -
-
-
{key}:
-
-
- -
-
- ))} + +
+ + {Object.entries(expression.value) + .filter(([key, r]) => key !== "Math") + .map(([key, r]) => ( + + ))} +
); } + case "record": + return ( + +
+ + {Object.entries(expression.value).map(([key, r]) => ( + + ))} + +
+
+ ); + case "array": + return ( + +
+ + {expression.value.map((r, i) => ( + + ))} + +
+
+ ); default: { return (
From afbc1e1455c23e8dc1eccc694306ac1bead7a5f6 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Thu, 7 Jul 2022 20:54:40 +0400 Subject: [PATCH 002/203] collapsible tree --- .../src/components/SquiggleItem.tsx | 157 +++++++++--------- 1 file changed, 74 insertions(+), 83 deletions(-) diff --git a/packages/components/src/components/SquiggleItem.tsx b/packages/components/src/components/SquiggleItem.tsx index e5eef1a4..e68da76a 100644 --- a/packages/components/src/components/SquiggleItem.tsx +++ b/packages/components/src/components/SquiggleItem.tsx @@ -43,7 +43,7 @@ interface VariableBoxProps { showTypes: boolean; } -export const VariableBox: React.FC = ({ +const VariableBox: React.FC = ({ name, heading = "Error", children, @@ -51,13 +51,11 @@ export const VariableBox: React.FC = ({ }) => { const [isCollapsed, setIsCollapsed] = useState(false); return ( - + {name || showTypes ? ( setIsCollapsed(!isCollapsed)} > @@ -69,12 +67,35 @@ export const VariableBox: React.FC = ({ ) : null} {isCollapsed ? null : ( - {children} + + {children} + )} ); }; +const VariableList: React.FC<{ + name?: string; + heading: string; + showTypes: boolean; + children: React.ReactNode; +}> = ({ name, heading, showTypes, children }) => ( + + + {children} + + +); + export interface SquiggleItemProps { /** The output of squiggle's run */ expression: squiggleExpression; @@ -217,90 +238,60 @@ export const SquiggleItem: React.FC = ({ } case "module": { return ( - -
- - {Object.entries(expression.value) - .filter(([key, r]) => key !== "Math") - .map(([key, r]) => ( - - ))} - -
-
+ + {Object.entries(expression.value) + .filter(([key, r]) => key !== "Math") + .map(([key, r]) => ( + + ))} + ); } case "record": return ( - -
- - {Object.entries(expression.value).map(([key, r]) => ( - - ))} - -
-
+ + {Object.entries(expression.value).map(([key, r]) => ( + + ))} + ); case "array": return ( - -
- - {expression.value.map((r, i) => ( - - ))} - -
-
+ + {expression.value.map((r, i) => ( + + ))} + ); default: { return ( From 9f0e4f34fe7dcf0ed75d87f5f8139c747b69d144 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 7 Jul 2022 12:01:02 -0700 Subject: [PATCH 003/203] First attempt at integrating namespaces --- .../FunctionRegistry_Core.res | 6 +- .../FunctionRegistry_Helpers.res | 59 +++-- .../FunctionRegistry_Library.res | 230 +++++++++++------- 3 files changed, 190 insertions(+), 105 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index bbca7bc7..be94ea99 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -39,6 +39,8 @@ and frValueDictParam = (string, frValue) and frValueDistOrNumber = FRValueNumber(float) | FRValueDist(DistributionTypes.genericDist) type fnDefinition = { + nameSpace: option, + requiresNamespace: bool, name: string, inputs: array, run: (array, DistributionOperation.env) => result, @@ -327,8 +329,10 @@ module FnDefinition = { } } - let make = (~name, ~inputs, ~run): t => { + let make = (~nameSpace=None, ~requiresNamespace=true, ~name, ~inputs, ~run, ()): t => { name: name, + nameSpace: nameSpace, + requiresNamespace: requiresNamespace, inputs: inputs, run: run, } diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res index 46ae18f9..1a42cb50 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res @@ -201,8 +201,11 @@ module TwoArgDist = { ->E.R2.fmap(Wrappers.evDistribution) let make = (name, fn) => { - FnDefinition.make(~name, ~inputs=[FRTypeDistOrNumber, FRTypeDistOrNumber], ~run=(inputs, env) => - inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env) + FnDefinition.make( + ~name, + ~inputs=[FRTypeDistOrNumber, FRTypeDistOrNumber], + ~run=(inputs, env) => inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env), + (), ) } @@ -211,6 +214,7 @@ module TwoArgDist = { ~name, ~inputs=[FRTypeRecord([("p5", FRTypeDistOrNumber), ("p95", FRTypeDistOrNumber)])], ~run=(inputs, env) => inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), + (), ) } @@ -219,6 +223,7 @@ module TwoArgDist = { ~name, ~inputs=[FRTypeRecord([("mean", FRTypeDistOrNumber), ("stdev", FRTypeDistOrNumber)])], ~run=(inputs, env) => inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), + (), ) } } @@ -230,35 +235,51 @@ module OneArgDist = { ->E.R2.fmap(Wrappers.evDistribution) let make = (name, fn) => - FnDefinition.make(~name, ~inputs=[FRTypeDistOrNumber], ~run=(inputs, env) => - inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env) + FnDefinition.make( + ~name, + ~inputs=[FRTypeDistOrNumber], + ~run=(inputs, env) => inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env), + (), ) } module ArrayNumberDist = { let make = (name, fn) => { - FnDefinition.make(~name, ~inputs=[FRTypeArray(FRTypeNumber)], ~run=(inputs, _) => - Prepare.ToTypedArray.numbers(inputs) - ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) - ->E.R.bind(fn) + FnDefinition.make( + ~name, + ~inputs=[FRTypeArray(FRTypeNumber)], + ~run=(inputs, _) => + Prepare.ToTypedArray.numbers(inputs) + ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) + ->E.R.bind(fn), + (), ) } let make2 = (name, fn) => { - FnDefinition.make(~name, ~inputs=[FRTypeArray(FRTypeAny)], ~run=(inputs, _) => - Prepare.ToTypedArray.numbers(inputs) - ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) - ->E.R.bind(fn) + FnDefinition.make( + ~name, + ~inputs=[FRTypeArray(FRTypeAny)], + ~run=(inputs, _) => + Prepare.ToTypedArray.numbers(inputs) + ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) + ->E.R.bind(fn), + (), ) } } module NumberToNumber = { let make = (name, fn) => - FnDefinition.make(~name, ~inputs=[FRTypeNumber], ~run=(inputs, _) => { - inputs - ->getOrError(0) - ->E.R.bind(Prepare.oneNumber) - ->E.R2.fmap(fn) - ->E.R2.fmap(Wrappers.evNumber) - }) + FnDefinition.make( + ~name, + ~inputs=[FRTypeNumber], + ~run=(inputs, _) => { + inputs + ->getOrError(0) + ->E.R.bind(Prepare.oneNumber) + ->E.R2.fmap(fn) + ->E.R2.fmap(Wrappers.evNumber) + }, + (), + ) } diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index a37b8dc4..780356dc 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -54,9 +54,12 @@ let registry = [ ~name="toContinuousPointSet", ~definitions=[ FnDefinition.make( - ~name="toContinuousPointSet", + ~nameSpace=Some("PointSet"), + ~requiresNamespace=true, + ~name="makeContinuous", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + (), ), ], (), @@ -65,9 +68,12 @@ let registry = [ ~name="toDiscretePointSet", ~definitions=[ FnDefinition.make( - ~name="toDiscretePointSet", + ~nameSpace=Some("PointSet"), + ~requiresNamespace=true, + ~name="makeDiscrete", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + (), ), ], (), @@ -75,9 +81,14 @@ let registry = [ Function.make( ~name="Declaration", ~definitions=[ - FnDefinition.make(~name="declareFn", ~inputs=[Declaration.frType], ~run=(inputs, _) => { - inputs->getOrError(0)->E.R.bind(Declaration.fromExpressionValue) - }), + FnDefinition.make( + ~name="declareFn", + ~inputs=[Declaration.frType], + ~run=(inputs, _) => { + inputs->getOrError(0)->E.R.bind(Declaration.fromExpressionValue) + }, + (), + ), ], (), ), @@ -189,6 +200,7 @@ to(5,10) ~name="toContinuousPointSet", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + (), ), ], (), @@ -207,6 +219,7 @@ to(5,10) ~name="toDiscretePointSet", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + (), ), ], (), @@ -222,9 +235,14 @@ to(5,10) ] })`, ~definitions=[ - FnDefinition.make(~name="declareFn", ~inputs=[Declaration.frType], ~run=(inputs, _) => { - inputs->E.A.unsafe_get(0)->Declaration.fromExpressionValue - }), + FnDefinition.make( + ~name="declareFn", + ~inputs=[Declaration.frType], + ~run=(inputs, _) => { + inputs->E.A.unsafe_get(0)->Declaration.fromExpressionValue + }, + (), + ), ], ~isExperimental=true, (), @@ -366,6 +384,8 @@ to(5,10) ~name="Dict.merge", ~definitions=[ FnDefinition.make( + ~nameSpace=Some("Dict"), + ~requiresNamespace=true, ~name="merge", ~inputs=[FRTypeDict(FRTypeAny), FRTypeDict(FRTypeAny)], ~run=(inputs, _) => { @@ -380,6 +400,7 @@ to(5,10) | _ => Error(impossibleError) } }, + (), ), ], (), @@ -388,16 +409,19 @@ to(5,10) Function.make( ~name="Dict.mergeMany", ~definitions=[ - FnDefinition.make(~name="mergeMany", ~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))], ~run=( - inputs, - _, - ) => - inputs - ->Prepare.ToTypedArray.dicts - ->E.R2.fmap(E.Dict.concatMany) - ->E.R2.fmap(Js.Dict.map((. r) => FunctionRegistry_Core.FRType.matchReverse(r))) - ->E.R2.fmap(r => r->Js.Dict.entries->Belt.Map.String.fromArray) - ->E.R2.fmap(Wrappers.evRecord) + FnDefinition.make( + ~nameSpace=Some("Dict"), + ~requiresNamespace=true, + ~name="mergeMany", + ~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))], + ~run=(inputs, _) => + inputs + ->Prepare.ToTypedArray.dicts + ->E.R2.fmap(E.Dict.concatMany) + ->E.R2.fmap(Js.Dict.map((. r) => FunctionRegistry_Core.FRType.matchReverse(r))) + ->E.R2.fmap(r => r->Js.Dict.entries->Belt.Map.String.fromArray) + ->E.R2.fmap(Wrappers.evRecord), + (), ), ], (), @@ -405,11 +429,18 @@ to(5,10) Function.make( ~name="Dict.keys", ~definitions=[ - FnDefinition.make(~name="keys", ~inputs=[FRTypeDict(FRTypeAny)], ~run=(inputs, _) => - switch inputs { - | [FRValueDict(d1)] => Js.Dict.keys(d1)->E.A2.fmap(Wrappers.evString)->Wrappers.evArray->Ok - | _ => Error(impossibleError) - } + FnDefinition.make( + ~nameSpace=Some("Dict"), + ~requiresNamespace=true, + ~name="keys", + ~inputs=[FRTypeDict(FRTypeAny)], + ~run=(inputs, _) => + switch inputs { + | [FRValueDict(d1)] => + Js.Dict.keys(d1)->E.A2.fmap(Wrappers.evString)->Wrappers.evArray->Ok + | _ => Error(impossibleError) + }, + (), ), ], (), @@ -417,15 +448,21 @@ to(5,10) Function.make( ~name="Dict.values", ~definitions=[ - FnDefinition.make(~name="values", ~inputs=[FRTypeDict(FRTypeAny)], ~run=(inputs, _) => - switch inputs { - | [FRValueDict(d1)] => - Js.Dict.values(d1) - ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) - ->Wrappers.evArray - ->Ok - | _ => Error(impossibleError) - } + FnDefinition.make( + ~nameSpace=Some("Dict"), + ~requiresNamespace=true, + ~name="values", + ~inputs=[FRTypeDict(FRTypeAny)], + ~run=(inputs, _) => + switch inputs { + | [FRValueDict(d1)] => + Js.Dict.values(d1) + ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) + ->Wrappers.evArray + ->Ok + | _ => Error(impossibleError) + }, + (), ), ], (), @@ -433,21 +470,27 @@ to(5,10) Function.make( ~name="Dict.toList", ~definitions=[ - FnDefinition.make(~name="dictToList", ~inputs=[FRTypeDict(FRTypeAny)], ~run=(inputs, _) => - switch inputs { - | [FRValueDict(dict)] => - dict - ->Js.Dict.entries - ->E.A2.fmap(((key, value)) => - Wrappers.evArray([ - Wrappers.evString(key), - FunctionRegistry_Core.FRType.matchReverse(value), - ]) - ) - ->Wrappers.evArray - ->Ok - | _ => Error(impossibleError) - } + FnDefinition.make( + ~nameSpace=Some("Dict"), + ~requiresNamespace=true, + ~name="toList", + ~inputs=[FRTypeDict(FRTypeAny)], + ~run=(inputs, _) => + switch inputs { + | [FRValueDict(dict)] => + dict + ->Js.Dict.entries + ->E.A2.fmap(((key, value)) => + Wrappers.evArray([ + Wrappers.evString(key), + FunctionRegistry_Core.FRType.matchReverse(value), + ]) + ) + ->Wrappers.evArray + ->Ok + | _ => Error(impossibleError) + }, + (), ), ], (), @@ -455,25 +498,29 @@ to(5,10) Function.make( ~name="Dict.fromList", ~definitions=[ - FnDefinition.make(~name="dictFromList", ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], ~run=( - inputs, - _, - ) => { - let convertInternalItems = items => - items - ->E.A2.fmap(item => { - switch item { - | [FRValueString(string), value] => - (string, FunctionRegistry_Core.FRType.matchReverse(value))->Ok - | _ => Error(impossibleError) - } - }) - ->E.A.R.firstErrorOrOpen - ->E.R2.fmap(Belt.Map.String.fromArray) - ->E.R2.fmap(Wrappers.evRecord) - inputs->getOrError(0)->E.R.bind(Prepare.ToValueArray.Array.arrayOfArrays) - |> E.R2.bind(convertInternalItems) - }), + FnDefinition.make( + ~nameSpace=Some("Dict"), + ~requiresNamespace=true, + ~name="fromList", + ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], + ~run=(inputs, _) => { + let convertInternalItems = items => + items + ->E.A2.fmap(item => { + switch item { + | [FRValueString(string), value] => + (string, FunctionRegistry_Core.FRType.matchReverse(value))->Ok + | _ => Error(impossibleError) + } + }) + ->E.A.R.firstErrorOrOpen + ->E.R2.fmap(Belt.Map.String.fromArray) + ->E.R2.fmap(Wrappers.evRecord) + inputs->getOrError(0)->E.R.bind(Prepare.ToValueArray.Array.arrayOfArrays) + |> E.R2.bind(convertInternalItems) + }, + (), + ), ], (), ), @@ -481,30 +528,43 @@ to(5,10) ~name="List.make", ~definitions=[ //Todo: If the second item is a function with no args, it could be nice to run this function and return the result. - FnDefinition.make(~name="listMake", ~inputs=[FRTypeNumber, FRTypeAny], ~run=(inputs, _) => { - switch inputs { - | [FRValueNumber(number), value] => - Belt.Array.make(E.Float.toInt(number), value) - ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) - ->Wrappers.evArray - ->Ok - | _ => Error(impossibleError) - } - }), + FnDefinition.make( + ~nameSpace=Some("List"), + ~requiresNamespace=true, + ~name="make", + ~inputs=[FRTypeNumber, FRTypeAny], + ~run=(inputs, _) => { + switch inputs { + | [FRValueNumber(number), value] => + Belt.Array.make(E.Float.toInt(number), value) + ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) + ->Wrappers.evArray + ->Ok + | _ => Error(impossibleError) + } + }, + (), + ), ], (), ), Function.make( ~name="upTo", ~definitions=[ - FnDefinition.make(~name="upTo", ~inputs=[FRTypeNumber, FRTypeNumber], ~run=(inputs, _) => - inputs - ->Prepare.ToValueTuple.twoNumbers - ->E.R2.fmap(((low, high)) => - E.A.Floats.range(low, high, (high -. low +. 1.0)->E.Float.toInt) - ->E.A2.fmap(Wrappers.evNumber) - ->Wrappers.evArray - ) + FnDefinition.make( + ~nameSpace=Some("List"), + ~requiresNamespace=true, + ~name="upTo", + ~inputs=[FRTypeNumber, FRTypeNumber], + ~run=(inputs, _) => + inputs + ->Prepare.ToValueTuple.twoNumbers + ->E.R2.fmap(((low, high)) => + E.A.Floats.range(low, high, (high -. low +. 1.0)->E.Float.toInt) + ->E.A2.fmap(Wrappers.evNumber) + ->Wrappers.evArray + ), + (), ), ], (), From c866cc812a5802ba1a8a90ae163356243940fe23 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 7 Jul 2022 18:09:41 -0700 Subject: [PATCH 004/203] wip --- .../FunctionRegistry_Core.res | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index be94ea99..202b11ff 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -329,6 +329,12 @@ module FnDefinition = { } } + let toFfiFn = (t: t): Reducer_Expression_T.optionFfiFn => + (args, environment) => run(t, args, environment)->E.R.toOption + + let toLambda = (t: t) => + Reducer_Module.convertOptionToFfiFn(t.name, toFfiFn(t))->Reducer_Module.eLambdaFFIValue + let make = (~nameSpace=None, ~requiresNamespace=true, ~name, ~inputs, ~run, ()): t => { name: name, nameSpace: nameSpace, @@ -368,6 +374,7 @@ module Function = { module Registry = { let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) + let definitions = (r: registry) => r->E.A2.fmap(d => d.definitions)->E.A.concatMany /* There's a (potential+minor) bug here: If a function definition is called outside of the calls @@ -398,4 +405,27 @@ module Registry = { | _ => None } } + + let allNamespaces = (t: registry) => + t + ->E.A2.fmap(r => r.definitions) + ->Belt.Array.concatMany + ->E.A2.fmap(r => r.nameSpace) + ->E.A.O.concatSomes + ->E.A.uniq + + let makeModules = (t: registry) => { + let nameSpaces = allNamespaces(t) + nameSpaces->E.A2.fmap(nameSpace => { + let definitions = t->definitions->E.A2.filter(d => d.nameSpace === Some(nameSpace)) + + // E.A.reduce(definitions, Reducer_Module.emptyStdLib, (acc, d) => { + // let name = d.name + // let definition = FnDefinition.toLambda(d) + // let foo = Reducer_Module.defineFunction("Fhi", definition) + // }) + // let module = Module.make(nameSpace, functions) + // module + }) + } } From 7afae96cf487416b3b81eb784f3f3954876a858c Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 7 Jul 2022 18:30:56 -0700 Subject: [PATCH 005/203] Simple integration of module functionality --- .../FunctionRegistry_Core.res | 20 +++++++++---------- .../FunctionRegistry_Library.res | 2 +- .../SquiggleLibrary/SquiggleLibrary_Math.res | 4 +++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 202b11ff..923ea0b1 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -414,18 +414,18 @@ module Registry = { ->E.A.O.concatSomes ->E.A.uniq - let makeModules = (t: registry) => { + let makeModules = (prevBindings: Reducer_Module.t, t: registry): Reducer_Module.t => { let nameSpaces = allNamespaces(t) - nameSpaces->E.A2.fmap(nameSpace => { + let nameSpaceBindings = nameSpaces->E.A2.fmap(nameSpace => { let definitions = t->definitions->E.A2.filter(d => d.nameSpace === Some(nameSpace)) - - // E.A.reduce(definitions, Reducer_Module.emptyStdLib, (acc, d) => { - // let name = d.name - // let definition = FnDefinition.toLambda(d) - // let foo = Reducer_Module.defineFunction("Fhi", definition) - // }) - // let module = Module.make(nameSpace, functions) - // module + + let newModule = E.A.reduce(definitions, Reducer_Module.emptyStdLib, (acc, d) => { + acc->Reducer_Module.defineFunction(d.name, FnDefinition.toFfiFn(d)) + }) + (nameSpace, newModule) }) + E.A.reduce(nameSpaceBindings, prevBindings, (acc, (name, fn)) => + acc->Reducer_Module.defineModule(name, fn) + ) } } diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 780356dc..e44bfb92 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -72,7 +72,7 @@ let registry = [ ~requiresNamespace=true, ~name="makeDiscrete", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), (), ), ], diff --git a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res index d85927a1..436ed1fe 100644 --- a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res +++ b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res @@ -20,4 +20,6 @@ let mathBindings: Bindings.t = ->Bindings.fromArray let makeBindings = (previousBindings: Bindings.t): Bindings.t => - previousBindings->Bindings.defineModule("Math", mathBindings) + previousBindings + ->Bindings.defineModule("Math", mathBindings) + ->FunctionRegistry_Core.Registry.makeModules(FunctionRegistry_Library.registry) From c401f395203f8285e5976b89adea73915c160a72 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 8 Jul 2022 16:58:34 +0400 Subject: [PATCH 006/203] remove collapse animation; tooltips with types --- packages/components/package.json | 2 + .../src/components/SquiggleItem.tsx | 93 +++++++------------ .../components/src/components/ui/Tooltip.tsx | 63 +++++++++++++ yarn.lock | 48 ++++++++-- 4 files changed, 142 insertions(+), 64 deletions(-) create mode 100644 packages/components/src/components/ui/Tooltip.tsx diff --git a/packages/components/package.json b/packages/components/package.json index 5015ab35..52a4ebc0 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -3,6 +3,8 @@ "version": "0.2.20", "license": "MIT", "dependencies": { + "@floating-ui/react-dom": "^0.7.2", + "@floating-ui/react-dom-interactions": "^0.6.6", "@headlessui/react": "^1.6.5", "@heroicons/react": "^1.0.6", "@hookform/resolvers": "^2.9.3", diff --git a/packages/components/src/components/SquiggleItem.tsx b/packages/components/src/components/SquiggleItem.tsx index e68da76a..647cc08c 100644 --- a/packages/components/src/components/SquiggleItem.tsx +++ b/packages/components/src/components/SquiggleItem.tsx @@ -11,7 +11,7 @@ import { } from "./DistributionChart"; import { FunctionChart, FunctionChartSettings } from "./FunctionChart"; import clsx from "clsx"; -import { LayoutGroup, motion } from "framer-motion"; +import { Tooltip } from "./ui/Tooltip"; function getRange
(x: declaration) { const first = x.args[0]; @@ -40,59 +40,45 @@ interface VariableBoxProps { name?: string; heading: string; children: React.ReactNode; - showTypes: boolean; } const VariableBox: React.FC = ({ name, heading = "Error", children, - showTypes = false, }) => { const [isCollapsed, setIsCollapsed] = useState(false); return ( - - {name || showTypes ? ( - + {name ? ( +
setIsCollapsed(!isCollapsed)} > - {name ? {name}: : null} - {showTypes ? {heading} : null} + {name ? ( + + {name}: + + ) : null} {isCollapsed ? ( ... ) : null} - +
) : null} - {isCollapsed ? null : ( - - {children} - - )} -
+ {isCollapsed ? null :
{children}
} +
); }; const VariableList: React.FC<{ name?: string; heading: string; - showTypes: boolean; children: React.ReactNode; -}> = ({ name, heading, showTypes, children }) => ( - - - {children} - +}> = ({ name, heading, children }) => ( + +
+ {children} +
); @@ -103,8 +89,8 @@ export interface SquiggleItemProps { width?: number; height: number; distributionPlotSettings: DistributionPlottingSettings; - /** Whether to show type information */ - showTypes: boolean; + /** Whether to show type information; deprecated */ + showTypes?: boolean; /** Settings for displaying functions */ chartSettings: FunctionChartSettings; /** Environment for further function executions */ @@ -124,7 +110,7 @@ export const SquiggleItem: React.FC = ({ switch (expression.tag) { case "number": return ( - +
@@ -135,12 +121,10 @@ export const SquiggleItem: React.FC = ({ return ( - {distType === "Symbolic" && showTypes ? ( -
{expression.value.toString()}
- ) : null} = ({ } case "string": return ( - + " {expression.value} @@ -162,45 +146,45 @@ export const SquiggleItem: React.FC = ({ ); case "boolean": return ( - + {expression.value.toString()} ); case "symbol": return ( - + Undefined Symbol: {expression.value} ); case "call": return ( - + {expression.value} ); case "arraystring": return ( - + {expression.value.map((r) => `"${r}"`).join(", ")} ); case "date": return ( - + {expression.value.toDateString()} ); case "timeDuration": { return ( - + ); } case "lambda": return ( - +
{`function(${expression.value.parameters.join( "," )})`}
@@ -218,11 +202,7 @@ export const SquiggleItem: React.FC = ({ ); case "lambdaDeclaration": { return ( - + = ({ } case "module": { return ( - + {Object.entries(expression.value) .filter(([key, r]) => key !== "Math") .map(([key, r]) => ( @@ -248,7 +228,6 @@ export const SquiggleItem: React.FC = ({ expression={r} width={width !== undefined ? width - 20 : width} height={height / 3} - showTypes={showTypes} distributionPlotSettings={distributionPlotSettings} chartSettings={chartSettings} environment={environment} @@ -259,7 +238,7 @@ export const SquiggleItem: React.FC = ({ } case "record": return ( - + {Object.entries(expression.value).map(([key, r]) => ( = ({ expression={r} width={width !== undefined ? width - 20 : width} height={height / 3} - showTypes={showTypes} distributionPlotSettings={distributionPlotSettings} chartSettings={chartSettings} environment={environment} @@ -277,7 +255,7 @@ export const SquiggleItem: React.FC = ({ ); case "array": return ( - + {expression.value.map((r, i) => ( = ({ width={width !== undefined ? width - 20 : width} height={50} distributionPlotSettings={distributionPlotSettings} - showTypes={showTypes} chartSettings={chartSettings} environment={environment} /> diff --git a/packages/components/src/components/ui/Tooltip.tsx b/packages/components/src/components/ui/Tooltip.tsx new file mode 100644 index 00000000..714f8861 --- /dev/null +++ b/packages/components/src/components/ui/Tooltip.tsx @@ -0,0 +1,63 @@ +import React, { cloneElement, useState } from "react"; +import { AnimatePresence, motion } from "framer-motion"; +import { + shift, + useDismiss, + useFloating, + useHover, + useInteractions, + useRole, +} from "@floating-ui/react-dom-interactions"; + +interface Props { + text: string; + children: JSX.Element; +} + +export const Tooltip: React.FC = ({ text, children }) => { + const [open, setOpen] = useState(false); + + const { x, y, reference, floating, strategy, context } = useFloating({ + placement: "top", + open, + onOpenChange: setOpen, + middleware: [shift()], + }); + + const { getReferenceProps, getFloatingProps } = useInteractions([ + useHover(context), + useRole(context, { role: "tooltip" }), + useDismiss(context), + ]); + + return ( + <> + {cloneElement( + children, + getReferenceProps({ ref: reference, ...children.props }) + )} + + {open && ( + +
{text}
+
+ )} +
+ + ); +}; diff --git a/yarn.lock b/yarn.lock index bb697719..a9c08c38 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1829,6 +1829,35 @@ 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/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/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@^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" + "@gar/promisify@^1.0.1": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" @@ -4421,10 +4450,10 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": - version "18.0.14" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.14.tgz#e016616ffff51dba01b04945610fe3671fdbe06d" - integrity sha512-x4gGuASSiWmo0xjDLpm5mPb52syZHJx02VKbqUKdLmKtAwIh63XClGsiTI1K6DO5q7ox4xAsQrU+Gl3+gGXF9Q== +"@types/react@*", "@types/react@17.0.43", "@types/react@^18.0.9": + version "17.0.43" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.43.tgz#4adc142887dd4a2601ce730bc56c3436fdb07a55" + integrity sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -5373,6 +5402,13 @@ argv@0.0.2: resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab" integrity sha512-dEamhpPEwRUBpLNHeuCm/v+g0anFByHahxodVO/BbAarHVBBg2MccCwf9K+o1Pof+2btdnkJelYVUWjW/VrATw== +aria-hidden@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.1.3.tgz#bb48de18dc84787a3c6eee113709c473c64ec254" + integrity sha512-RhVWFtKH5BiGMycI72q2RAFMLQi8JP9bLuQXgR5a8Znp7P5KOIADSJeyfI8PCVxLEp067B2HbP5JIiI/PXIZeA== + dependencies: + tslib "^1.0.0" + aria-query@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" @@ -14872,7 +14908,7 @@ react-vega@^7.5.1: prop-types "^15.8.1" vega-embed "^6.5.1" -react@^18.0.0, react@^18.1.0: +react@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== @@ -17071,7 +17107,7 @@ tsconfig-paths@^3.14.1, tsconfig-paths@^3.9.0: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^1.8.1: +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== From a4684ddf39c5acb8564459dbaeb07c2fefb1ddf1 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 8 Jul 2022 17:09:46 +0400 Subject: [PATCH 007/203] collapse on border click --- .../src/components/SquiggleItem.tsx | 51 ++++++++++++------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/packages/components/src/components/SquiggleItem.tsx b/packages/components/src/components/SquiggleItem.tsx index 647cc08c..e9b9c2f6 100644 --- a/packages/components/src/components/SquiggleItem.tsx +++ b/packages/components/src/components/SquiggleItem.tsx @@ -48,24 +48,41 @@ const VariableBox: React.FC = ({ children, }) => { const [isCollapsed, setIsCollapsed] = useState(false); + + const toggleCollapsed = () => { + setIsCollapsed(!isCollapsed); + }; + return (
- {name ? ( -
setIsCollapsed(!isCollapsed)} - > - {name ? ( - - {name}: - - ) : null} - {isCollapsed ? ( - ... - ) : null} -
- ) : null} - {isCollapsed ? null :
{children}
} +
+ {name ? ( +
+ {name ? ( + + {name}: + + ) : null} + {isCollapsed ? ( + ... + ) : null} +
+ ) : null} + {isCollapsed ? null : ( +
+ {name ? ( +
+ ) : null} +
{children}
+
+ )} +
); }; @@ -76,7 +93,7 @@ const VariableList: React.FC<{ children: React.ReactNode; }> = ({ name, heading, children }) => ( -
+
{children}
From 3ca80daee8c43f04c6f69ad2c6504f9b60344883 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 8 Jul 2022 17:13:26 +0400 Subject: [PATCH 008/203] remove showTypes setting --- packages/components/README.md | 1 - packages/components/src/components/SquiggleChart.tsx | 4 ---- packages/components/src/components/SquiggleItem.tsx | 3 --- .../components/src/components/SquigglePlayground.tsx | 11 ----------- packages/vscode-ext/media/previewWebview.js | 1 - packages/vscode-ext/package.json | 5 ----- packages/website/src/pages/playground.js | 5 ++--- 7 files changed, 2 insertions(+), 28 deletions(-) diff --git a/packages/components/README.md b/packages/components/README.md index 63a98d34..2b911caa 100644 --- a/packages/components/README.md +++ b/packages/components/README.md @@ -54,7 +54,6 @@ export function DynamicSquiggleChart({ squiggleString }) { width={445} height={200} showSummary={true} - showTypes={true} /> ); } diff --git a/packages/components/src/components/SquiggleChart.tsx b/packages/components/src/components/SquiggleChart.tsx index bfb69a4e..fecba1fd 100644 --- a/packages/components/src/components/SquiggleChart.tsx +++ b/packages/components/src/components/SquiggleChart.tsx @@ -36,8 +36,6 @@ export interface SquiggleChartProps { jsImports?: jsImports; /** Whether to show a summary of the distribution */ showSummary?: boolean; - /** Whether to show type information about returns, default false */ - showTypes?: boolean; /** Whether to show graph controls (scale etc)*/ showControls?: boolean; /** Set the x scale to be logarithmic by deault */ @@ -58,7 +56,6 @@ export const SquiggleChart: React.FC = React.memo( jsImports = defaultImports, showSummary = false, width, - showTypes = false, showControls = false, logX = false, expY = false, @@ -97,7 +94,6 @@ export const SquiggleChart: React.FC = React.memo( width={width} height={height} distributionPlotSettings={distributionPlotSettings} - showTypes={showTypes} chartSettings={chartSettings} environment={environment ?? defaultEnvironment} /> diff --git a/packages/components/src/components/SquiggleItem.tsx b/packages/components/src/components/SquiggleItem.tsx index e9b9c2f6..6a80c42c 100644 --- a/packages/components/src/components/SquiggleItem.tsx +++ b/packages/components/src/components/SquiggleItem.tsx @@ -106,8 +106,6 @@ export interface SquiggleItemProps { width?: number; height: number; distributionPlotSettings: DistributionPlottingSettings; - /** Whether to show type information; deprecated */ - showTypes?: boolean; /** Settings for displaying functions */ chartSettings: FunctionChartSettings; /** Environment for further function executions */ @@ -120,7 +118,6 @@ export const SquiggleItem: React.FC = ({ width, height, distributionPlotSettings, - showTypes = false, chartSettings, environment, }) => { diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 301d8892..59389f17 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -32,8 +32,6 @@ interface PlaygroundProps { defaultCode?: string; /** How many pixels high is the playground */ height?: number; - /** Whether to show the types of outputs in the playground */ - showTypes?: boolean; /** Whether to show the log scale controls in the playground */ showControls?: boolean; /** Whether to show the summary table in the playground */ @@ -76,7 +74,6 @@ const schema = yup.object({}).shape({ .min(10) .max(100) .default(50), - showTypes: yup.boolean().required(), showControls: yup.boolean().required(), showSummary: yup.boolean().required(), showEditor: yup.boolean().required(), @@ -181,11 +178,6 @@ const ViewSettings: React.FC<{ register: UseFormRegister }> = ({ register={register} label="Chart Height (in pixels)" /> -
@@ -380,7 +372,6 @@ const useRunnerState = (code: string) => { export const SquigglePlayground: FC = ({ defaultCode = "", height = 500, - showTypes = false, showControls = false, showSummary = false, logX = false, @@ -404,7 +395,6 @@ export const SquigglePlayground: FC = ({ sampleCount: 1000, xyPointLength: 1000, chartHeight: 150, - showTypes, showControls, logX, expY, @@ -444,7 +434,6 @@ export const SquigglePlayground: FC = ({ diagramStop={Number(vars.diagramStop)} diagramCount={Number(vars.diagramCount)} height={vars.chartHeight} - showTypes={vars.showTypes} showControls={vars.showControls} showSummary={vars.showSummary} logX={vars.logX} diff --git a/packages/vscode-ext/media/previewWebview.js b/packages/vscode-ext/media/previewWebview.js index 556a893b..13bdbe95 100644 --- a/packages/vscode-ext/media/previewWebview.js +++ b/packages/vscode-ext/media/previewWebview.js @@ -9,7 +9,6 @@ React.createElement(squiggle_components.SquigglePlayground, { code: text, showEditor: false, - showTypes: Boolean(showSettings.showTypes), showControls: Boolean(showSettings.showControls), showSummary: Boolean(showSettings.showSummary), }) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index a0386e21..2198c538 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -105,11 +105,6 @@ "configuration": { "title": "Squiggle", "properties": { - "squiggle.playground.showTypes": { - "type": "boolean", - "default": false, - "description": "Whether to show the types of outputs in the playground" - }, "squiggle.playground.showControls": { "type": "boolean", "default": false, diff --git a/packages/website/src/pages/playground.js b/packages/website/src/pages/playground.js index 6f2fb9db..5c52a9fa 100644 --- a/packages/website/src/pages/playground.js +++ b/packages/website/src/pages/playground.js @@ -44,12 +44,11 @@ export default function PlaygroundPage() { const playgroundProps = { defaultCode: "normal(0,1)", height: 700, - showTypes: true, ...hashData, onCodeChange: (code) => setHashData({ initialSquiggleString: code }), onSettingsChange: (settings) => { - const { showTypes, showControls, showSummary, showEditor } = settings; - setHashData({ showTypes, showControls, showSummary, showEditor }); + const { showControls, showSummary, showEditor } = settings; + setHashData({ showControls, showSummary, showEditor }); }, }; return ( From 12eb63c789f43deff84c4864525c56319654c2d6 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 8 Jul 2022 18:28:12 +0400 Subject: [PATCH 009/203] SquiggleViewer refactoring; persistent collapsed settings via context --- .../src/components/SquiggleChart.tsx | 14 +-- .../ExpressionViewer.tsx} | 118 +++++------------- .../components/SquiggleViewer/VariableBox.tsx | 61 +++++++++ .../SquiggleViewer/ViewerContext.ts | 15 +++ .../src/components/SquiggleViewer/index.tsx | 79 ++++++++++++ .../src/components/SquiggleViewer/utils.ts | 6 + 6 files changed, 200 insertions(+), 93 deletions(-) rename packages/components/src/components/{SquiggleItem.tsx => SquiggleViewer/ExpressionViewer.tsx} (68%) create mode 100644 packages/components/src/components/SquiggleViewer/VariableBox.tsx create mode 100644 packages/components/src/components/SquiggleViewer/ViewerContext.ts create mode 100644 packages/components/src/components/SquiggleViewer/index.tsx create mode 100644 packages/components/src/components/SquiggleViewer/utils.ts diff --git a/packages/components/src/components/SquiggleChart.tsx b/packages/components/src/components/SquiggleChart.tsx index fecba1fd..f0adb496 100644 --- a/packages/components/src/components/SquiggleChart.tsx +++ b/packages/components/src/components/SquiggleChart.tsx @@ -10,7 +10,7 @@ import { } from "@quri/squiggle-lang"; import { useSquiggle } from "../lib/hooks"; import { SquiggleErrorAlert } from "./SquiggleErrorAlert"; -import { SquiggleItem } from "./SquiggleItem"; +import { SquiggleViewer } from "./SquiggleViewer"; export interface SquiggleChartProps { /** The input string for squiggle */ @@ -71,26 +71,22 @@ export const SquiggleChart: React.FC = React.memo( onChange, }); - if (result.tag !== "Ok") { - return ; - } - - let distributionPlotSettings = { + const distributionPlotSettings = { showControls, showSummary, logX, expY, }; - let chartSettings = { + const chartSettings = { start: diagramStart, stop: diagramStop, count: diagramCount, }; return ( - (x: declaration
) { const first = x.args[0]; @@ -36,73 +36,23 @@ function getChartSettings(x: declaration): FunctionChartSettings { }; } -interface VariableBoxProps { - name?: string; - heading: string; - children: React.ReactNode; -} - -const VariableBox: React.FC = ({ - name, - heading = "Error", - children, -}) => { - const [isCollapsed, setIsCollapsed] = useState(false); - - const toggleCollapsed = () => { - setIsCollapsed(!isCollapsed); - }; - - return ( -
-
- {name ? ( -
- {name ? ( - - {name}: - - ) : null} - {isCollapsed ? ( - ... - ) : null} -
- ) : null} - {isCollapsed ? null : ( -
- {name ? ( -
- ) : null} -
{children}
-
- )} -
-
- ); -}; - const VariableList: React.FC<{ - name?: string; + path: string[]; heading: string; children: React.ReactNode; -}> = ({ name, heading, children }) => ( - -
+}> = ({ path, heading, children }) => ( + +
{children}
); -export interface SquiggleItemProps { +export interface Props { /** The output of squiggle's run */ expression: squiggleExpression; - name?: string; + /** Path to the current item, e.g. `['foo', 'bar', '3']` for `foo.bar[3]`; can be empty on the top-level item. */ + path: string[]; width?: number; height: number; distributionPlotSettings: DistributionPlottingSettings; @@ -112,8 +62,8 @@ export interface SquiggleItemProps { environment: environment; } -export const SquiggleItem: React.FC = ({ - name, +export const ExpressionViewer: React.FC = ({ + path, expression, width, height, @@ -124,7 +74,7 @@ export const SquiggleItem: React.FC = ({ switch (expression.tag) { case "number": return ( - +
@@ -134,7 +84,7 @@ export const SquiggleItem: React.FC = ({ const distType = expression.value.type(); return ( = ({ } case "string": return ( - + " {expression.value} @@ -160,45 +110,45 @@ export const SquiggleItem: React.FC = ({ ); case "boolean": return ( - + {expression.value.toString()} ); case "symbol": return ( - + Undefined Symbol: {expression.value} ); case "call": return ( - + {expression.value} ); case "arraystring": return ( - + {expression.value.map((r) => `"${r}"`).join(", ")} ); case "date": return ( - + {expression.value.toDateString()} ); case "timeDuration": { return ( - + ); } case "lambda": return ( - +
{`function(${expression.value.parameters.join( "," )})`}
@@ -216,7 +166,7 @@ export const SquiggleItem: React.FC = ({ ); case "lambdaDeclaration": { return ( - + = ({ } case "module": { return ( - + {Object.entries(expression.value) .filter(([key, r]) => key !== "Math") .map(([key, r]) => ( - = ({ } case "record": return ( - + {Object.entries(expression.value).map(([key, r]) => ( - = ({ ); case "array": return ( - + {expression.value.map((r, i) => ( - = ({ + path, + heading = "Error", + children, +}) => { + const { setSettings, getSettings } = useContext(ViewerContext); + const [isCollapsed, setIsCollapsed] = useState( + () => getSettings(path).collapsed + ); + + const toggleCollapsed = () => { + setSettings(path, { + collapsed: !isCollapsed, + }); + setIsCollapsed(!isCollapsed); + }; + + const isTopLevel = path.length === 0; + const name = isTopLevel ? "" : path[path.length - 1]; + + return ( +
+
+ {isTopLevel ? null : ( +
+ + {name}: + + {isCollapsed ? ( + ... + ) : null} +
+ )} + {isCollapsed ? null : ( +
+ {path.length ? ( +
+ ) : null} +
{children}
+
+ )} +
+
+ ); +}; diff --git a/packages/components/src/components/SquiggleViewer/ViewerContext.ts b/packages/components/src/components/SquiggleViewer/ViewerContext.ts new file mode 100644 index 00000000..153383e7 --- /dev/null +++ b/packages/components/src/components/SquiggleViewer/ViewerContext.ts @@ -0,0 +1,15 @@ +import React from "react"; +import { ItemSettings, Path } from "./utils"; + +type ViewerContextShape = { + // Note that we don't store settings themselves in the context (that would cause rerenders of the entire tree on each settings update). + // Instead, we keep settings in local state and notify the global context via setSettings to pass them down the component tree again if it got rebuilt from scratch. + // See ./SquiggleViewer.tsx and ./VariableBox.tsx for other implementation details on this. + getSettings(path: Path): ItemSettings; + setSettings(path: Path, value: ItemSettings): void; +}; + +export const ViewerContext = React.createContext({ + getSettings: () => ({ collapsed: false }), + setSettings() {}, +}); diff --git a/packages/components/src/components/SquiggleViewer/index.tsx b/packages/components/src/components/SquiggleViewer/index.tsx new file mode 100644 index 00000000..5969c9df --- /dev/null +++ b/packages/components/src/components/SquiggleViewer/index.tsx @@ -0,0 +1,79 @@ +import React, { useCallback, useRef } from "react"; +import { environment } from "@quri/squiggle-lang"; +import { DistributionPlottingSettings } from "../DistributionChart"; +import { FunctionChartSettings } from "../FunctionChart"; +import { ExpressionViewer } from "./ExpressionViewer"; +import { ViewerContext } from "./ViewerContext"; +import { Path, pathAsString } from "./utils"; +import { useSquiggle } from "../../lib/hooks"; +import { SquiggleErrorAlert } from "../SquiggleErrorAlert"; + +type Props = { + /** The output of squiggle's run */ + result: ReturnType; + width?: number; + height: number; + distributionPlotSettings: DistributionPlottingSettings; + /** Settings for displaying functions */ + chartSettings: FunctionChartSettings; + /** Environment for further function executions */ + environment: environment; +}; + +type ItemSettings = { + collapsed: boolean; +}; + +type Settings = { + [k: string]: ItemSettings; +}; + +const defaultSettings: ItemSettings = { collapsed: false }; + +export const SquiggleViewer: React.FC = ({ + result, + width, + height, + distributionPlotSettings, + chartSettings, + environment, +}) => { + const settingsRef = useRef({}); + + const getSettings = useCallback( + (path: Path) => { + return settingsRef.current[pathAsString(path)] || defaultSettings; + }, + [settingsRef] + ); + + const setSettings = useCallback( + (path: Path, value: ItemSettings) => { + settingsRef.current[pathAsString(path)] = value; + }, + [settingsRef] + ); + + return ( + + {result.tag === "Ok" ? ( + + ) : ( + + )} + + ); +}; diff --git a/packages/components/src/components/SquiggleViewer/utils.ts b/packages/components/src/components/SquiggleViewer/utils.ts new file mode 100644 index 00000000..29648079 --- /dev/null +++ b/packages/components/src/components/SquiggleViewer/utils.ts @@ -0,0 +1,6 @@ +export type ItemSettings = { + collapsed: boolean; +}; +export type Path = string[]; + +export const pathAsString = (path: Path) => path.join("."); From cae59cb84b5f8f31ced946b0ff656ee08ec81e52 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 14 Jul 2022 13:31:48 -0700 Subject: [PATCH 010/203] Split up function definitions --- .../FunctionRegistry_Helpers.res | 90 -- .../FunctionRegistry_Library.res | 1232 ++++++++++------- 2 files changed, 726 insertions(+), 596 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res index dec88bca..115d5307 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res @@ -213,93 +213,3 @@ module Process = { twoValues(~fn=Helpers.wrapSymbolic(fn), ~values) } } - -module TwoArgDist = { - let process = (~fn, ~env, r) => - r - ->E.R.bind(Process.DistOrNumberToDist.twoValuesUsingSymbolicDist(~fn, ~values=_, ~env)) - ->E.R2.fmap(Wrappers.evDistribution) - - let make = (name, fn) => { - FnDefinition.make( - ~name, - ~inputs=[FRTypeDistOrNumber, FRTypeDistOrNumber], - ~run=(inputs, env) => inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env), - (), - ) - } - - let makeRecordP5P95 = (name, fn) => { - FnDefinition.make( - ~name, - ~inputs=[FRTypeRecord([("p5", FRTypeDistOrNumber), ("p95", FRTypeDistOrNumber)])], - ~run=(inputs, env) => inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), - (), - ) - } - - let makeRecordMeanStdev = (name, fn) => { - FnDefinition.make( - ~name, - ~inputs=[FRTypeRecord([("mean", FRTypeDistOrNumber), ("stdev", FRTypeDistOrNumber)])], - ~run=(inputs, env) => inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), - (), - ) - } -} - -module OneArgDist = { - let process = (~fn, ~env, r) => - r - ->E.R.bind(Process.DistOrNumberToDist.oneValueUsingSymbolicDist(~fn, ~value=_, ~env)) - ->E.R2.fmap(Wrappers.evDistribution) - - let make = (name, fn) => - FnDefinition.make( - ~name, - ~inputs=[FRTypeDistOrNumber], - ~run=(inputs, env) => inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env), - (), - ) -} - -module ArrayNumberDist = { - let make = (name, fn) => { - FnDefinition.make( - ~name, - ~inputs=[FRTypeArray(FRTypeNumber)], - ~run=(inputs, _) => - Prepare.ToTypedArray.numbers(inputs) - ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) - ->E.R.bind(fn), - (), - ) - } - let make2 = (name, fn) => { - FnDefinition.make( - ~name, - ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _) => - Prepare.ToTypedArray.numbers(inputs) - ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) - ->E.R.bind(fn), - (), - ) - } -} - -module NumberToNumber = { - let make = (name, fn) => - FnDefinition.make( - ~name, - ~inputs=[FRTypeNumber], - ~run=(inputs, _) => { - inputs - ->getOrError(0) - ->E.R.bind(Prepare.oneNumber) - ->E.R2.fmap(fn) - ->E.R2.fmap(Wrappers.evNumber) - }, - (), - ) -} diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index c3c90c40..c21ae7cd 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -49,143 +49,225 @@ let inputsTodist = (inputs: array, makeDist) => { expressionValue } -let registryStart = [ - Function.make( - ~name="toContinuousPointSet", - ~definitions=[ +module PointSet = { + let nameSpace = Some("PointSet") + let requiresNamespace = true + let library = [ + Function.make( + ~name="PointSet.makeContinuous", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace, + ~name="makeContinuous", + ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], + ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + (), + ), + ], + (), + ), + Function.make( + ~name="PointSet.makeDiscrete", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace, + ~name="makeDiscrete", + ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], + ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + (), + ), + ], + (), + ), + ] +} + +module Functionn = { + let nameSpace = Some("Function") + let library = [ + Function.make( + ~name="Function.declare", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=true, + ~name="declare", + ~inputs=[Declaration.frType], + ~run=(inputs, _) => { + inputs->getOrError(0)->E.R.bind(Declaration.fromExpressionValue) + }, + (), + ), + ], + (), + ), + ] +} + +module DistributionCreation = { + let nameSpace = Some("Dist") + module TwoArgDist = { + let process = (~fn, ~env, r) => + r + ->E.R.bind(Process.DistOrNumberToDist.twoValuesUsingSymbolicDist(~fn, ~values=_, ~env)) + ->E.R2.fmap(Wrappers.evDistribution) + + let make = (name, fn) => { FnDefinition.make( - ~nameSpace=Some("PointSet"), - ~requiresNamespace=true, - ~name="makeContinuous", - ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + ~nameSpace, + ~requiresNamespace=false, + ~name, + ~inputs=[FRTypeDistOrNumber, FRTypeDistOrNumber], + ~run=(inputs, env) => inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env), (), - ), - ], - (), - ), - Function.make( - ~name="toDiscretePointSet", - ~definitions=[ + ) + } + + let makeRecordP5P95 = (name, fn) => { FnDefinition.make( - ~nameSpace=Some("PointSet"), - ~requiresNamespace=true, - ~name="makeDiscrete", - ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + ~nameSpace, + ~requiresNamespace=false, + ~name, + ~inputs=[FRTypeRecord([("p5", FRTypeDistOrNumber), ("p95", FRTypeDistOrNumber)])], + ~run=(inputs, env) => + inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), (), - ), - ], - (), - ), - Function.make( - ~name="Declaration", - ~definitions=[ + ) + } + + let makeRecordMeanStdev = (name, fn) => { FnDefinition.make( - ~name="declareFn", - ~inputs=[Declaration.frType], - ~run=(inputs, _) => { - inputs->getOrError(0)->E.R.bind(Declaration.fromExpressionValue) - }, + ~name, + ~nameSpace, + ~requiresNamespace=false, + ~inputs=[FRTypeRecord([("mean", FRTypeDistOrNumber), ("stdev", FRTypeDistOrNumber)])], + ~run=(inputs, env) => + inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), (), - ), - ], - (), - ), - Function.make( - ~name="Normal", - ~examples=`normal(5,1) + ) + } + } + + module OneArgDist = { + let process = (~fn, ~env, r) => + r + ->E.R.bind(Process.DistOrNumberToDist.oneValueUsingSymbolicDist(~fn, ~value=_, ~env)) + ->E.R2.fmap(Wrappers.evDistribution) + + let make = (name, fn) => + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=false, + ~name, + ~inputs=[FRTypeDistOrNumber], + ~run=(inputs, env) => inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env), + (), + ) + } + let library = [ + Function.make( + ~name="Normal", + ~examples=`normal(5,1) normal({p5: 4, p95: 10}) normal({mean: 5, stdev: 2})`, - ~definitions=[ - TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)), - TwoArgDist.makeRecordP5P95("normal", r => - twoArgs(SymbolicDist.Normal.from90PercentCI, r)->Ok - ), - TwoArgDist.makeRecordMeanStdev("normal", twoArgs(SymbolicDist.Normal.make)), - ], - (), - ), - Function.make( - ~name="Lognormal", - ~examples=`lognormal(0.5, 0.8) + ~definitions=[ + TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)), + // TwoArgDist.makeRecordP5P95("normal", r => + // twoArgs(SymbolicDist.Normal.from90PercentCI, r)->Ok + // ), + // TwoArgDist.makeRecordMeanStdev("normal", twoArgs(SymbolicDist.Normal.make)), + ], + (), + ), + Function.make( + ~name="Lognormal", + ~examples=`lognormal(0.5, 0.8) lognormal({p5: 4, p95: 10}) lognormal({mean: 5, stdev: 2})`, - ~definitions=[ - TwoArgDist.make("lognormal", twoArgs(SymbolicDist.Lognormal.make)), - TwoArgDist.makeRecordP5P95("lognormal", r => - twoArgs(SymbolicDist.Lognormal.from90PercentCI, r)->Ok - ), - TwoArgDist.makeRecordMeanStdev("lognormal", twoArgs(SymbolicDist.Lognormal.fromMeanAndStdev)), - ], - (), - ), - Function.make( - ~name="Uniform", - ~examples=`uniform(10, 12)`, - ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], - (), - ), - Function.make( - ~name="Beta", - ~examples=`beta(20, 25) + ~definitions=[ + TwoArgDist.make("lognormal", twoArgs(SymbolicDist.Lognormal.make)), + TwoArgDist.makeRecordP5P95("lognormal", r => + twoArgs(SymbolicDist.Lognormal.from90PercentCI, r)->Ok + ), + TwoArgDist.makeRecordMeanStdev( + "lognormal", + twoArgs(SymbolicDist.Lognormal.fromMeanAndStdev), + ), + ], + (), + ), + Function.make( + ~name="Uniform", + ~examples=`uniform(10, 12)`, + ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], + (), + ), + Function.make( + ~name="Beta", + ~examples=`beta(20, 25) beta({mean: 0.39, stdev: 0.1})`, - ~definitions=[ - TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make)), - TwoArgDist.makeRecordMeanStdev("beta", twoArgs(SymbolicDist.Beta.fromMeanAndStdev)), - ], - (), - ), - Function.make( - ~name="Cauchy", - ~examples=`cauchy(5, 1)`, - ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], - (), - ), - Function.make( - ~name="Gamma", - ~examples=`gamma(5, 1)`, - ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], - (), - ), - Function.make( - ~name="Logistic", - ~examples=`gamma(5, 1)`, - ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], - (), - ), - Function.make( - ~name="To (Distribution)", - ~examples=`5 to 10 + ~definitions=[ + TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make)), + TwoArgDist.makeRecordMeanStdev("beta", twoArgs(SymbolicDist.Beta.fromMeanAndStdev)), + ], + (), + ), + Function.make( + ~name="Cauchy", + ~examples=`cauchy(5, 1)`, + ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], + (), + ), + Function.make( + ~name="Gamma", + ~examples=`gamma(5, 1)`, + ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], + (), + ), + Function.make( + ~name="Logistic", + ~examples=`gamma(5, 1)`, + ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], + (), + ), + Function.make( + ~name="To (Distribution)", + ~examples=`5 to 10 to(5,10) -5 to 5`, - ~definitions=[ - TwoArgDist.make("to", twoArgs(SymbolicDist.From90thPercentile.make)), - TwoArgDist.make( - "credibleIntervalToDistribution", - twoArgs(SymbolicDist.From90thPercentile.make), - ), - ], - (), - ), - Function.make( - ~name="Exponential", - ~examples=`exponential(2)`, - ~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)], - (), - ), - Function.make( - ~name="Bernoulli", - ~examples=`bernoulli(0.5)`, - ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], - (), - ), - Function.make( - ~name="PointMass", - ~examples=`pointMass(0.5)`, - ~definitions=[OneArgDist.make("pointMass", SymbolicDist.Float.makeSafe)], - (), - ), + ~definitions=[ + TwoArgDist.make("to", twoArgs(SymbolicDist.From90thPercentile.make)), + TwoArgDist.make( + "credibleIntervalToDistribution", + twoArgs(SymbolicDist.From90thPercentile.make), + ), + ], + (), + ), + Function.make( + ~name="Exponential", + ~examples=`exponential(2)`, + ~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)], + (), + ), + Function.make( + ~name="Bernoulli", + ~examples=`bernoulli(0.5)`, + ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], + (), + ), + Function.make( + ~name="PointMass", + ~examples=`pointMass(0.5)`, + ~definitions=[OneArgDist.make("pointMass", SymbolicDist.Float.makeSafe)], + (), + ), + ] +} + +let registryStart = [ Function.make( ~name="toContinuousPointSet", ~description="Converts a set of points to a continuous distribution", @@ -247,390 +329,528 @@ to(5,10) ~isExperimental=true, (), ), - Function.make( - ~name="Floor", - ~definitions=[NumberToNumber.make("floor", Js.Math.floor_float)], - (), - ), - Function.make( - ~name="Ceiling", - ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)], - (), - ), - Function.make( - ~name="Absolute Value", - ~definitions=[NumberToNumber.make("abs", Js.Math.abs_float)], - (), - ), - Function.make(~name="Exponent", ~definitions=[NumberToNumber.make("exp", Js.Math.exp)], ()), - Function.make(~name="Log", ~definitions=[NumberToNumber.make("log", Js.Math.log)], ()), - Function.make( - ~name="Log Base 10", - ~definitions=[NumberToNumber.make("log10", Js.Math.log10)], - (), - ), - Function.make(~name="Log Base 2", ~definitions=[NumberToNumber.make("log2", Js.Math.log2)], ()), - Function.make(~name="Round", ~definitions=[NumberToNumber.make("round", Js.Math.round)], ()), - Function.make( - ~name="Sum", - ~definitions=[ArrayNumberDist.make("sum", r => r->E.A.Floats.sum->Wrappers.evNumber->Ok)], - (), - ), - Function.make( - ~name="Product", - ~definitions=[ - ArrayNumberDist.make("product", r => r->E.A.Floats.product->Wrappers.evNumber->Ok), - ], - (), - ), - Function.make( - ~name="Min", - ~definitions=[ArrayNumberDist.make("min", r => r->E.A.Floats.min->Wrappers.evNumber->Ok)], - (), - ), - Function.make( - ~name="Max", - ~definitions=[ArrayNumberDist.make("max", r => r->E.A.Floats.max->Wrappers.evNumber->Ok)], - (), - ), - Function.make( - ~name="Mean", - ~definitions=[ArrayNumberDist.make("mean", r => r->E.A.Floats.mean->Wrappers.evNumber->Ok)], - (), - ), - Function.make( - ~name="Geometric Mean", - ~definitions=[ - ArrayNumberDist.make("geomean", r => r->E.A.Floats.geomean->Wrappers.evNumber->Ok), - ], - (), - ), - Function.make( - ~name="Standard Deviation", - ~definitions=[ArrayNumberDist.make("stdev", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok)], - (), - ), - Function.make( - ~name="Variance", - ~definitions=[ - ArrayNumberDist.make("variance", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok), - ], - (), - ), - Function.make( - ~name="First", - ~definitions=[ - ArrayNumberDist.make2("first", r => - r->E.A.first |> E.O.toResult(impossibleError) |> E.R.fmap(Wrappers.evNumber) - ), - ], - (), - ), - Function.make( - ~name="Last", - ~definitions=[ - ArrayNumberDist.make2("last", r => - r->E.A.last |> E.O.toResult(impossibleError) |> E.R.fmap(Wrappers.evNumber) - ), - ], - (), - ), - Function.make( - ~name="Sort", - ~definitions=[ - ArrayNumberDist.make("sort", r => - r->E.A.Floats.sort->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok - ), - ], - (), - ), - Function.make( - ~name="Reverse", - ~definitions=[ - ArrayNumberDist.make("reverse", r => - r->Belt_Array.reverse->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok - ), - ], - (), - ), - Function.make( - ~name="Cumulative Sum", - ~definitions=[ - ArrayNumberDist.make("cumsum", r => - r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok - ), - ], - (), - ), - Function.make( - ~name="Cumulative Prod", - ~definitions=[ - ArrayNumberDist.make("cumprod", r => - r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok - ), - ], - (), - ), - Function.make( - ~name="Diff", - ~definitions=[ - ArrayNumberDist.make("diff", r => - r->E.A.Floats.diff->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok - ), - ], - (), - ), - Function.make( - ~name="Dict.merge", - ~definitions=[ - FnDefinition.make( - ~nameSpace=Some("Dict"), - ~requiresNamespace=true, - ~name="merge", - ~inputs=[FRTypeDict(FRTypeAny), FRTypeDict(FRTypeAny)], - ~run=(inputs, _) => { - switch inputs { - | [FRValueDict(d1), FRValueDict(d2)] => { - let newDict = - E.Dict.concat(d1, d2) |> Js.Dict.map((. r) => - FunctionRegistry_Core.FRType.matchReverse(r) - ) - newDict->Js.Dict.entries->Belt.Map.String.fromArray->Wrappers.evRecord->Ok - } - | _ => Error(impossibleError) - } - }, - (), - ), - ], - (), - ), - //TODO: Make sure that two functions can't have the same name. This causes chaos elsewhere. - Function.make( - ~name="Dict.mergeMany", - ~definitions=[ - FnDefinition.make( - ~nameSpace=Some("Dict"), - ~requiresNamespace=true, - ~name="mergeMany", - ~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))], - ~run=(inputs, _) => - inputs - ->Prepare.ToTypedArray.dicts - ->E.R2.fmap(E.Dict.concatMany) - ->E.R2.fmap(Js.Dict.map((. r) => FunctionRegistry_Core.FRType.matchReverse(r))) - ->E.R2.fmap(r => r->Js.Dict.entries->Belt.Map.String.fromArray) - ->E.R2.fmap(Wrappers.evRecord), - (), - ), - ], - (), - ), - Function.make( - ~name="Dict.keys", - ~definitions=[ - FnDefinition.make( - ~nameSpace=Some("Dict"), - ~requiresNamespace=true, - ~name="keys", - ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _) => - switch inputs { - | [FRValueDict(d1)] => - Js.Dict.keys(d1)->E.A2.fmap(Wrappers.evString)->Wrappers.evArray->Ok - | _ => Error(impossibleError) - }, - (), - ), - ], - (), - ), - Function.make( - ~name="Dict.values", - ~definitions=[ - FnDefinition.make( - ~nameSpace=Some("Dict"), - ~requiresNamespace=true, - ~name="values", - ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _) => - switch inputs { - | [FRValueDict(d1)] => - Js.Dict.values(d1) - ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) - ->Wrappers.evArray - ->Ok - | _ => Error(impossibleError) - }, - (), - ), - ], - (), - ), - Function.make( - ~name="Dict.toList", - ~definitions=[ - FnDefinition.make( - ~nameSpace=Some("Dict"), - ~requiresNamespace=true, - ~name="toList", - ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _) => - switch inputs { - | [FRValueDict(dict)] => - dict - ->Js.Dict.entries - ->E.A2.fmap(((key, value)) => - Wrappers.evArray([ - Wrappers.evString(key), - FunctionRegistry_Core.FRType.matchReverse(value), - ]) - ) - ->Wrappers.evArray - ->Ok - | _ => Error(impossibleError) - }, - (), - ), - ], - (), - ), - Function.make( - ~name="Dict.fromList", - ~definitions=[ - FnDefinition.make( - ~nameSpace=Some("Dict"), - ~requiresNamespace=true, - ~name="fromList", - ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], - ~run=(inputs, _) => { - let convertInternalItems = items => - items - ->E.A2.fmap(item => { - switch item { - | [FRValueString(string), value] => - (string, FunctionRegistry_Core.FRType.matchReverse(value))->Ok - | _ => Error(impossibleError) - } - }) - ->E.A.R.firstErrorOrOpen - ->E.R2.fmap(Belt.Map.String.fromArray) - ->E.R2.fmap(Wrappers.evRecord) - inputs->getOrError(0)->E.R.bind(Prepare.ToValueArray.Array.arrayOfArrays) - |> E.R2.bind(convertInternalItems) - }, - (), - ), - ], - (), - ), - Function.make( - ~name="List.make", - ~definitions=[ - //Todo: If the second item is a function with no args, it could be nice to run this function and return the result. - FnDefinition.make( - ~nameSpace=Some("List"), - ~requiresNamespace=true, - ~name="make", - ~inputs=[FRTypeNumber, FRTypeAny], - ~run=(inputs, _) => { - switch inputs { - | [FRValueNumber(number), value] => - Belt.Array.make(E.Float.toInt(number), value) - ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) - ->Wrappers.evArray - ->Ok - | _ => Error(impossibleError) - } - }, - (), - ), - ], - (), - ), - Function.make( - ~name="upTo", - ~definitions=[ - FnDefinition.make( - ~nameSpace=Some("List"), - ~requiresNamespace=true, - ~name="upTo", - ~inputs=[FRTypeNumber, FRTypeNumber], - ~run=(inputs, _) => - inputs - ->Prepare.ToValueTuple.twoNumbers - ->E.R2.fmap(((low, high)) => - E.A.Floats.range(low, high, (high -. low +. 1.0)->E.Float.toInt) - ->E.A2.fmap(Wrappers.evNumber) - ->Wrappers.evArray - ), - (), - ), - ], - (), - ), ] -let runScoring = (estimate, answer, prior, env) => { - GenericDist.Score.logScore(~estimate, ~answer, ~prior, ~env) - ->E.R2.fmap(FunctionRegistry_Helpers.Wrappers.evNumber) - ->E.R2.errMap(DistributionTypes.Error.toString) +module Number = { + let nameSpace = Some("Number") + let requiresNamespace = false + + module NumberToNumber = { + let make = (name, fn) => + FnDefinition.make( + ~nameSpace, + ~requiresNamespace, + ~name, + ~inputs=[FRTypeNumber], + ~run=(inputs, _) => { + inputs + ->getOrError(0) + ->E.R.bind(Prepare.oneNumber) + ->E.R2.fmap(fn) + ->E.R2.fmap(Wrappers.evNumber) + }, + (), + ) + } + + module ArrayNumberDist = { + let make = (name, fn) => { + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=false, + ~name, + ~inputs=[FRTypeArray(FRTypeNumber)], + ~run=(inputs, _) => + Prepare.ToTypedArray.numbers(inputs) + ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) + ->E.R.bind(fn), + (), + ) + } + let make2 = (name, fn) => { + FnDefinition.make( + ~name, + ~inputs=[FRTypeArray(FRTypeAny)], + ~run=(inputs, _) => + Prepare.ToTypedArray.numbers(inputs) + ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) + ->E.R.bind(fn), + (), + ) + } + } + + let library = [ + Function.make( + ~name="Floor", + ~definitions=[NumberToNumber.make("floor", Js.Math.floor_float)], + (), + ), + Function.make( + ~name="Ceiling", + ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)], + (), + ), + Function.make( + ~name="Absolute Value", + ~definitions=[NumberToNumber.make("abs", Js.Math.abs_float)], + (), + ), + Function.make(~name="Exponent", ~definitions=[NumberToNumber.make("exp", Js.Math.exp)], ()), + Function.make(~name="Log", ~definitions=[NumberToNumber.make("log", Js.Math.log)], ()), + Function.make( + ~name="Log Base 10", + ~definitions=[NumberToNumber.make("log10", Js.Math.log10)], + (), + ), + Function.make(~name="Log Base 2", ~definitions=[NumberToNumber.make("log2", Js.Math.log2)], ()), + Function.make(~name="Round", ~definitions=[NumberToNumber.make("round", Js.Math.round)], ()), + Function.make( + ~name="Sum", + ~definitions=[ArrayNumberDist.make("sum", r => r->E.A.Floats.sum->Wrappers.evNumber->Ok)], + (), + ), + Function.make( + ~name="Product", + ~definitions=[ + ArrayNumberDist.make("product", r => r->E.A.Floats.product->Wrappers.evNumber->Ok), + ], + (), + ), + Function.make( + ~name="Min", + ~definitions=[ArrayNumberDist.make("min", r => r->E.A.Floats.min->Wrappers.evNumber->Ok)], + (), + ), + Function.make( + ~name="Max", + ~definitions=[ArrayNumberDist.make("max", r => r->E.A.Floats.max->Wrappers.evNumber->Ok)], + (), + ), + Function.make( + ~name="Mean", + ~definitions=[ArrayNumberDist.make("mean", r => r->E.A.Floats.mean->Wrappers.evNumber->Ok)], + (), + ), + Function.make( + ~name="Geometric Mean", + ~definitions=[ + ArrayNumberDist.make("geomean", r => r->E.A.Floats.geomean->Wrappers.evNumber->Ok), + ], + (), + ), + Function.make( + ~name="Standard Deviation", + ~definitions=[ArrayNumberDist.make("stdev", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok)], + (), + ), + Function.make( + ~name="Variance", + ~definitions=[ + ArrayNumberDist.make("variance", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok), + ], + (), + ), + Function.make( + ~name="Sort", + ~definitions=[ + ArrayNumberDist.make("sort", r => + r->E.A.Floats.sort->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + ), + ], + (), + ), + Function.make( + ~name="Cumulative Sum", + ~definitions=[ + ArrayNumberDist.make("cumsum", r => + r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + ), + ], + (), + ), + Function.make( + ~name="Cumulative Prod", + ~definitions=[ + ArrayNumberDist.make("cumprod", r => + r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + ), + ], + (), + ), + Function.make( + ~name="Diff", + ~definitions=[ + ArrayNumberDist.make("diff", r => + r->E.A.Floats.diff->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + ), + ], + (), + ), + ] } -let scoreFunctions = [ - Function.make( - ~name="Score", - ~definitions=[ - FnDefinition.make( - ~name="logScore", - ~inputs=[ - FRTypeRecord([ - ("estimate", FRTypeDist), - ("answer", FRTypeDistOrNumber), - ("prior", FRTypeDist), - ]), - ], - ~run=(inputs, env) => { - switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.threeArgs(inputs) { - | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueDist(d)), FRValueDist(prior)]) => - runScoring(estimate, Score_Dist(d), Some(prior), env) - | Ok([ - FRValueDist(estimate), - FRValueDistOrNumber(FRValueNumber(d)), - FRValueDist(prior), - ]) => - runScoring(estimate, Score_Scalar(d), Some(prior), env) - | Error(e) => Error(e) - | _ => Error(FunctionRegistry_Helpers.impossibleError) - } - }, - ), - FnDefinition.make( - ~name="logScore", - ~inputs=[FRTypeRecord([("estimate", FRTypeDist), ("answer", FRTypeDistOrNumber)])], - ~run=(inputs, env) => { - switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs(inputs) { - | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueDist(d))]) => - runScoring(estimate, Score_Dist(d), None, env) - | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueNumber(d))]) => - runScoring(estimate, Score_Scalar(d), None, env) - | Error(e) => Error(e) - | _ => Error(FunctionRegistry_Helpers.impossibleError) - } - }, - ), - FnDefinition.make(~name="klDivergence", ~inputs=[FRTypeDist, FRTypeDist], ~run=( - inputs, - env, - ) => { - switch inputs { - | [FRValueDist(estimate), FRValueDist(d)] => runScoring(estimate, Score_Dist(d), None, env) - | _ => Error(FunctionRegistry_Helpers.impossibleError) - } - }), - ], - (), - ), -] +module Dict = { + let nameSpace = Some("Dict") + let library = [ + Function.make( + ~name="merge", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=true, + ~name="merge", + ~inputs=[FRTypeDict(FRTypeAny), FRTypeDict(FRTypeAny)], + ~run=(inputs, _) => { + switch inputs { + | [FRValueDict(d1), FRValueDict(d2)] => { + let newDict = + E.Dict.concat(d1, d2) |> Js.Dict.map((. r) => + FunctionRegistry_Core.FRType.matchReverse(r) + ) + newDict->Js.Dict.entries->Belt.Map.String.fromArray->Wrappers.evRecord->Ok + } + | _ => Error(impossibleError) + } + }, + (), + ), + ], + (), + ), + //TODO: Make sure that two functions can't have the same name. This causes chaos elsewhere. + Function.make( + ~name="mergeMany", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=true, + ~name="mergeMany", + ~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))], + ~run=(inputs, _) => + inputs + ->Prepare.ToTypedArray.dicts + ->E.R2.fmap(E.Dict.concatMany) + ->E.R2.fmap(Js.Dict.map((. r) => FunctionRegistry_Core.FRType.matchReverse(r))) + ->E.R2.fmap(r => r->Js.Dict.entries->Belt.Map.String.fromArray) + ->E.R2.fmap(Wrappers.evRecord), + (), + ), + ], + (), + ), + Function.make( + ~name="keys", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=true, + ~name="keys", + ~inputs=[FRTypeDict(FRTypeAny)], + ~run=(inputs, _) => + switch inputs { + | [FRValueDict(d1)] => + Js.Dict.keys(d1)->E.A2.fmap(Wrappers.evString)->Wrappers.evArray->Ok + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="values", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=true, + ~name="values", + ~inputs=[FRTypeDict(FRTypeAny)], + ~run=(inputs, _) => + switch inputs { + | [FRValueDict(d1)] => + Js.Dict.values(d1) + ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) + ->Wrappers.evArray + ->Ok + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="toList", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=true, + ~name="toList", + ~inputs=[FRTypeDict(FRTypeAny)], + ~run=(inputs, _) => + switch inputs { + | [FRValueDict(dict)] => + dict + ->Js.Dict.entries + ->E.A2.fmap(((key, value)) => + Wrappers.evArray([ + Wrappers.evString(key), + FunctionRegistry_Core.FRType.matchReverse(value), + ]) + ) + ->Wrappers.evArray + ->Ok + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="fromList", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=true, + ~name="fromList", + ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], + ~run=(inputs, _) => { + let convertInternalItems = items => + items + ->E.A2.fmap(item => { + switch item { + | [FRValueString(string), value] => + (string, FunctionRegistry_Core.FRType.matchReverse(value))->Ok + | _ => Error(impossibleError) + } + }) + ->E.A.R.firstErrorOrOpen + ->E.R2.fmap(Belt.Map.String.fromArray) + ->E.R2.fmap(Wrappers.evRecord) + inputs->getOrError(0)->E.R.bind(Prepare.ToValueArray.Array.arrayOfArrays) + |> E.R2.bind(convertInternalItems) + }, + (), + ), + ], + (), + ), + ] +} -let registry = E.A.append(registryStart, scoreFunctions) +module List = { + let nameSpace = Some("List") + let requiresNamespace = true + + let library = [ + Function.make( + ~name="List.make", + ~definitions=[ + //Todo: If the second item is a function with no args, it could be nice to run this function and return the result. + FnDefinition.make( + ~nameSpace, + ~requiresNamespace, + ~name="make", + ~inputs=[FRTypeNumber, FRTypeAny], + ~run=(inputs, _) => { + switch inputs { + | [FRValueNumber(number), value] => + Belt.Array.make(E.Float.toInt(number), value) + ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) + ->Wrappers.evArray + ->Ok + | _ => Error(impossibleError) + } + }, + (), + ), + ], + (), + ), + Function.make( + ~name="List.upTo", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace, + ~name="upTo", + ~inputs=[FRTypeNumber, FRTypeNumber], + ~run=(inputs, _) => + inputs + ->Prepare.ToValueTuple.twoNumbers + ->E.R2.fmap(((low, high)) => + E.A.Floats.range(low, high, (high -. low +. 1.0)->E.Float.toInt) + ->E.A2.fmap(Wrappers.evNumber) + ->Wrappers.evArray + ), + (), + ), + ], + (), + ), + Function.make( + ~name="List.first", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace, + ~name="first", + ~inputs=[FRTypeArray(FRTypeAny)], + ~run=(inputs, _) => + switch inputs { + | [FRValueArray(array)] => + E.A.first(array) + |> E.O.toResult("No first element") + |> E.R.fmap(FunctionRegistry_Core.FRType.matchReverse) + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="List.last", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=false, + ~name="last", + ~inputs=[FRTypeArray(FRTypeAny)], + ~run=(inputs, _) => + switch inputs { + | [FRValueArray(array)] => + E.A.last(array) + |> E.O.toResult("No first element") + |> E.R.fmap(FunctionRegistry_Core.FRType.matchReverse) + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="List.reverse", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace=false, + ~name="last", + ~inputs=[FRTypeArray(FRTypeAny)], + ~run=(inputs, _) => + switch inputs { + | [FRValueArray(array)] => + Belt.Array.reverse(array) + ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) + ->Wrappers.evArray + ->Ok + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + ] +} + +module Scoring = { + let nameSpace = Some("Dist") + let requiresNamespace = false + + let runScoring = (estimate, answer, prior, env) => { + GenericDist.Score.logScore(~estimate, ~answer, ~prior, ~env) + ->E.R2.fmap(FunctionRegistry_Helpers.Wrappers.evNumber) + ->E.R2.errMap(DistributionTypes.Error.toString) + } + + let library = [ + Function.make( + ~name="logScore", + ~definitions=[ + FnDefinition.make( + ~nameSpace, + ~requiresNamespace, + ~name="logScore", + ~inputs=[ + FRTypeRecord([ + ("estimate", FRTypeDist), + ("answer", FRTypeDistOrNumber), + ("prior", FRTypeDist), + ]), + ], + ~run=(inputs, env) => { + switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.threeArgs(inputs) { + | Ok([ + FRValueDist(estimate), + FRValueDistOrNumber(FRValueDist(d)), + FRValueDist(prior), + ]) => + runScoring(estimate, Score_Dist(d), Some(prior), env) + | Ok([ + FRValueDist(estimate), + FRValueDistOrNumber(FRValueNumber(d)), + FRValueDist(prior), + ]) => + runScoring(estimate, Score_Scalar(d), Some(prior), env) + | Error(e) => Error(e) + | _ => Error(FunctionRegistry_Helpers.impossibleError) + } + }, + (), + ), + FnDefinition.make( + ~name="logScore", + ~nameSpace, + ~requiresNamespace, + ~inputs=[FRTypeRecord([("estimate", FRTypeDist), ("answer", FRTypeDistOrNumber)])], + ~run=(inputs, env) => { + switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs(inputs) { + | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueDist(d))]) => + runScoring(estimate, Score_Dist(d), None, env) + | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueNumber(d))]) => + runScoring(estimate, Score_Scalar(d), None, env) + | Error(e) => Error(e) + | _ => Error(FunctionRegistry_Helpers.impossibleError) + } + }, + (), + ), + ], + (), + ), + Function.make( + ~name="klDivergence", + ~definitions=[ + FnDefinition.make( + ~name="klDivergence", + ~nameSpace, + ~requiresNamespace, + ~inputs=[FRTypeDist, FRTypeDist], + ~run=(inputs, env) => { + switch inputs { + | [FRValueDist(estimate), FRValueDist(d)] => + runScoring(estimate, Score_Dist(d), None, env) + | _ => Error(FunctionRegistry_Helpers.impossibleError) + } + }, + (), + ), + ], + (), + ), + ] +} + +let registry = Belt.Array.concatMany([ + PointSet.library, + Functionn.library, + Number.library, + Dict.library, + List.library, + DistributionCreation.library, + Scoring.library, +]) From feb198d20553e316cb0f281191f0bafedabdaa54 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 14 Jul 2022 14:53:53 -0700 Subject: [PATCH 011/203] Add and use extra pathway for FunctionRegistry to use internalValues directly --- .../FunctionRegistry_Core.res | 4 +- .../FunctionRegistry_Library.res | 164 ++++++++++-------- 2 files changed, 89 insertions(+), 79 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 8a3c28ec..51247fde 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -44,7 +44,7 @@ type fnDefinition = { requiresNamespace: bool, name: string, inputs: array, - run: (array, GenericDist.env) => result, + run: (array, array, GenericDist.env)=> result } type function = { @@ -327,7 +327,7 @@ module FnDefinition = { let run = (t: t, args: array, env: GenericDist.env) => { let argValues = FRType.matchWithExpressionValueArray(t.inputs, args) switch argValues { - | Some(values) => t.run(values, env) + | Some(values) => t.run(args, values, env) | None => Error("Incorrect Types") } } diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index c21ae7cd..efb8d584 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -61,7 +61,7 @@ module PointSet = { ~requiresNamespace, ~name="makeContinuous", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + ~run=(_, inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), (), ), ], @@ -75,7 +75,7 @@ module PointSet = { ~requiresNamespace, ~name="makeDiscrete", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + ~run=(_, inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), (), ), ], @@ -95,7 +95,7 @@ module Functionn = { ~requiresNamespace=true, ~name="declare", ~inputs=[Declaration.frType], - ~run=(inputs, _) => { + ~run=(_, inputs, _) => { inputs->getOrError(0)->E.R.bind(Declaration.fromExpressionValue) }, (), @@ -120,7 +120,7 @@ module DistributionCreation = { ~requiresNamespace=false, ~name, ~inputs=[FRTypeDistOrNumber, FRTypeDistOrNumber], - ~run=(inputs, env) => inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env), + ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env), (), ) } @@ -131,7 +131,7 @@ module DistributionCreation = { ~requiresNamespace=false, ~name, ~inputs=[FRTypeRecord([("p5", FRTypeDistOrNumber), ("p95", FRTypeDistOrNumber)])], - ~run=(inputs, env) => + ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), (), ) @@ -143,7 +143,7 @@ module DistributionCreation = { ~nameSpace, ~requiresNamespace=false, ~inputs=[FRTypeRecord([("mean", FRTypeDistOrNumber), ("stdev", FRTypeDistOrNumber)])], - ~run=(inputs, env) => + ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), (), ) @@ -162,7 +162,7 @@ module DistributionCreation = { ~requiresNamespace=false, ~name, ~inputs=[FRTypeDistOrNumber], - ~run=(inputs, env) => inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env), + ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env), (), ) } @@ -281,7 +281,7 @@ let registryStart = [ FnDefinition.make( ~name="toContinuousPointSet", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + ~run=(_, inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), (), ), ], @@ -300,7 +300,7 @@ let registryStart = [ FnDefinition.make( ~name="toDiscretePointSet", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + ~run=(_, inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), (), ), ], @@ -320,7 +320,7 @@ let registryStart = [ FnDefinition.make( ~name="declareFn", ~inputs=[Declaration.frType], - ~run=(inputs, _) => { + ~run=(_, inputs, _) => { inputs->E.A.unsafe_get(0)->Declaration.fromExpressionValue }, (), @@ -342,7 +342,7 @@ module Number = { ~requiresNamespace, ~name, ~inputs=[FRTypeNumber], - ~run=(inputs, _) => { + ~run=(_, inputs, _) => { inputs ->getOrError(0) ->E.R.bind(Prepare.oneNumber) @@ -360,7 +360,7 @@ module Number = { ~requiresNamespace=false, ~name, ~inputs=[FRTypeArray(FRTypeNumber)], - ~run=(inputs, _) => + ~run=(_, inputs, _) => Prepare.ToTypedArray.numbers(inputs) ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) ->E.R.bind(fn), @@ -371,7 +371,7 @@ module Number = { FnDefinition.make( ~name, ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _) => + ~run=(_, inputs, _) => Prepare.ToTypedArray.numbers(inputs) ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) ->E.R.bind(fn), @@ -492,6 +492,32 @@ module Number = { module Dict = { let nameSpace = Some("Dict") + module Internals = { + type t = ReducerInterface_InternalExpressionValue.map + + let keys = (a: t): internalExpressionValue => IEvArray( + Belt.Map.String.keysToArray(a)->E.A2.fmap(Wrappers.evString), + ) + + let values = (a: t): internalExpressionValue => IEvArray(Belt.Map.String.valuesToArray(a)) + + let toList = (a: t): internalExpressionValue => + Belt.Map.String.toArray(a) + ->E.A2.fmap(((key, value)) => Wrappers.evArray([IEvString(key), value])) + ->Wrappers.evArray + + let merge = (a: t, b: t): internalExpressionValue => IEvRecord( + Belt.Map.String.merge(a, b, (_, _, c) => c), + ) + + //Belt.Map.String has a function for mergeMany, but I couldn't understand how to use it yet. + let mergeMany = (a: array): internalExpressionValue => { + let mergedValues = + a->E.A2.fmap(Belt.Map.String.toArray)->Belt.Array.concatMany->Belt.Map.String.fromArray + IEvRecord(mergedValues) + } + } + let library = [ Function.make( ~name="merge", @@ -501,15 +527,9 @@ module Dict = { ~requiresNamespace=true, ~name="merge", ~inputs=[FRTypeDict(FRTypeAny), FRTypeDict(FRTypeAny)], - ~run=(inputs, _) => { + ~run=(inputs, _, _) => { switch inputs { - | [FRValueDict(d1), FRValueDict(d2)] => { - let newDict = - E.Dict.concat(d1, d2) |> Js.Dict.map((. r) => - FunctionRegistry_Core.FRType.matchReverse(r) - ) - newDict->Js.Dict.entries->Belt.Map.String.fromArray->Wrappers.evRecord->Ok - } + | [IEvRecord(d1), IEvRecord(d2)] => Internals.merge(d1, d2)->Ok | _ => Error(impossibleError) } }, @@ -518,7 +538,7 @@ module Dict = { ], (), ), - //TODO: Make sure that two functions can't have the same name. This causes chaos elsewhere. + //TODO: Change to use new mergeMany() function. Function.make( ~name="mergeMany", ~definitions=[ @@ -527,7 +547,7 @@ module Dict = { ~requiresNamespace=true, ~name="mergeMany", ~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))], - ~run=(inputs, _) => + ~run=(_, inputs, _) => inputs ->Prepare.ToTypedArray.dicts ->E.R2.fmap(E.Dict.concatMany) @@ -547,10 +567,9 @@ module Dict = { ~requiresNamespace=true, ~name="keys", ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _) => + ~run=(inputs, _, _) => switch inputs { - | [FRValueDict(d1)] => - Js.Dict.keys(d1)->E.A2.fmap(Wrappers.evString)->Wrappers.evArray->Ok + | [IEvRecord(d1)] => Internals.keys(d1)->Ok | _ => Error(impossibleError) }, (), @@ -566,13 +585,9 @@ module Dict = { ~requiresNamespace=true, ~name="values", ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _) => + ~run=(inputs, _, _) => switch inputs { - | [FRValueDict(d1)] => - Js.Dict.values(d1) - ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) - ->Wrappers.evArray - ->Ok + | [IEvRecord(d1)] => Internals.values(d1)->Ok | _ => Error(impossibleError) }, (), @@ -588,19 +603,9 @@ module Dict = { ~requiresNamespace=true, ~name="toList", ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _) => + ~run=(inputs, _, _) => switch inputs { - | [FRValueDict(dict)] => - dict - ->Js.Dict.entries - ->E.A2.fmap(((key, value)) => - Wrappers.evArray([ - Wrappers.evString(key), - FunctionRegistry_Core.FRType.matchReverse(value), - ]) - ) - ->Wrappers.evArray - ->Ok + | [IEvRecord(dict)] => dict->Internals.toList->Ok | _ => Error(impossibleError) }, (), @@ -616,7 +621,7 @@ module Dict = { ~requiresNamespace=true, ~name="fromList", ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], - ~run=(inputs, _) => { + ~run=(_, inputs, _) => { let convertInternalItems = items => items ->E.A2.fmap(item => { @@ -644,6 +649,29 @@ module List = { let nameSpace = Some("List") let requiresNamespace = true + module Internals = { + let makeFromNumber = ( + n: float, + value: internalExpressionValue, + ): internalExpressionValue => IEvArray(Belt.Array.make(E.Float.toInt(n), value)) + + let upTo = (low: float, high: float): internalExpressionValue => IEvArray( + E.A.Floats.range(low, high, (high -. low +. 1.0)->E.Float.toInt)->E.A2.fmap( + Wrappers.evNumber, + ), + ) + + let first = (v: array): result => + v->E.A.first |> E.O.toResult("No first element") + + let last = (v: array): result => + v->E.A.last |> E.O.toResult("No last element") + + let reverse = (array: array): internalExpressionValue => IEvArray( + Belt.Array.reverse(array), + ) + } + let library = [ Function.make( ~name="List.make", @@ -654,13 +682,9 @@ module List = { ~requiresNamespace, ~name="make", ~inputs=[FRTypeNumber, FRTypeAny], - ~run=(inputs, _) => { + ~run=(inputs, _, _) => { switch inputs { - | [FRValueNumber(number), value] => - Belt.Array.make(E.Float.toInt(number), value) - ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) - ->Wrappers.evArray - ->Ok + | [IEvNumber(number), value] => Internals.makeFromNumber(number, value)->Ok | _ => Error(impossibleError) } }, @@ -677,14 +701,10 @@ module List = { ~requiresNamespace, ~name="upTo", ~inputs=[FRTypeNumber, FRTypeNumber], - ~run=(inputs, _) => + ~run=(_, inputs, _) => inputs ->Prepare.ToValueTuple.twoNumbers - ->E.R2.fmap(((low, high)) => - E.A.Floats.range(low, high, (high -. low +. 1.0)->E.Float.toInt) - ->E.A2.fmap(Wrappers.evNumber) - ->Wrappers.evArray - ), + ->E.R2.fmap(((low, high)) => Internals.upTo(low, high)), (), ), ], @@ -698,12 +718,9 @@ module List = { ~requiresNamespace, ~name="first", ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _) => + ~run=(inputs, _, _) => switch inputs { - | [FRValueArray(array)] => - E.A.first(array) - |> E.O.toResult("No first element") - |> E.R.fmap(FunctionRegistry_Core.FRType.matchReverse) + | [IEvArray(array)] => Internals.first(array) | _ => Error(impossibleError) }, (), @@ -719,12 +736,9 @@ module List = { ~requiresNamespace=false, ~name="last", ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _) => + ~run=(inputs, _, _) => switch inputs { - | [FRValueArray(array)] => - E.A.last(array) - |> E.O.toResult("No first element") - |> E.R.fmap(FunctionRegistry_Core.FRType.matchReverse) + | [IEvArray(array)] => Internals.last(array) | _ => Error(impossibleError) }, (), @@ -738,15 +752,11 @@ module List = { FnDefinition.make( ~nameSpace, ~requiresNamespace=false, - ~name="last", + ~name="reverse", ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _) => + ~run=(inputs, _, _) => switch inputs { - | [FRValueArray(array)] => - Belt.Array.reverse(array) - ->E.A2.fmap(FunctionRegistry_Core.FRType.matchReverse) - ->Wrappers.evArray - ->Ok + | [IEvArray(array)] => Internals.reverse(array)->Ok | _ => Error(impossibleError) }, (), @@ -782,7 +792,7 @@ module Scoring = { ("prior", FRTypeDist), ]), ], - ~run=(inputs, env) => { + ~run=(_, inputs, env) => { switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.threeArgs(inputs) { | Ok([ FRValueDist(estimate), @@ -807,7 +817,7 @@ module Scoring = { ~nameSpace, ~requiresNamespace, ~inputs=[FRTypeRecord([("estimate", FRTypeDist), ("answer", FRTypeDistOrNumber)])], - ~run=(inputs, env) => { + ~run=(_, inputs, env) => { switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs(inputs) { | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueDist(d))]) => runScoring(estimate, Score_Dist(d), None, env) @@ -830,7 +840,7 @@ module Scoring = { ~nameSpace, ~requiresNamespace, ~inputs=[FRTypeDist, FRTypeDist], - ~run=(inputs, env) => { + ~run=(_, inputs, env) => { switch inputs { | [FRValueDist(estimate), FRValueDist(d)] => runScoring(estimate, Score_Dist(d), None, env) From fc95253dd5046d2938208ed1370771c93407a202 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 14 Jul 2022 15:15:03 -0700 Subject: [PATCH 012/203] Cleanup of Dict Fromlist in Function Registry Library --- .../FunctionRegistry_Library.res | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index efb8d584..6fa23892 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -506,6 +506,21 @@ module Dict = { ->E.A2.fmap(((key, value)) => Wrappers.evArray([IEvString(key), value])) ->Wrappers.evArray + let fromList = (items: array): result< + internalExpressionValue, + string, + > => + items + ->E.A2.fmap(item => { + switch (item: internalExpressionValue) { + | IEvArray([IEvString(string), value]) => (string, value)->Ok + | _ => Error(impossibleError) + } + }) + ->E.A.R.firstErrorOrOpen + ->E.R2.fmap(Belt.Map.String.fromArray) + ->E.R2.fmap(Wrappers.evRecord) + let merge = (a: t, b: t): internalExpressionValue => IEvRecord( Belt.Map.String.merge(a, b, (_, _, c) => c), ) @@ -621,22 +636,11 @@ module Dict = { ~requiresNamespace=true, ~name="fromList", ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], - ~run=(_, inputs, _) => { - let convertInternalItems = items => - items - ->E.A2.fmap(item => { - switch item { - | [FRValueString(string), value] => - (string, FunctionRegistry_Core.FRType.matchReverse(value))->Ok - | _ => Error(impossibleError) - } - }) - ->E.A.R.firstErrorOrOpen - ->E.R2.fmap(Belt.Map.String.fromArray) - ->E.R2.fmap(Wrappers.evRecord) - inputs->getOrError(0)->E.R.bind(Prepare.ToValueArray.Array.arrayOfArrays) - |> E.R2.bind(convertInternalItems) - }, + ~run=(inputs, _, _) => + switch inputs { + | [IEvArray(items)] => Internals.fromList(items) + | _ => Error(impossibleError) + }, (), ), ], From c3b0009fb88526cb48e6d141c5bc98dd2337b06c Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 14 Jul 2022 16:13:22 -0700 Subject: [PATCH 013/203] Minor cleanup --- .../FunctionRegistry_Library.res | 40 ++++++------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 6fa23892..2c0238ce 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -89,6 +89,15 @@ module Functionn = { let library = [ Function.make( ~name="Function.declare", + ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", + ~examples=`declareFn({ + fn: {|a,b| a }, + inputs: [ + {min: 0, max: 100}, + {min: 30, max: 50} + ] +})`, + ~isExperimental=true, ~definitions=[ FnDefinition.make( ~nameSpace, @@ -174,10 +183,10 @@ normal({p5: 4, p95: 10}) normal({mean: 5, stdev: 2})`, ~definitions=[ TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)), - // TwoArgDist.makeRecordP5P95("normal", r => - // twoArgs(SymbolicDist.Normal.from90PercentCI, r)->Ok - // ), - // TwoArgDist.makeRecordMeanStdev("normal", twoArgs(SymbolicDist.Normal.make)), + TwoArgDist.makeRecordP5P95("normal", r => + twoArgs(SymbolicDist.Normal.from90PercentCI, r)->Ok + ), + TwoArgDist.makeRecordMeanStdev("normal", twoArgs(SymbolicDist.Normal.make)), ], (), ), @@ -306,29 +315,6 @@ let registryStart = [ ], (), ), - Function.make( - ~name="Declaration (Continuous Function)", - ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", - ~examples=`declareFn({ - fn: {|a,b| a }, - inputs: [ - {min: 0, max: 100}, - {min: 30, max: 50} - ] -})`, - ~definitions=[ - FnDefinition.make( - ~name="declareFn", - ~inputs=[Declaration.frType], - ~run=(_, inputs, _) => { - inputs->E.A.unsafe_get(0)->Declaration.fromExpressionValue - }, - (), - ), - ], - ~isExperimental=true, - (), - ), ] module Number = { From 3c396e0cccb6a3bf70ebb757a09edaba238c5184 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 14 Jul 2022 16:43:38 -0700 Subject: [PATCH 014/203] FunctionRegistry examples should be an array --- .../FunctionRegistry_Core.res | 6 +- .../FunctionRegistry_Library.res | 118 ++++++------------ 2 files changed, 42 insertions(+), 82 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 51247fde..c50a8297 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -50,7 +50,7 @@ type fnDefinition = { type function = { name: string, definitions: array, - examples: option, + examples: array, description: option, isExperimental: bool, } @@ -353,7 +353,7 @@ module Function = { type functionJson = { name: string, definitions: array, - examples: option, + examples: array, description: option, isExperimental: bool, } @@ -361,7 +361,7 @@ module Function = { let make = (~name, ~definitions, ~examples=?, ~description=?, ~isExperimental=false, ()): t => { name: name, definitions: definitions, - examples: examples, + examples: examples |> E.O.default([]), isExperimental: isExperimental, description: description, } diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 2c0238ce..465a5834 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -30,28 +30,29 @@ module Declaration = { } } -let inputsTodist = (inputs: array, makeDist) => { - let array = inputs->getOrError(0)->E.R.bind(Prepare.ToValueArray.Array.openA) - let xyCoords = - array->E.R.bind(xyCoords => - xyCoords - ->E.A2.fmap(xyCoord => - [xyCoord]->Prepare.ToValueArray.Record.twoArgs->E.R.bind(Prepare.ToValueTuple.twoNumbers) - ) - ->E.A.R.firstErrorOrOpen - ) - let expressionValue = - xyCoords - ->E.R.bind(r => r->XYShape.T.makeFromZipped->E.R2.errMap(XYShape.Error.toString)) - ->E.R2.fmap(r => ReducerInterface_InternalExpressionValue.IEvDistribution( - PointSet(makeDist(r)), - )) - expressionValue -} - module PointSet = { let nameSpace = Some("PointSet") let requiresNamespace = true + + let inputsTodist = (inputs: array, makeDist) => { + let array = inputs->getOrError(0)->E.R.bind(Prepare.ToValueArray.Array.openA) + let xyCoords = + array->E.R.bind(xyCoords => + xyCoords + ->E.A2.fmap(xyCoord => + [xyCoord]->Prepare.ToValueArray.Record.twoArgs->E.R.bind(Prepare.ToValueTuple.twoNumbers) + ) + ->E.A.R.firstErrorOrOpen + ) + let expressionValue = + xyCoords + ->E.R.bind(r => r->XYShape.T.makeFromZipped->E.R2.errMap(XYShape.Error.toString)) + ->E.R2.fmap(r => ReducerInterface_InternalExpressionValue.IEvDistribution( + PointSet(makeDist(r)), + )) + expressionValue + } + let library = [ Function.make( ~name="PointSet.makeContinuous", @@ -90,13 +91,15 @@ module Functionn = { Function.make( ~name="Function.declare", ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", - ~examples=`declareFn({ + ~examples=[ + `declareFn({ fn: {|a,b| a }, inputs: [ {min: 0, max: 100}, {min: 30, max: 50} ] })`, + ], ~isExperimental=true, ~definitions=[ FnDefinition.make( @@ -175,12 +178,11 @@ module DistributionCreation = { (), ) } + let library = [ Function.make( ~name="Normal", - ~examples=`normal(5,1) -normal({p5: 4, p95: 10}) -normal({mean: 5, stdev: 2})`, + ~examples=["normal(5,1)", "normal({p5: 4, p95: 10})", "normal({mean: 5, stdev: 2})"], ~definitions=[ TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)), TwoArgDist.makeRecordP5P95("normal", r => @@ -192,9 +194,11 @@ normal({mean: 5, stdev: 2})`, ), Function.make( ~name="Lognormal", - ~examples=`lognormal(0.5, 0.8) -lognormal({p5: 4, p95: 10}) -lognormal({mean: 5, stdev: 2})`, + ~examples=[ + "lognormal(0.5, 0.8)", + "lognormal({p5: 4, p95: 10})", + "lognormal({mean: 5, stdev: 2})" + ], ~definitions=[ TwoArgDist.make("lognormal", twoArgs(SymbolicDist.Lognormal.make)), TwoArgDist.makeRecordP5P95("lognormal", r => @@ -209,14 +213,13 @@ lognormal({mean: 5, stdev: 2})`, ), Function.make( ~name="Uniform", - ~examples=`uniform(10, 12)`, + ~examples=[`uniform(10, 12)`], ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], (), ), Function.make( ~name="Beta", - ~examples=`beta(20, 25) -beta({mean: 0.39, stdev: 0.1})`, + ~examples=[`beta(20, 25)`, `beta({mean: 0.39, stdev: 0.1})`], ~definitions=[ TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make)), TwoArgDist.makeRecordMeanStdev("beta", twoArgs(SymbolicDist.Beta.fromMeanAndStdev)), @@ -225,27 +228,25 @@ beta({mean: 0.39, stdev: 0.1})`, ), Function.make( ~name="Cauchy", - ~examples=`cauchy(5, 1)`, + ~examples=[`cauchy(5, 1)`], ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], (), ), Function.make( ~name="Gamma", - ~examples=`gamma(5, 1)`, + ~examples=[`gamma(5, 1)`], ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], (), ), Function.make( ~name="Logistic", - ~examples=`gamma(5, 1)`, + ~examples=[`logistic(5, 1)`], ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], (), ), Function.make( ~name="To (Distribution)", - ~examples=`5 to 10 -to(5,10) --5 to 5`, + ~examples=[`5 to 10`, `to(5,10)`, `-5 to 5`], ~definitions=[ TwoArgDist.make("to", twoArgs(SymbolicDist.From90thPercentile.make)), TwoArgDist.make( @@ -257,66 +258,25 @@ to(5,10) ), Function.make( ~name="Exponential", - ~examples=`exponential(2)`, + ~examples=[`exponential(2)`], ~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)], (), ), Function.make( ~name="Bernoulli", - ~examples=`bernoulli(0.5)`, + ~examples=[`bernoulli(0.5)`], ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], (), ), Function.make( ~name="PointMass", - ~examples=`pointMass(0.5)`, + ~examples=[`pointMass(0.5)`], ~definitions=[OneArgDist.make("pointMass", SymbolicDist.Float.makeSafe)], (), ), ] } -let registryStart = [ - Function.make( - ~name="toContinuousPointSet", - ~description="Converts a set of points to a continuous distribution", - ~examples=`toContinuousPointSet([ - {x: 0, y: 0.1}, - {x: 1, y: 0.2}, - {x: 2, y: 0.15}, - {x: 3, y: 0.1} -])`, - ~definitions=[ - FnDefinition.make( - ~name="toContinuousPointSet", - ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(_, inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), - (), - ), - ], - (), - ), - Function.make( - ~name="toDiscretePointSet", - ~description="Converts a set of points to a discrete distribution", - ~examples=`toDiscretePointSet([ - {x: 0, y: 0.1}, - {x: 1, y: 0.2}, - {x: 2, y: 0.15}, - {x: 3, y: 0.1} -])`, - ~definitions=[ - FnDefinition.make( - ~name="toDiscretePointSet", - ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(_, inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), - (), - ), - ], - (), - ), -] - module Number = { let nameSpace = Some("Number") let requiresNamespace = false From 3f09f5f307711fefd6e790f569cadec151b9fb78 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 14 Jul 2022 17:21:07 -0700 Subject: [PATCH 015/203] Move namespace from fnDefinition to fn --- .../FunctionRegistry_Core.res | 41 ++++--- .../FunctionRegistry_Library.res | 110 ++++++++++++------ 2 files changed, 100 insertions(+), 51 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index c50a8297..f18f493f 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -40,16 +40,20 @@ and frValueDictParam = (string, frValue) and frValueDistOrNumber = FRValueNumber(float) | FRValueDist(DistributionTypes.genericDist) type fnDefinition = { - nameSpace: option, requiresNamespace: bool, name: string, inputs: array, - run: (array, array, GenericDist.env)=> result + run: ( + array, + array, + GenericDist.env, + ) => result, } type function = { name: string, definitions: array, + nameSpace: string, examples: array, description: option, isExperimental: bool, @@ -338,9 +342,8 @@ module FnDefinition = { let toLambda = (t: t) => Reducer_Module.convertOptionToFfiFn(t.name, toFfiFn(t))->Reducer_Module.eLambdaFFIValue - let make = (~nameSpace=None, ~requiresNamespace=true, ~name, ~inputs, ~run, ()): t => { + let make = (~requiresNamespace=true, ~name, ~inputs, ~run, ()): t => { name: name, - nameSpace: nameSpace, requiresNamespace: requiresNamespace, inputs: inputs, run: run, @@ -358,8 +361,17 @@ module Function = { isExperimental: bool, } - let make = (~name, ~definitions, ~examples=?, ~description=?, ~isExperimental=false, ()): t => { + let make = ( + ~name, + ~nameSpace, + ~definitions, + ~examples=?, + ~description=?, + ~isExperimental=false, + (), + ): t => { name: name, + nameSpace: nameSpace, definitions: definitions, examples: examples |> E.O.default([]), isExperimental: isExperimental, @@ -377,7 +389,8 @@ module Function = { module Registry = { let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) - let definitions = (r: registry) => r->E.A2.fmap(d => d.definitions)->E.A.concatMany + let definitionsWithFunctions = (r: registry) => + r->E.A2.fmap(fn => fn.definitions->E.A2.fmap(def => (def, fn)))->E.A.concatMany /* There's a (potential+minor) bug here: If a function definition is called outside of the calls @@ -409,21 +422,17 @@ module Registry = { } } - let allNamespaces = (t: registry) => - t - ->E.A2.fmap(r => r.definitions) - ->Belt.Array.concatMany - ->E.A2.fmap(r => r.nameSpace) - ->E.A.O.concatSomes - ->E.A.uniq + //todo: get namespace from project. + let allNamespaces = (t: registry) => t->E.A2.fmap(r => r.nameSpace)->E.A.uniq let makeModules = (prevBindings: Reducer_Module.t, t: registry): Reducer_Module.t => { let nameSpaces = allNamespaces(t) let nameSpaceBindings = nameSpaces->E.A2.fmap(nameSpace => { - let definitions = t->definitions->E.A2.filter(d => d.nameSpace === Some(nameSpace)) + let definitions = + t->definitionsWithFunctions->E.A2.filter(((_, fn)) => fn.nameSpace === nameSpace) - let newModule = E.A.reduce(definitions, Reducer_Module.emptyStdLib, (acc, d) => { - acc->Reducer_Module.defineFunction(d.name, FnDefinition.toFfiFn(d)) + let newModule = E.A.reduce(definitions, Reducer_Module.emptyStdLib, (acc, (def, _)) => { + acc->Reducer_Module.defineFunction(def.name, FnDefinition.toFfiFn(def)) }) (nameSpace, newModule) }) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 465a5834..1d74f451 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -31,7 +31,7 @@ module Declaration = { } module PointSet = { - let nameSpace = Some("PointSet") + let nameSpace = "PointSet" let requiresNamespace = true let inputsTodist = (inputs: array, makeDist) => { @@ -56,9 +56,9 @@ module PointSet = { let library = [ Function.make( ~name="PointSet.makeContinuous", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace, ~name="makeContinuous", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], @@ -70,9 +70,9 @@ module PointSet = { ), Function.make( ~name="PointSet.makeDiscrete", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace, ~name="makeDiscrete", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], @@ -86,10 +86,11 @@ module PointSet = { } module Functionn = { - let nameSpace = Some("Function") + let nameSpace = "Function" let library = [ Function.make( ~name="Function.declare", + ~nameSpace, ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", ~examples=[ `declareFn({ @@ -103,7 +104,6 @@ module Functionn = { ~isExperimental=true, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace=true, ~name="declare", ~inputs=[Declaration.frType], @@ -119,7 +119,7 @@ module Functionn = { } module DistributionCreation = { - let nameSpace = Some("Dist") + let nameSpace = "Dist" module TwoArgDist = { let process = (~fn, ~env, r) => r @@ -128,7 +128,6 @@ module DistributionCreation = { let make = (name, fn) => { FnDefinition.make( - ~nameSpace, ~requiresNamespace=false, ~name, ~inputs=[FRTypeDistOrNumber, FRTypeDistOrNumber], @@ -139,7 +138,6 @@ module DistributionCreation = { let makeRecordP5P95 = (name, fn) => { FnDefinition.make( - ~nameSpace, ~requiresNamespace=false, ~name, ~inputs=[FRTypeRecord([("p5", FRTypeDistOrNumber), ("p95", FRTypeDistOrNumber)])], @@ -152,7 +150,6 @@ module DistributionCreation = { let makeRecordMeanStdev = (name, fn) => { FnDefinition.make( ~name, - ~nameSpace, ~requiresNamespace=false, ~inputs=[FRTypeRecord([("mean", FRTypeDistOrNumber), ("stdev", FRTypeDistOrNumber)])], ~run=(_, inputs, env) => @@ -170,7 +167,6 @@ module DistributionCreation = { let make = (name, fn) => FnDefinition.make( - ~nameSpace, ~requiresNamespace=false, ~name, ~inputs=[FRTypeDistOrNumber], @@ -182,6 +178,7 @@ module DistributionCreation = { let library = [ Function.make( ~name="Normal", + ~nameSpace, ~examples=["normal(5,1)", "normal({p5: 4, p95: 10})", "normal({mean: 5, stdev: 2})"], ~definitions=[ TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)), @@ -194,10 +191,11 @@ module DistributionCreation = { ), Function.make( ~name="Lognormal", + ~nameSpace, ~examples=[ "lognormal(0.5, 0.8)", "lognormal({p5: 4, p95: 10})", - "lognormal({mean: 5, stdev: 2})" + "lognormal({mean: 5, stdev: 2})", ], ~definitions=[ TwoArgDist.make("lognormal", twoArgs(SymbolicDist.Lognormal.make)), @@ -213,12 +211,14 @@ module DistributionCreation = { ), Function.make( ~name="Uniform", + ~nameSpace, ~examples=[`uniform(10, 12)`], ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], (), ), Function.make( ~name="Beta", + ~nameSpace, ~examples=[`beta(20, 25)`, `beta({mean: 0.39, stdev: 0.1})`], ~definitions=[ TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make)), @@ -228,24 +228,28 @@ module DistributionCreation = { ), Function.make( ~name="Cauchy", + ~nameSpace, ~examples=[`cauchy(5, 1)`], ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], (), ), Function.make( ~name="Gamma", + ~nameSpace, ~examples=[`gamma(5, 1)`], ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], (), ), Function.make( ~name="Logistic", + ~nameSpace, ~examples=[`logistic(5, 1)`], ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], (), ), Function.make( ~name="To (Distribution)", + ~nameSpace, ~examples=[`5 to 10`, `to(5,10)`, `-5 to 5`], ~definitions=[ TwoArgDist.make("to", twoArgs(SymbolicDist.From90thPercentile.make)), @@ -258,18 +262,21 @@ module DistributionCreation = { ), Function.make( ~name="Exponential", + ~nameSpace, ~examples=[`exponential(2)`], ~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)], (), ), Function.make( ~name="Bernoulli", + ~nameSpace, ~examples=[`bernoulli(0.5)`], ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], (), ), Function.make( ~name="PointMass", + ~nameSpace, ~examples=[`pointMass(0.5)`], ~definitions=[OneArgDist.make("pointMass", SymbolicDist.Float.makeSafe)], (), @@ -278,13 +285,12 @@ module DistributionCreation = { } module Number = { - let nameSpace = Some("Number") + let nameSpace = "Number" let requiresNamespace = false module NumberToNumber = { let make = (name, fn) => FnDefinition.make( - ~nameSpace, ~requiresNamespace, ~name, ~inputs=[FRTypeNumber], @@ -302,7 +308,6 @@ module Number = { module ArrayNumberDist = { let make = (name, fn) => { FnDefinition.make( - ~nameSpace, ~requiresNamespace=false, ~name, ~inputs=[FRTypeArray(FRTypeNumber)], @@ -329,35 +334,61 @@ module Number = { let library = [ Function.make( ~name="Floor", + ~nameSpace, ~definitions=[NumberToNumber.make("floor", Js.Math.floor_float)], (), ), Function.make( ~name="Ceiling", + ~nameSpace, ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)], (), ), Function.make( ~name="Absolute Value", + ~nameSpace, ~definitions=[NumberToNumber.make("abs", Js.Math.abs_float)], (), ), - Function.make(~name="Exponent", ~definitions=[NumberToNumber.make("exp", Js.Math.exp)], ()), - Function.make(~name="Log", ~definitions=[NumberToNumber.make("log", Js.Math.log)], ()), + Function.make( + ~name="Exponent", + ~nameSpace, + ~definitions=[NumberToNumber.make("exp", Js.Math.exp)], + (), + ), + Function.make( + ~name="Log", + ~nameSpace, + ~definitions=[NumberToNumber.make("log", Js.Math.log)], + (), + ), Function.make( ~name="Log Base 10", + ~nameSpace, ~definitions=[NumberToNumber.make("log10", Js.Math.log10)], (), ), - Function.make(~name="Log Base 2", ~definitions=[NumberToNumber.make("log2", Js.Math.log2)], ()), - Function.make(~name="Round", ~definitions=[NumberToNumber.make("round", Js.Math.round)], ()), + Function.make( + ~name="Log Base 2", + ~nameSpace, + ~definitions=[NumberToNumber.make("log2", Js.Math.log2)], + (), + ), + Function.make( + ~name="Round", + ~nameSpace, + ~definitions=[NumberToNumber.make("round", Js.Math.round)], + (), + ), Function.make( ~name="Sum", + ~nameSpace, ~definitions=[ArrayNumberDist.make("sum", r => r->E.A.Floats.sum->Wrappers.evNumber->Ok)], (), ), Function.make( ~name="Product", + ~nameSpace, ~definitions=[ ArrayNumberDist.make("product", r => r->E.A.Floats.product->Wrappers.evNumber->Ok), ], @@ -365,21 +396,25 @@ module Number = { ), Function.make( ~name="Min", + ~nameSpace, ~definitions=[ArrayNumberDist.make("min", r => r->E.A.Floats.min->Wrappers.evNumber->Ok)], (), ), Function.make( ~name="Max", + ~nameSpace, ~definitions=[ArrayNumberDist.make("max", r => r->E.A.Floats.max->Wrappers.evNumber->Ok)], (), ), Function.make( ~name="Mean", + ~nameSpace, ~definitions=[ArrayNumberDist.make("mean", r => r->E.A.Floats.mean->Wrappers.evNumber->Ok)], (), ), Function.make( ~name="Geometric Mean", + ~nameSpace, ~definitions=[ ArrayNumberDist.make("geomean", r => r->E.A.Floats.geomean->Wrappers.evNumber->Ok), ], @@ -387,11 +422,13 @@ module Number = { ), Function.make( ~name="Standard Deviation", + ~nameSpace, ~definitions=[ArrayNumberDist.make("stdev", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok)], (), ), Function.make( ~name="Variance", + ~nameSpace, ~definitions=[ ArrayNumberDist.make("variance", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok), ], @@ -399,6 +436,7 @@ module Number = { ), Function.make( ~name="Sort", + ~nameSpace, ~definitions=[ ArrayNumberDist.make("sort", r => r->E.A.Floats.sort->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok @@ -408,6 +446,7 @@ module Number = { ), Function.make( ~name="Cumulative Sum", + ~nameSpace, ~definitions=[ ArrayNumberDist.make("cumsum", r => r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok @@ -417,6 +456,7 @@ module Number = { ), Function.make( ~name="Cumulative Prod", + ~nameSpace, ~definitions=[ ArrayNumberDist.make("cumprod", r => r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok @@ -426,6 +466,7 @@ module Number = { ), Function.make( ~name="Diff", + ~nameSpace, ~definitions=[ ArrayNumberDist.make("diff", r => r->E.A.Floats.diff->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok @@ -437,7 +478,7 @@ module Number = { } module Dict = { - let nameSpace = Some("Dict") + let nameSpace = "Dict" module Internals = { type t = ReducerInterface_InternalExpressionValue.map @@ -482,9 +523,9 @@ module Dict = { let library = [ Function.make( ~name="merge", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace=true, ~name="merge", ~inputs=[FRTypeDict(FRTypeAny), FRTypeDict(FRTypeAny)], @@ -502,9 +543,9 @@ module Dict = { //TODO: Change to use new mergeMany() function. Function.make( ~name="mergeMany", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace=true, ~name="mergeMany", ~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))], @@ -522,9 +563,9 @@ module Dict = { ), Function.make( ~name="keys", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace=true, ~name="keys", ~inputs=[FRTypeDict(FRTypeAny)], @@ -540,9 +581,9 @@ module Dict = { ), Function.make( ~name="values", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace=true, ~name="values", ~inputs=[FRTypeDict(FRTypeAny)], @@ -558,9 +599,9 @@ module Dict = { ), Function.make( ~name="toList", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace=true, ~name="toList", ~inputs=[FRTypeDict(FRTypeAny)], @@ -576,9 +617,9 @@ module Dict = { ), Function.make( ~name="fromList", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace=true, ~name="fromList", ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], @@ -596,7 +637,7 @@ module Dict = { } module List = { - let nameSpace = Some("List") + let nameSpace = "List" let requiresNamespace = true module Internals = { @@ -625,10 +666,10 @@ module List = { let library = [ Function.make( ~name="List.make", + ~nameSpace, ~definitions=[ //Todo: If the second item is a function with no args, it could be nice to run this function and return the result. FnDefinition.make( - ~nameSpace, ~requiresNamespace, ~name="make", ~inputs=[FRTypeNumber, FRTypeAny], @@ -645,9 +686,9 @@ module List = { ), Function.make( ~name="List.upTo", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace, ~name="upTo", ~inputs=[FRTypeNumber, FRTypeNumber], @@ -662,9 +703,9 @@ module List = { ), Function.make( ~name="List.first", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace, ~name="first", ~inputs=[FRTypeArray(FRTypeAny)], @@ -680,9 +721,9 @@ module List = { ), Function.make( ~name="List.last", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace=false, ~name="last", ~inputs=[FRTypeArray(FRTypeAny)], @@ -698,9 +739,9 @@ module List = { ), Function.make( ~name="List.reverse", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace=false, ~name="reverse", ~inputs=[FRTypeArray(FRTypeAny)], @@ -718,7 +759,7 @@ module List = { } module Scoring = { - let nameSpace = Some("Dist") + let nameSpace = "Dist" let requiresNamespace = false let runScoring = (estimate, answer, prior, env) => { @@ -730,9 +771,9 @@ module Scoring = { let library = [ Function.make( ~name="logScore", + ~nameSpace, ~definitions=[ FnDefinition.make( - ~nameSpace, ~requiresNamespace, ~name="logScore", ~inputs=[ @@ -764,7 +805,6 @@ module Scoring = { ), FnDefinition.make( ~name="logScore", - ~nameSpace, ~requiresNamespace, ~inputs=[FRTypeRecord([("estimate", FRTypeDist), ("answer", FRTypeDistOrNumber)])], ~run=(_, inputs, env) => { @@ -784,10 +824,10 @@ module Scoring = { ), Function.make( ~name="klDivergence", + ~nameSpace, ~definitions=[ FnDefinition.make( ~name="klDivergence", - ~nameSpace, ~requiresNamespace, ~inputs=[FRTypeDist, FRTypeDist], ~run=(_, inputs, env) => { From 8839f1d9c727f347b873ef79a86926c28e8bd413 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 14 Jul 2022 22:14:23 -0700 Subject: [PATCH 016/203] Added FunctionRegistry test and got simple polymorphism working --- .../__tests__/FunctionRegistry_test.res | 82 +++++++++++++++++++ packages/squiggle-lang/package.json | 1 + .../FunctionRegistry_Core.res | 46 +++++++++-- .../SquiggleLibrary/SquiggleLibrary_Math.res | 1 + 4 files changed, 123 insertions(+), 7 deletions(-) create mode 100644 packages/squiggle-lang/__tests__/FunctionRegistry_test.res diff --git a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res new file mode 100644 index 00000000..e976f7b1 --- /dev/null +++ b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res @@ -0,0 +1,82 @@ +module InternalExpressionValue = ReducerInterface_InternalExpressionValue +module ExpressionT = Reducer_Expression_T +module Module = Reducer_Module +module Bindings = Reducer_Module +module ErrorValue = Reducer_ErrorValue + +open Jest +open Expect + +// ---------------------- +// --- Start of Module File +// ---------------------- + +module FooImplementation = { + open FunctionRegistry_Core + open FunctionRegistry_Helpers + + let library = [ + Function.make( + ~name="add", + ~nameSpace="Foo", + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=false, + ~name="add", + ~inputs=[FRTypeNumber, FRTypeNumber], + ~run=(_, inputs, _) => + switch inputs { + | [FRValueNumber(a), FRValueNumber(b)] => Ok(Wrappers.evNumber(a +. b)) + | _ => Error("False") + }, + (), + ), + FnDefinition.make( + ~requiresNamespace=true, + ~name="add", + ~inputs=[FRTypeNumber, FRTypeNumber, FRTypeNumber], + ~run=(_, inputs, _) => + switch inputs { + | [FRValueNumber(a), FRValueNumber(b), FRValueNumber(c)] => + Ok(Wrappers.evNumber(a +. b +. c)) + | _ => Error("False") + }, + (), + ), + ], + (), + ), + ] +} + +let makeBindings = (previousBindings: Bindings.t): Bindings.t => + previousBindings->FunctionRegistry_Core.Registry.makeModules(FooImplementation.library) + +let stdLibWithFoo = Bindings.emptyBindings->makeBindings + +let evalWithFoo = sourceCode => + Reducer_Expression.parse(sourceCode)->Belt.Result.flatMap(expr => + Reducer_Expression.reduceExpression( + expr, + stdLibWithFoo, + InternalExpressionValue.defaultEnvironment, + ) + ) + +let evalToStringResultWithFoo = sourceCode => + evalWithFoo(sourceCode)->InternalExpressionValue.toStringResult + +describe("Module", () => { + test("add(1,2)", () => { + let result = evalToStringResultWithFoo("Foo.add(1,2)") + expect(result)->toEqual("Ok(3)") + }) + test("add(1,2,3)", () => { + let result = evalToStringResultWithFoo("Foo.add(1,2,3)") + expect(result)->toEqual("Ok(6)") + }) + test("add(1,2,3,5)", () => { + let result = evalToStringResultWithFoo("Foo.add(1,2,3,5)") + expect(result)->toEqual("Ok(6)") + }) +}) \ No newline at end of file diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index b2067205..ba6449ce 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -15,6 +15,7 @@ "start": "rescript build -w -with-deps", "clean": "rescript clean && rm -rf dist", "test:reducer": "jest __tests__/Reducer*/", + "test:reducer2": "jest __tests__/FunctionRegistry_test", "benchmark": "ts-node benchmark/conversion_tests.ts", "test": "jest", "test:ts": "jest __tests__/TS/", diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index f18f493f..e0ef4441 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -328,6 +328,14 @@ module FnDefinition = { t.name ++ `(${inputs})` } + let isMatch = (t: t, args: array) => { + let argValues = FRType.matchWithExpressionValueArray(t.inputs, args) + switch argValues { + | Some(values) => true + | None => false + } + } + let run = (t: t, args: array, env: GenericDist.env) => { let argValues = FRType.matchWithExpressionValueArray(t.inputs, args) switch argValues { @@ -387,6 +395,32 @@ module Function = { } } +module NameSpace = { + type t = {name: string, functions: array} + let definitions = (t: t) => t.functions->E.A2.fmap(f => f.definitions)->E.A.concatMany + let uniqueFnNames = (t: t) => definitions(t)->E.A2.fmap(r => r.name)->E.A.uniq + let nameToDefinitions = (t: t, name: string) => definitions(t)->E.A2.filter(r => r.name == name) + + //todo: It could be good to set a warning if two definitions are both valid, but I don't expect this often. + let nameFfiFn = (t: t, name: string): Reducer_Expression_T.optionFfiFn => { + (args, environment) => { + let definitions = + nameToDefinitions(t, name)->E.A2.fmap((def, ()) => + FnDefinition.isMatch(def, args) + ? FnDefinition.run(def, args, environment) |> E.R.toOption + : None + ) + E.A.O.firstSomeFn(definitions) + } + } + + let toModule = (t: t): Reducer_Module.t => + E.A.reduce(uniqueFnNames(t), Reducer_Module.emptyStdLib, (acc, uniqueName) => { + let relevantDefinitions = nameFfiFn(t, uniqueName) + acc->Reducer_Module.defineFunction(uniqueName, relevantDefinitions) + }) +} + module Registry = { let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) let definitionsWithFunctions = (r: registry) => @@ -428,13 +462,11 @@ module Registry = { let makeModules = (prevBindings: Reducer_Module.t, t: registry): Reducer_Module.t => { let nameSpaces = allNamespaces(t) let nameSpaceBindings = nameSpaces->E.A2.fmap(nameSpace => { - let definitions = - t->definitionsWithFunctions->E.A2.filter(((_, fn)) => fn.nameSpace === nameSpace) - - let newModule = E.A.reduce(definitions, Reducer_Module.emptyStdLib, (acc, (def, _)) => { - acc->Reducer_Module.defineFunction(def.name, FnDefinition.toFfiFn(def)) - }) - (nameSpace, newModule) + let foo: NameSpace.t = { + name: nameSpace, + functions: t->E.A2.filter(r => r.nameSpace == nameSpace), + } + (nameSpace, NameSpace.toModule(foo)) }) E.A.reduce(nameSpaceBindings, prevBindings, (acc, (name, fn)) => acc->Reducer_Module.defineModule(name, fn) diff --git a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res index 436ed1fe..b7b925ed 100644 --- a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res +++ b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res @@ -19,6 +19,7 @@ let mathBindings: Bindings.t = ->E.A2.fmap(((name, v)) => (name, ReducerInterface_InternalExpressionValue.IEvNumber(v))) ->Bindings.fromArray +//TODO: This should be in a different place. let makeBindings = (previousBindings: Bindings.t): Bindings.t => previousBindings ->Bindings.defineModule("Math", mathBindings) From 9d5aaf43a8375a1c576a64658f966f2d09a46010 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 15 Jul 2022 19:18:36 -0700 Subject: [PATCH 017/203] Simple tests for fake FunctionRegistry output types --- .../__tests__/FunctionRegistry_test.res | 83 +++++++++++-------- .../FunctionRegistry_Core.res | 4 + .../FunctionRegistry_Library.res | 78 ++++++++--------- 3 files changed, 91 insertions(+), 74 deletions(-) diff --git a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res index e976f7b1..47d3005a 100644 --- a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res +++ b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res @@ -15,38 +15,40 @@ module FooImplementation = { open FunctionRegistry_Core open FunctionRegistry_Helpers - let library = [ - Function.make( - ~name="add", - ~nameSpace="Foo", - ~definitions=[ - FnDefinition.make( - ~requiresNamespace=false, - ~name="add", - ~inputs=[FRTypeNumber, FRTypeNumber], - ~run=(_, inputs, _) => - switch inputs { - | [FRValueNumber(a), FRValueNumber(b)] => Ok(Wrappers.evNumber(a +. b)) - | _ => Error("False") - }, - (), - ), - FnDefinition.make( - ~requiresNamespace=true, - ~name="add", - ~inputs=[FRTypeNumber, FRTypeNumber, FRTypeNumber], - ~run=(_, inputs, _) => - switch inputs { - | [FRValueNumber(a), FRValueNumber(b), FRValueNumber(c)] => - Ok(Wrappers.evNumber(a +. b +. c)) - | _ => Error("False") - }, - (), - ), - ], - (), - ), - ] + let fn = Function.make( + ~name="add", + ~nameSpace="Foo", + ~examples=["Foo.add(1, 2)", "Foo.add(1, 2, 3)"], + ~output=EvtNumber, + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=false, + ~name="add", + ~inputs=[FRTypeNumber, FRTypeNumber], + ~run=(_, inputs, _) => + switch inputs { + | [FRValueNumber(a), FRValueNumber(b)] => Ok(Wrappers.evNumber(a +. b)) + | _ => Error("False") + }, + (), + ), + FnDefinition.make( + ~requiresNamespace=true, + ~name="add", + ~inputs=[FRTypeNumber, FRTypeNumber, FRTypeNumber], + ~run=(_, inputs, _) => + switch inputs { + | [FRValueNumber(a), FRValueNumber(b), FRValueNumber(c)] => + Ok(Wrappers.evNumber(a +. b +. c)) + | _ => Error("False") + }, + (), + ), + ], + (), + ) + + let library = [fn] } let makeBindings = (previousBindings: Bindings.t): Bindings.t => @@ -75,8 +77,19 @@ describe("Module", () => { let result = evalToStringResultWithFoo("Foo.add(1,2,3)") expect(result)->toEqual("Ok(6)") }) - test("add(1,2,3,5)", () => { - let result = evalToStringResultWithFoo("Foo.add(1,2,3,5)") - expect(result)->toEqual("Ok(6)") +}) + +describe("Fn auto-testing", () => { + let items = FooImplementation.fn.examples->E.A.to_list + + testAll("tests of validity", items, r => { + expect(r->evalWithFoo->E.R.isOk)->toEqual(true) + }) + + testAll("tests of type", items, r => { + let responseType = + r->evalWithFoo->E.R2.fmap(ReducerInterface_InternalExpressionValue.valueToValueType) + let expectedOutputType = FooImplementation.fn.output |> E.O.toExn("") + expect(responseType)->toEqual(Ok(expectedOutputType)) }) }) \ No newline at end of file diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index e0ef4441..d2d2a080 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -1,4 +1,5 @@ type internalExpressionValue = ReducerInterface_InternalExpressionValue.t +type internalExpressionValueType = ReducerInterface_InternalExpressionValue.internalExpressionValueType /* Function Registry "Type". A type, without any other information. @@ -54,6 +55,7 @@ type function = { name: string, definitions: array, nameSpace: string, + output: option, examples: array, description: option, isExperimental: bool, @@ -374,6 +376,7 @@ module Function = { ~nameSpace, ~definitions, ~examples=?, + ~output=?, ~description=?, ~isExperimental=false, (), @@ -381,6 +384,7 @@ module Function = { name: name, nameSpace: nameSpace, definitions: definitions, + output: output, examples: examples |> E.O.default([]), isExperimental: isExperimental, description: description, diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 1d74f451..6543cbc9 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -55,7 +55,7 @@ module PointSet = { let library = [ Function.make( - ~name="PointSet.makeContinuous", + ~name="makeContinuous", ~nameSpace, ~definitions=[ FnDefinition.make( @@ -69,7 +69,7 @@ module PointSet = { (), ), Function.make( - ~name="PointSet.makeDiscrete", + ~name="makeDiscrete", ~nameSpace, ~definitions=[ FnDefinition.make( @@ -89,7 +89,7 @@ module Functionn = { let nameSpace = "Function" let library = [ Function.make( - ~name="Function.declare", + ~name="declare", ~nameSpace, ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", ~examples=[ @@ -177,7 +177,7 @@ module DistributionCreation = { let library = [ Function.make( - ~name="Normal", + ~name="normal", ~nameSpace, ~examples=["normal(5,1)", "normal({p5: 4, p95: 10})", "normal({mean: 5, stdev: 2})"], ~definitions=[ @@ -190,7 +190,7 @@ module DistributionCreation = { (), ), Function.make( - ~name="Lognormal", + ~name="lognormal", ~nameSpace, ~examples=[ "lognormal(0.5, 0.8)", @@ -210,14 +210,14 @@ module DistributionCreation = { (), ), Function.make( - ~name="Uniform", + ~name="uniform", ~nameSpace, ~examples=[`uniform(10, 12)`], ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], (), ), Function.make( - ~name="Beta", + ~name="beta", ~nameSpace, ~examples=[`beta(20, 25)`, `beta({mean: 0.39, stdev: 0.1})`], ~definitions=[ @@ -227,28 +227,28 @@ module DistributionCreation = { (), ), Function.make( - ~name="Cauchy", + ~name="cauchy", ~nameSpace, ~examples=[`cauchy(5, 1)`], ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], (), ), Function.make( - ~name="Gamma", + ~name="gamma", ~nameSpace, ~examples=[`gamma(5, 1)`], ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], (), ), Function.make( - ~name="Logistic", + ~name="logistic", ~nameSpace, ~examples=[`logistic(5, 1)`], ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], (), ), Function.make( - ~name="To (Distribution)", + ~name="to (distribution)", ~nameSpace, ~examples=[`5 to 10`, `to(5,10)`, `-5 to 5`], ~definitions=[ @@ -261,21 +261,21 @@ module DistributionCreation = { (), ), Function.make( - ~name="Exponential", + ~name="exponential", ~nameSpace, ~examples=[`exponential(2)`], ~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)], (), ), Function.make( - ~name="Bernoulli", + ~name="bernoulli", ~nameSpace, ~examples=[`bernoulli(0.5)`], ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], (), ), Function.make( - ~name="PointMass", + ~name="pointMass", ~nameSpace, ~examples=[`pointMass(0.5)`], ~definitions=[OneArgDist.make("pointMass", SymbolicDist.Float.makeSafe)], @@ -333,61 +333,61 @@ module Number = { let library = [ Function.make( - ~name="Floor", + ~name="floor", ~nameSpace, ~definitions=[NumberToNumber.make("floor", Js.Math.floor_float)], (), ), Function.make( - ~name="Ceiling", + ~name="ceiling", ~nameSpace, ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)], (), ), Function.make( - ~name="Absolute Value", + ~name="absolute value", ~nameSpace, ~definitions=[NumberToNumber.make("abs", Js.Math.abs_float)], (), ), Function.make( - ~name="Exponent", + ~name="exponent", ~nameSpace, ~definitions=[NumberToNumber.make("exp", Js.Math.exp)], (), ), Function.make( - ~name="Log", + ~name="log", ~nameSpace, ~definitions=[NumberToNumber.make("log", Js.Math.log)], (), ), Function.make( - ~name="Log Base 10", + ~name="log base 10", ~nameSpace, ~definitions=[NumberToNumber.make("log10", Js.Math.log10)], (), ), Function.make( - ~name="Log Base 2", + ~name="log base 2", ~nameSpace, ~definitions=[NumberToNumber.make("log2", Js.Math.log2)], (), ), Function.make( - ~name="Round", + ~name="round", ~nameSpace, ~definitions=[NumberToNumber.make("round", Js.Math.round)], (), ), Function.make( - ~name="Sum", + ~name="sum", ~nameSpace, ~definitions=[ArrayNumberDist.make("sum", r => r->E.A.Floats.sum->Wrappers.evNumber->Ok)], (), ), Function.make( - ~name="Product", + ~name="product", ~nameSpace, ~definitions=[ ArrayNumberDist.make("product", r => r->E.A.Floats.product->Wrappers.evNumber->Ok), @@ -395,25 +395,25 @@ module Number = { (), ), Function.make( - ~name="Min", + ~name="min", ~nameSpace, ~definitions=[ArrayNumberDist.make("min", r => r->E.A.Floats.min->Wrappers.evNumber->Ok)], (), ), Function.make( - ~name="Max", + ~name="max", ~nameSpace, ~definitions=[ArrayNumberDist.make("max", r => r->E.A.Floats.max->Wrappers.evNumber->Ok)], (), ), Function.make( - ~name="Mean", + ~name="mean", ~nameSpace, ~definitions=[ArrayNumberDist.make("mean", r => r->E.A.Floats.mean->Wrappers.evNumber->Ok)], (), ), Function.make( - ~name="Geometric Mean", + ~name="geometric mean", ~nameSpace, ~definitions=[ ArrayNumberDist.make("geomean", r => r->E.A.Floats.geomean->Wrappers.evNumber->Ok), @@ -421,13 +421,13 @@ module Number = { (), ), Function.make( - ~name="Standard Deviation", + ~name="standard deviation", ~nameSpace, ~definitions=[ArrayNumberDist.make("stdev", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok)], (), ), Function.make( - ~name="Variance", + ~name="variance", ~nameSpace, ~definitions=[ ArrayNumberDist.make("variance", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok), @@ -435,7 +435,7 @@ module Number = { (), ), Function.make( - ~name="Sort", + ~name="sort", ~nameSpace, ~definitions=[ ArrayNumberDist.make("sort", r => @@ -445,7 +445,7 @@ module Number = { (), ), Function.make( - ~name="Cumulative Sum", + ~name="cumulative sum", ~nameSpace, ~definitions=[ ArrayNumberDist.make("cumsum", r => @@ -455,7 +455,7 @@ module Number = { (), ), Function.make( - ~name="Cumulative Prod", + ~name="cumulative prod", ~nameSpace, ~definitions=[ ArrayNumberDist.make("cumprod", r => @@ -465,7 +465,7 @@ module Number = { (), ), Function.make( - ~name="Diff", + ~name="diff", ~nameSpace, ~definitions=[ ArrayNumberDist.make("diff", r => @@ -665,7 +665,7 @@ module List = { let library = [ Function.make( - ~name="List.make", + ~name="make", ~nameSpace, ~definitions=[ //Todo: If the second item is a function with no args, it could be nice to run this function and return the result. @@ -685,7 +685,7 @@ module List = { (), ), Function.make( - ~name="List.upTo", + ~name="upTo", ~nameSpace, ~definitions=[ FnDefinition.make( @@ -702,7 +702,7 @@ module List = { (), ), Function.make( - ~name="List.first", + ~name="first", ~nameSpace, ~definitions=[ FnDefinition.make( @@ -720,7 +720,7 @@ module List = { (), ), Function.make( - ~name="List.last", + ~name="last", ~nameSpace, ~definitions=[ FnDefinition.make( @@ -738,7 +738,7 @@ module List = { (), ), Function.make( - ~name="List.reverse", + ~name="reverse", ~nameSpace, ~definitions=[ FnDefinition.make( From e3ef7a304885cb93c8f5ff1665f43dfc7da4cf04 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 15 Jul 2022 19:47:57 -0700 Subject: [PATCH 018/203] Added examples to most items in function registry library --- .../FunctionRegistry_Library.res | 120 +++++++++++++----- 1 file changed, 87 insertions(+), 33 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 6543cbc9..5d68c7b9 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -120,6 +120,12 @@ module Functionn = { module DistributionCreation = { let nameSpace = "Dist" + let output = ReducerInterface_InternalExpressionValue.EvtDistribution + + let fnMake = (~name, ~examples, ~definitions) => { + Function.make(~name, ~nameSpace, ~output, ~examples, ~definitions, ()) + } + module TwoArgDist = { let process = (~fn, ~env, r) => r @@ -176,9 +182,8 @@ module DistributionCreation = { } let library = [ - Function.make( + fnMake( ~name="normal", - ~nameSpace, ~examples=["normal(5,1)", "normal({p5: 4, p95: 10})", "normal({mean: 5, stdev: 2})"], ~definitions=[ TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)), @@ -187,11 +192,9 @@ module DistributionCreation = { ), TwoArgDist.makeRecordMeanStdev("normal", twoArgs(SymbolicDist.Normal.make)), ], - (), ), - Function.make( + fnMake( ~name="lognormal", - ~nameSpace, ~examples=[ "lognormal(0.5, 0.8)", "lognormal({p5: 4, p95: 10})", @@ -207,49 +210,37 @@ module DistributionCreation = { twoArgs(SymbolicDist.Lognormal.fromMeanAndStdev), ), ], - (), ), - Function.make( + fnMake( ~name="uniform", - ~nameSpace, ~examples=[`uniform(10, 12)`], ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], - (), ), - Function.make( + fnMake( ~name="beta", - ~nameSpace, ~examples=[`beta(20, 25)`, `beta({mean: 0.39, stdev: 0.1})`], ~definitions=[ TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make)), TwoArgDist.makeRecordMeanStdev("beta", twoArgs(SymbolicDist.Beta.fromMeanAndStdev)), ], - (), ), - Function.make( + fnMake( ~name="cauchy", - ~nameSpace, ~examples=[`cauchy(5, 1)`], ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], - (), ), - Function.make( + fnMake( ~name="gamma", - ~nameSpace, ~examples=[`gamma(5, 1)`], ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], - (), ), - Function.make( + fnMake( ~name="logistic", - ~nameSpace, ~examples=[`logistic(5, 1)`], ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], - (), ), - Function.make( + fnMake( ~name="to (distribution)", - ~nameSpace, ~examples=[`5 to 10`, `to(5,10)`, `-5 to 5`], ~definitions=[ TwoArgDist.make("to", twoArgs(SymbolicDist.From90thPercentile.make)), @@ -258,28 +249,21 @@ module DistributionCreation = { twoArgs(SymbolicDist.From90thPercentile.make), ), ], - (), ), - Function.make( + fnMake( ~name="exponential", - ~nameSpace, ~examples=[`exponential(2)`], ~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)], - (), ), - Function.make( + fnMake( ~name="bernoulli", - ~nameSpace, ~examples=[`bernoulli(0.5)`], ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], - (), ), - Function.make( + fnMake( ~name="pointMass", - ~nameSpace, ~examples=[`pointMass(0.5)`], ~definitions=[OneArgDist.make("pointMass", SymbolicDist.Float.makeSafe)], - (), ), ] } @@ -335,60 +319,80 @@ module Number = { Function.make( ~name="floor", ~nameSpace, + ~output=EvtNumber, + ~examples=[`floor(3.5)`], ~definitions=[NumberToNumber.make("floor", Js.Math.floor_float)], (), ), Function.make( ~name="ceiling", ~nameSpace, + ~output=EvtNumber, + ~examples=[`ceiling(3.5)`], ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)], (), ), Function.make( ~name="absolute value", ~nameSpace, + ~output=EvtNumber, + ~examples=[`abs(3.5)`], ~definitions=[NumberToNumber.make("abs", Js.Math.abs_float)], (), ), Function.make( ~name="exponent", ~nameSpace, + ~output=EvtNumber, + ~examples=[`exp(3.5)`], ~definitions=[NumberToNumber.make("exp", Js.Math.exp)], (), ), Function.make( ~name="log", ~nameSpace, + ~output=EvtNumber, + ~examples=[`log(3.5)`], ~definitions=[NumberToNumber.make("log", Js.Math.log)], (), ), Function.make( ~name="log base 10", ~nameSpace, + ~output=EvtNumber, + ~examples=[`log10(3.5)`], ~definitions=[NumberToNumber.make("log10", Js.Math.log10)], (), ), Function.make( ~name="log base 2", ~nameSpace, + ~output=EvtNumber, + ~examples=[`log2(3.5)`], ~definitions=[NumberToNumber.make("log2", Js.Math.log2)], (), ), Function.make( ~name="round", ~nameSpace, + ~output=EvtNumber, + ~examples=[`round(3.5)`], ~definitions=[NumberToNumber.make("round", Js.Math.round)], (), ), Function.make( ~name="sum", ~nameSpace, + ~output=EvtNumber, + ~examples=[`sum([3,5,2])`], ~definitions=[ArrayNumberDist.make("sum", r => r->E.A.Floats.sum->Wrappers.evNumber->Ok)], (), ), Function.make( ~name="product", ~nameSpace, + ~output=EvtNumber, + ~examples=[`product([3,5,2])`], ~definitions=[ ArrayNumberDist.make("product", r => r->E.A.Floats.product->Wrappers.evNumber->Ok), ], @@ -397,24 +401,32 @@ module Number = { Function.make( ~name="min", ~nameSpace, + ~output=EvtNumber, + ~examples=[`min([3,5,2])`], ~definitions=[ArrayNumberDist.make("min", r => r->E.A.Floats.min->Wrappers.evNumber->Ok)], (), ), Function.make( ~name="max", ~nameSpace, + ~output=EvtNumber, + ~examples=[`max([3,5,2])`], ~definitions=[ArrayNumberDist.make("max", r => r->E.A.Floats.max->Wrappers.evNumber->Ok)], (), ), Function.make( ~name="mean", ~nameSpace, + ~output=EvtNumber, + ~examples=[`mean([3,5,2])`], ~definitions=[ArrayNumberDist.make("mean", r => r->E.A.Floats.mean->Wrappers.evNumber->Ok)], (), ), Function.make( ~name="geometric mean", ~nameSpace, + ~output=EvtNumber, + ~examples=[`geomean([3,5,2])`], ~definitions=[ ArrayNumberDist.make("geomean", r => r->E.A.Floats.geomean->Wrappers.evNumber->Ok), ], @@ -423,12 +435,16 @@ module Number = { Function.make( ~name="standard deviation", ~nameSpace, + ~output=EvtNumber, + ~examples=[`stdev([3,5,2,3,5])`], ~definitions=[ArrayNumberDist.make("stdev", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok)], (), ), Function.make( ~name="variance", ~nameSpace, + ~output=EvtNumber, + ~examples=[`variance([3,5,2,3,5])`], ~definitions=[ ArrayNumberDist.make("variance", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok), ], @@ -437,6 +453,8 @@ module Number = { Function.make( ~name="sort", ~nameSpace, + ~output=EvtArray, + ~examples=[`sort([3,5,2,3,5])`], ~definitions=[ ArrayNumberDist.make("sort", r => r->E.A.Floats.sort->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok @@ -447,6 +465,8 @@ module Number = { Function.make( ~name="cumulative sum", ~nameSpace, + ~output=EvtArray, + ~examples=[`cumsum([3,5,2,3,5])`], ~definitions=[ ArrayNumberDist.make("cumsum", r => r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok @@ -457,6 +477,8 @@ module Number = { Function.make( ~name="cumulative prod", ~nameSpace, + ~output=EvtArray, + ~examples=[`cumprod([3,5,2,3,5])`], ~definitions=[ ArrayNumberDist.make("cumprod", r => r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok @@ -467,6 +489,8 @@ module Number = { Function.make( ~name="diff", ~nameSpace, + ~output=EvtArray, + ~examples=[`diff([3,5,2,3,5])`], ~definitions=[ ArrayNumberDist.make("diff", r => r->E.A.Floats.diff->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok @@ -524,6 +548,8 @@ module Dict = { Function.make( ~name="merge", ~nameSpace, + ~output=EvtRecord, + ~examples=[`Dict.merge({a: 1, b: 2}, {c: 3, d: 4})`], ~definitions=[ FnDefinition.make( ~requiresNamespace=true, @@ -544,6 +570,8 @@ module Dict = { Function.make( ~name="mergeMany", ~nameSpace, + ~output=EvtRecord, + ~examples=[`Dict.mergeMany([{a: 1, b: 2}, {c: 3, d: 4}])`], ~definitions=[ FnDefinition.make( ~requiresNamespace=true, @@ -564,6 +592,8 @@ module Dict = { Function.make( ~name="keys", ~nameSpace, + ~output=EvtArray, + ~examples=[`Dict.keys({a: 1, b: 2})`], ~definitions=[ FnDefinition.make( ~requiresNamespace=true, @@ -582,6 +612,8 @@ module Dict = { Function.make( ~name="values", ~nameSpace, + ~output=EvtArray, + ~examples=[`Dict.values({a: 1, b: 2})`], ~definitions=[ FnDefinition.make( ~requiresNamespace=true, @@ -600,6 +632,8 @@ module Dict = { Function.make( ~name="toList", ~nameSpace, + ~output=EvtArray, + ~examples=[`Dict.toList({a: 1, b: 2})`], ~definitions=[ FnDefinition.make( ~requiresNamespace=true, @@ -618,6 +652,8 @@ module Dict = { Function.make( ~name="fromList", ~nameSpace, + ~output=EvtRecord, + ~examples=[`Dict.fromList({a: 1, b: 2})`], ~definitions=[ FnDefinition.make( ~requiresNamespace=true, @@ -667,6 +703,8 @@ module List = { Function.make( ~name="make", ~nameSpace, + ~output=EvtArray, + ~examples=[`List.make(2, "testValue")`], ~definitions=[ //Todo: If the second item is a function with no args, it could be nice to run this function and return the result. FnDefinition.make( @@ -687,6 +725,8 @@ module List = { Function.make( ~name="upTo", ~nameSpace, + ~output=EvtArray, + ~examples=[`List.upTo(1,4)`], ~definitions=[ FnDefinition.make( ~requiresNamespace, @@ -704,6 +744,7 @@ module List = { Function.make( ~name="first", ~nameSpace, + ~examples=[`List.first([1,4,5])`], ~definitions=[ FnDefinition.make( ~requiresNamespace, @@ -722,6 +763,7 @@ module List = { Function.make( ~name="last", ~nameSpace, + ~examples=[`List.last([1,4,5])`], ~definitions=[ FnDefinition.make( ~requiresNamespace=false, @@ -740,6 +782,8 @@ module List = { Function.make( ~name="reverse", ~nameSpace, + ~output=EvtArray, + ~examples=[`List.reverse([1,4,5])`], ~definitions=[ FnDefinition.make( ~requiresNamespace=false, @@ -772,6 +816,12 @@ module Scoring = { Function.make( ~name="logScore", ~nameSpace, + ~output=EvtNumber, + ~examples=[ + "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)}, prior: normal(5.5,3)})", + "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)}})", + "Dist.logScore({estimate: normal(5,2), answer: 4.5})", + ], ~definitions=[ FnDefinition.make( ~requiresNamespace, @@ -825,6 +875,10 @@ module Scoring = { Function.make( ~name="klDivergence", ~nameSpace, + ~output=EvtNumber, + ~examples=[ + "Dist.klDivergence(normal(5,2), normal(5,1.5)", + ], ~definitions=[ FnDefinition.make( ~name="klDivergence", From 4522b46900b48ecbb9c9cf086a40eb8efecccbd5 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Fri, 15 Jul 2022 23:18:39 +0200 Subject: [PATCH 019/203] basic type compiler --- .../Reducer_Type_Compile_test.res | 62 +++++++++++++++++++ .../Reducer_Dispatch_BuiltIn.res | 2 +- .../rescript/Reducer/Reducer_Exception.res | 4 +- .../Reducer_Type/Reducer_Type_Compile.res | 36 +++++++++++ .../Reducer/Reducer_Type/Reducer_Type_T.res | 54 +++++++++++++--- .../Reducer_Type/Reducer_Type_TypeBuilder.res | 16 ++--- .../Reducer_Type/Reducer_Type_TypeChecker.res | 30 +++------ 7 files changed, 160 insertions(+), 44 deletions(-) create mode 100644 packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res create mode 100644 packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Compile.res diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res new file mode 100644 index 00000000..3f97ca3f --- /dev/null +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res @@ -0,0 +1,62 @@ +module Expression = Reducer_Expression +module InternalExpressionValue = ReducerInterface_InternalExpressionValue +module Module = Reducer_Module +module T = Reducer_Type_T +module TypeCompile = Reducer_Type_Compile + +open Jest +open Expect + +let myIevEval = (aTypeSourceCode: string) => + TypeCompile.ievFromTypeExpression(aTypeSourceCode, Expression.reduceExpression) +let myIevEvalToString = (aTypeSourceCode: string) => + myIevEval(aTypeSourceCode)->InternalExpressionValue.toStringResult + +let myIevExpectEqual = (aTypeSourceCode, answer) => + expect(myIevEvalToString(aTypeSourceCode))->toEqual(answer) + +let _myIevTest = (test, aTypeSourceCode, answer) => + test(aTypeSourceCode, () => myIevExpectEqual(aTypeSourceCode, answer)) + +let myTypeEval = (aTypeSourceCode: string) => + TypeCompile.fromTypeExpression(aTypeSourceCode, Expression.reduceExpression) +let myTypeEvalToString = (aTypeSourceCode: string) => myTypeEval(aTypeSourceCode)->T.toStringResult + +let myTypeExpectEqual = (aTypeSourceCode, answer) => + expect(myTypeEvalToString(aTypeSourceCode))->toEqual(answer) + +let _myTypeTest = (test, aTypeSourceCode, answer) => + test(aTypeSourceCode, () => myTypeExpectEqual(aTypeSourceCode, answer)) + +let myIevTest = (aTypeSourceCode, answer) => _myIevTest(test, aTypeSourceCode, answer) +let myTypeTest = (aTypeSourceCode, answer) => _myTypeTest(test, aTypeSourceCode, answer) +module MySkip = { + let myIevTest = (aTypeSourceCode, answer) => _myIevTest(Skip.test, aTypeSourceCode, answer) + let myTypeTest = (aTypeSourceCode, answer) => _myTypeTest(Skip.test, aTypeSourceCode, answer) +} +module MyOnly = { + let myIevTest = (aTypeSourceCode, answer) => _myIevTest(Only.test, aTypeSourceCode, answer) + let myTypeTest = (aTypeSourceCode, answer) => _myTypeTest(Only.test, aTypeSourceCode, answer) +} + +// | ItTypeIdentifier(string) +myTypeTest("number", "number") +myTypeTest("(number)", "number") +// | ItModifiedType({modifiedType: iType}) +myIevTest("number<-min(0)", "Ok({min: 0,typeIdentifier: #number,typeTag: 'typeIdentifier'})") +myTypeTest("number<-min(0)", "number<-min(0)") +// | ItTypeOr({typeOr: array}) +myTypeTest("number | string", "(number | string)") +// | ItTypeFunction({inputs: array, output: iType}) +myTypeTest("number => number => number", "(number => number => number)") +// | ItTypeArray({element: iType}) +myIevTest("[number]", "Ok({element: #number,typeTag: 'typeArray'})") +myTypeTest("[number]", "[number]") +// | ItTypeTuple({elements: array}) +myTypeTest("[number, string]", "[number, string]") +// | ItTypeRecord({properties: Belt.Map.String.t}) +myIevTest( + "{age: number, name: string}", + "Ok({properties: {age: #number,name: #string},typeTag: 'typeRecord'})", +) +myTypeTest("{age: number, name: string}", "{age: number, name: string}") diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index 484b0acb..07766aca 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -198,7 +198,7 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce | ("$_typeFunction_$", [IEvArray(arr)]) => TypeBuilder.typeFunction(arr) | ("$_typeTuple_$", [IEvArray(elems)]) => TypeBuilder.typeTuple(elems) | ("$_typeArray_$", [elem]) => TypeBuilder.typeArray(elem) - | ("$_typeRecord_$", [IEvArray(arrayOfPairs)]) => TypeBuilder.typeRecord(arrayOfPairs) + | ("$_typeRecord_$", [IEvRecord(propertyMap)]) => TypeBuilder.typeRecord(propertyMap) | ("concat", [IEvArray(aValueArray), IEvArray(bValueArray)]) => doAddArray(aValueArray, bValueArray) | ("concat", [IEvString(aValueString), IEvString(bValueString)]) => diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Exception.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Exception.res index d7ca335c..14db0843 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Exception.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Exception.res @@ -1,3 +1,3 @@ -// There are switch stament cases in the code which are impossible to reach by design. +// There are switch statement cases in the code which are impossible to reach by design. // ImpossibleException is a sign of programming error. -exception ImpossibleException +exception ImpossibleException(string) 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 new file mode 100644 index 00000000..c7a776b7 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Compile.res @@ -0,0 +1,36 @@ +module ErrorValue = Reducer_ErrorValue +module ExpressionT = Reducer_Expression_T +module InternalExpressionValue = ReducerInterface_InternalExpressionValue +module Module = Reducer_Module +module T = Reducer_Type_T + +let ievFromTypeExpression = ( + typeExpressionSourceCode: string, + reducerFn: ExpressionT.reducerFn, +): result => { + let sIndex = "compiled" + let sourceCode = `type ${sIndex}=${typeExpressionSourceCode}` + Reducer_Expression.parse(sourceCode)->Belt.Result.flatMap(expr => { + let rContext = reducerFn(expr, Module.emptyBindings, InternalExpressionValue.defaultEnvironment) + Belt.Result.map(rContext, context => + switch context { + | IEvModule(nameSpace) => + switch Module.getType(nameSpace, sIndex) { + | Some(value) => value + | None => raise(Reducer_Exception.ImpossibleException("Reducer_Type_Compile-none")) + } + | _ => raise(Reducer_Exception.ImpossibleException("Reducer_Type_Compile-raise")) + } + ) + }) +} + +let fromTypeExpression = ( + typeExpressionSourceCode: string, + reducerFn: ExpressionT.reducerFn, +): result => { + ievFromTypeExpression( + (typeExpressionSourceCode: string), + (reducerFn: ExpressionT.reducerFn), + )->Belt.Result.map(T.fromIEvValue) +} diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res index 9b847ca7..0e3b240d 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res @@ -3,13 +3,41 @@ open InternalExpressionValue type rec iType = | ItTypeIdentifier(string) - | ItModifiedType({modifiedType: iType}) + | ItModifiedType({modifiedType: iType, modifiers: Belt.Map.String.t}) | ItTypeOr({typeOr: array}) | ItTypeFunction({inputs: array, output: iType}) | ItTypeArray({element: iType}) | ItTypeTuple({elements: array}) | ItTypeRecord({properties: Belt.Map.String.t}) +type t = iType + +let rec toString = (t: t): string => { + switch t { + | ItTypeIdentifier(s) => s + | ItModifiedType({modifiedType, modifiers}) => + `${toString(modifiedType)}${modifiers->Belt.Map.String.reduce("", (acc, k, v) => + Js.String2.concatMany(acc, ["<-", k, "(", InternalExpressionValue.toString(v), ")"]) + )}` + | ItTypeOr({typeOr}) => `(${Js.Array2.map(typeOr, toString)->Js.Array2.joinWith(" | ")})` + | ItTypeFunction({inputs, output}) => + `(${inputs->Js.Array2.map(toString)->Js.Array2.joinWith(" => ")} => ${toString(output)})` + | ItTypeArray({element}) => `[${toString(element)}]` + | ItTypeTuple({elements}) => `[${Js.Array2.map(elements, toString)->Js.Array2.joinWith(", ")}]` + | ItTypeRecord({properties}) => + `{${properties + ->Belt.Map.String.toArray + ->Js.Array2.map(((k, v)) => Js.String2.concatMany(k, [": ", toString(v)])) + ->Js.Array2.joinWith(", ")}}` + } +} + +let toStringResult = (rt: result) => + switch rt { + | Ok(t) => toString(t) + | Error(e) => ErrorValue.errorToString(e) + } + let rec fromTypeMap = typeMap => { let default = IEvString("") let evTypeTag: InternalExpressionValue.t = Belt.Map.String.getWithDefault( @@ -52,31 +80,39 @@ let rec fromTypeMap = typeMap => { "properties", default, ) - //TODO: map type modifiers - switch evTypeTag { - | IEvString("typeIdentifier") => ItModifiedType({modifiedType: fromIEvValue(evTypeIdentifier)}) + + let modifiers = + typeMap->Belt.Map.String.keep((k, _v) => ["min", "max", "memberOf"]->Js.Array2.includes(k)) + + let makeIt = switch evTypeTag { + | IEvString("typeIdentifier") => fromIEvValue(evTypeIdentifier) | IEvString("typeOr") => ItTypeOr({typeOr: fromIEvArray(evTypeOr)}) | IEvString("typeFunction") => ItTypeFunction({inputs: fromIEvArray(evInputs), output: fromIEvValue(evOutput)}) | IEvString("typeArray") => ItTypeArray({element: fromIEvValue(evElement)}) | IEvString("typeTuple") => ItTypeTuple({elements: fromIEvArray(evElements)}) | IEvString("typeRecord") => ItTypeRecord({properties: fromIEvRecord(evProperties)}) - | _ => raise(Reducer_Exception.ImpossibleException) + | _ => raise(Reducer_Exception.ImpossibleException("Reducer_Type_T-evTypeTag")) } + + Belt.Map.String.isEmpty(modifiers) + ? makeIt + : ItModifiedType({modifiedType: makeIt, modifiers: modifiers}) } -and fromIEvValue = (ievValue: InternalExpressionValue.t) => + +and fromIEvValue = (ievValue: InternalExpressionValue.t): iType => switch ievValue { | IEvTypeIdentifier(typeIdentifier) => ItTypeIdentifier({typeIdentifier}) | IEvType(typeMap) => fromTypeMap(typeMap) - | _ => raise(Reducer_Exception.ImpossibleException) + | _ => raise(Reducer_Exception.ImpossibleException("Reducer_Type_T-ievValue")) } and fromIEvArray = (ievArray: InternalExpressionValue.t) => switch ievArray { | IEvArray(array) => array->Belt.Array.map(fromIEvValue) - | _ => raise(Reducer_Exception.ImpossibleException) + | _ => raise(Reducer_Exception.ImpossibleException("Reducer_Type_T-ievArray")) } and fromIEvRecord = (ievRecord: InternalExpressionValue.t) => switch ievRecord { | IEvRecord(record) => record->Belt.Map.String.map(fromIEvValue) - | _ => raise(Reducer_Exception.ImpossibleException) + | _ => raise(Reducer_Exception.ImpossibleException("Reducer_Type_T-ievRecord")) } diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeBuilder.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeBuilder.res index e51f901a..d3906a38 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeBuilder.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeBuilder.res @@ -56,7 +56,7 @@ let typeFunction = anArray => { let typeArray = element => { let newRecord = Belt.Map.String.fromArray([ - ("typeTag", IEvString("typeTuple")), + ("typeTag", IEvString("typeArray")), ("element", element), ]) newRecord->IEvType->Ok @@ -64,22 +64,14 @@ let typeArray = element => { let typeTuple = anArray => { let newRecord = Belt.Map.String.fromArray([ - ("typeTag", IEvString("typeArray")), + ("typeTag", IEvString("typeTuple")), ("elements", IEvArray(anArray)), ]) newRecord->IEvType->Ok } -let typeRecord = arrayOfPairs => { - let newProperties = - Belt.Array.map(arrayOfPairs, pairValue => - switch pairValue { - | IEvArray([IEvString(key), valueValue]) => (key, valueValue) - | _ => ("wrong key type", pairValue->toStringWithType->IEvString) - } - ) - ->Belt.Map.String.fromArray - ->IEvRecord +let typeRecord = propertyMap => { + let newProperties = propertyMap->IEvRecord let newRecord = Belt.Map.String.fromArray([ ("typeTag", IEvString("typeRecord")), ("properties", newProperties), 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 18cb804a..a1a6bdc2 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 @@ -1,13 +1,10 @@ -module ExpressionT = Reducer_Expression_T +// module ErrorValue = Reducer_ErrorValue module InternalExpressionValue = ReducerInterface_InternalExpressionValue module T = Reducer_Type_T -module TypeBuilder = Reducer_Type_TypeBuilder +// module TypeBuilder = Reducer_Type_TypeBuilder open InternalExpressionValue -type typeErrorValue = - | TypeError(T.iType, InternalExpressionValue.t) - | TypeErrorWithPosition(T.iType, InternalExpressionValue.t, int) - | TypeErrorWithProperty(T.iType, InternalExpressionValue.t, string) +type typeErrorValue = TypeError(T.t, InternalExpressionValue.t) let rec isOfResolvedIType = (anIType: T.iType, aValue): result => { let caseTypeIdentifier = (anUpperTypeName, aValue) => { @@ -24,16 +21,16 @@ let rec isOfResolvedIType = (anIType: T.iType, aValue): result switch Belt.Map.String.get(map, property) { | Some(propertyValue) => isOfResolvedIType(propertyType, propertyValue) - | None => TypeErrorWithProperty(anIType, evValue, property)->Error + | None => TypeError(anIType, evValue)->Error } ) }) } let _caseArray = (anIType, evValue, elementType, anArray) => { - Belt.Array.reduceWithIndex(anArray, Ok(true), (acc, element, index) => { + Belt.Array.reduceWithIndex(anArray, Ok(true), (acc, element, _index) => { switch isOfResolvedIType(elementType, element) { | Ok(_) => acc - | Error(_) => TypeErrorWithPosition(anIType, evValue, index)->Error + | Error(_) => TypeError(anIType, evValue)->Error } }) } @@ -48,12 +45,12 @@ let rec isOfResolvedIType = (anIType: T.iType, aValue): result raise(Reducer_Exception.ImpossibleException) // | ItTypeTuple({elements: anITypeArray}) => raise(Reducer_Exception.ImpossibleException) // | ItTypeRecord({properties: anITypeMap}) => raise(Reducer_Exception.ImpossibleException) - | _ => raise(Reducer_Exception.ImpossibleException) + | _ => raise(Reducer_Exception.ImpossibleException("Reducer_TypeChecker-isOfResolvedIType")) } } -let isOfResolvedType = (aType: InternalExpressionValue.t, aValue): result => - aType->T.fromIEvValue->isOfResolvedIType(aValue) +// let isOfResolvedType = (aType: InternalExpressionValue.t, aValue): result => +// aType->T.fromIEvValue->isOfResolvedIType(aValue) // TODO: Work in progress. Code is commented to make an a release of other features // let checkArguments = ( @@ -70,12 +67,5 @@ let isOfResolvedType = (aType: InternalExpressionValue.t, aValue): result raise(Reducer_Exception.ImpossibleException) // } // let rTupleType = TypeBuilder.typeTuple(inputs) -// Belt.Result.flatMap(rTupleType, tuppleType => isOfResolvedType(tuppleType, args->IEvArray)) +// Belt.Result.flatMap(rTupleType, tupleType => isOfResolvedType(tupleType, args->IEvArray)) // } - -// let compileTypeExpression = (typeExpression: string, bindings: ExpressionT.bindings, reducerFn: ExpressionT.reducerFn) => { -// statement = `type compiled=${typeExpression}` - -// } - -//TODO: asGuard From b65aeaf0d2c59f7f855d67d588ff645e8b108412 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Sat, 16 Jul 2022 17:08:23 +0200 Subject: [PATCH 020/203] spell check --- .../Reducer/Reducer_Peggy/Reducer_Peggy_Parse_type_test.res | 4 ++-- .../Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res | 2 +- .../Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res | 4 ++-- .../Reducer/Reducer_Expression/Reducer_Expression_T.res | 4 ++-- .../rescript/Reducer/Reducer_Extra/Reducer_Extra_Array.res | 4 ++-- .../src/rescript/Reducer/Reducer_Extra/Reducer_Extra_List.res | 4 ++-- .../rescript/Reducer/Reducer_Peggy/Reducer_Peggy_Parse.res | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_Parse_type_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_Parse_type_test.res index ea18effc..f1dcd4bc 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_Parse_type_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_Parse_type_test.res @@ -63,8 +63,8 @@ describe("Peggy parse type", () => { "{(::$_typeOf_$ :weekend (::$_typeOr_$ (::$_constructArray_$ ((::$_typeConstructor_$ #Saturday (::$_constructArray_$ ())) (::$_typeConstructor_$ #Sunday (::$_constructArray_$ ()))))))}", ) }) - describe("type paranthesis", () => { - //$ is introduced to avoid paranthesis + describe("type parenthesis", () => { + //$ is introduced to avoid parenthesis testParse( "answer: (number|string)<-opaque", "{(::$_typeOf_$ :answer (::$_typeModifier_opaque_$ (::$_typeOr_$ (::$_constructArray_$ (#number #string)))))}", diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res index 18e8121d..d0609d09 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res @@ -3,7 +3,7 @@ open Reducer_Peggy_TestHelpers describe("Peggy to Expression", () => { describe("literals operators parenthesis", () => { - // Note that there is always an outer block. Otherwise, external bindings are ignrored at the first statement + // Note that there is always an outer block. Otherwise, external bindings are ignored at the first statement testToExpression("1", "{1}", ~v="1", ()) testToExpression("'hello'", "{'hello'}", ~v="'hello'", ()) testToExpression("true", "{true}", ~v="true", ()) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index 07766aca..0e8a479e 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -10,8 +10,8 @@ open ReducerInterface_InternalExpressionValue open Reducer_ErrorValue /* - MathJs provides default implementations for builtins - This is where all the expected builtins like + = * / sin cos log ln etc are handled + MathJs provides default implementations for built-ins + This is where all the expected built-ins like + = * / sin cos log ln etc are handled DO NOT try to add external function mapping here! */ diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_T.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_T.res index bf4d0170..c9739be3 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_T.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_T.res @@ -30,12 +30,12 @@ let rec toString = expression => switch expression { | EList(list{EValue(IEvCall("$$_block_$$")), ...statements}) => `{${Belt.List.map(statements, aValue => toString(aValue)) - ->Extra.List.interperse("; ") + ->Extra.List.intersperse("; ") ->Belt.List.toArray ->Js.String.concatMany("")}}` | EList(aList) => `(${Belt.List.map(aList, aValue => toString(aValue)) - ->Extra.List.interperse(" ") + ->Extra.List.intersperse(" ") ->Belt.List.toArray ->Js.String.concatMany("")})` | EValue(aValue) => InternalExpressionValue.toString(aValue) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Extra/Reducer_Extra_Array.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Extra/Reducer_Extra_Array.res index 58dd4ffd..8c9f2fbb 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Extra/Reducer_Extra_Array.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Extra/Reducer_Extra_Array.res @@ -3,5 +3,5 @@ */ module ExtraList = Reducer_Extra_List -let interperse = (anArray, seperator) => - anArray->Belt.List.fromArray->ExtraList.interperse(seperator)->Belt.List.toArray +let intersperse = (anArray, seperator) => + anArray->Belt.List.fromArray->ExtraList.intersperse(seperator)->Belt.List.toArray diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Extra/Reducer_Extra_List.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Extra/Reducer_Extra_List.res index 9b3bcc3d..b723cca4 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Extra/Reducer_Extra_List.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Extra/Reducer_Extra_List.res @@ -1,9 +1,9 @@ /* Insert seperator between the elements of a list */ -let rec interperse = (aList, seperator) => +let rec intersperse = (aList, seperator) => switch aList { | list{} => list{} | list{a} => list{a} - | list{a, ...rest} => list{a, seperator, ...interperse(rest, seperator)} + | list{a, ...rest} => list{a, seperator, ...intersperse(rest, seperator)} } diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_Parse.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_Parse.res index 67873c61..a38c66e9 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_Parse.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_Parse.res @@ -91,7 +91,7 @@ let rec pgToString = (peggyNode: peggyNode): string => { args->Js.Array2.map(arg => PgNodeIdentifier(arg)->pgToString)->Js.Array2.toString let nodesToStringUsingSeparator = (nodes: array, separator: string): string => - nodes->Js.Array2.map(toString)->Extra.Array.interperse(separator)->Js.String.concatMany("") + nodes->Js.Array2.map(toString)->Extra.Array.intersperse(separator)->Js.String.concatMany("") switch peggyNode { | PgNodeBlock(node) => "{" ++ node["statements"]->nodesToStringUsingSeparator("; ") ++ "}" From 0c032e710c9a12a0a170e48772630bda3bc5b4b9 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 16 Jul 2022 14:01:00 -0700 Subject: [PATCH 021/203] Moved function library modules to separate files --- .../FunctionRegistry_Library.res | 915 +----------------- .../FunctionRegistry/Library/FR_Dict.res | 169 ++++ .../FunctionRegistry/Library/FR_Dist.res | 155 +++ .../FunctionRegistry/Library/FR_Fn.res | 61 ++ .../FunctionRegistry/Library/FR_List.res | 128 +++ .../FunctionRegistry/Library/FR_Number.res | 233 +++++ .../FunctionRegistry/Library/FR_Pointset.res | 55 ++ .../FunctionRegistry/Library/FR_Scoring.res | 90 ++ 8 files changed, 898 insertions(+), 908 deletions(-) create mode 100644 packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res create mode 100644 packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res create mode 100644 packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res create mode 100644 packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res create mode 100644 packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res create mode 100644 packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res create mode 100644 packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 5d68c7b9..949837b5 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -1,910 +1,9 @@ -open FunctionRegistry_Core -open FunctionRegistry_Helpers - -let twoArgs = E.Tuple2.toFnCall - -module Declaration = { - let frType = FRTypeRecord([ - ("fn", FRTypeLambda), - ("inputs", FRTypeArray(FRTypeRecord([("min", FRTypeNumber), ("max", FRTypeNumber)]))), - ]) - - let fromExpressionValue = (e: frValue): result => { - switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs([e]) { - | Ok([FRValueLambda(lambda), FRValueArray(inputs)]) => { - open FunctionRegistry_Helpers.Prepare - let getMinMax = arg => - ToValueArray.Record.toArgs([arg]) - ->E.R.bind(ToValueTuple.twoNumbers) - ->E.R2.fmap(((min, max)) => Declaration.ContinuousFloatArg.make(min, max)) - inputs - ->E.A2.fmap(getMinMax) - ->E.A.R.firstErrorOrOpen - ->E.R2.fmap(args => ReducerInterface_InternalExpressionValue.IEvDeclaration( - Declaration.make(lambda, args), - )) - } - | Error(r) => Error(r) - | Ok(_) => Error(FunctionRegistry_Helpers.impossibleError) - } - } -} - -module PointSet = { - let nameSpace = "PointSet" - let requiresNamespace = true - - let inputsTodist = (inputs: array, makeDist) => { - let array = inputs->getOrError(0)->E.R.bind(Prepare.ToValueArray.Array.openA) - let xyCoords = - array->E.R.bind(xyCoords => - xyCoords - ->E.A2.fmap(xyCoord => - [xyCoord]->Prepare.ToValueArray.Record.twoArgs->E.R.bind(Prepare.ToValueTuple.twoNumbers) - ) - ->E.A.R.firstErrorOrOpen - ) - let expressionValue = - xyCoords - ->E.R.bind(r => r->XYShape.T.makeFromZipped->E.R2.errMap(XYShape.Error.toString)) - ->E.R2.fmap(r => ReducerInterface_InternalExpressionValue.IEvDistribution( - PointSet(makeDist(r)), - )) - expressionValue - } - - let library = [ - Function.make( - ~name="makeContinuous", - ~nameSpace, - ~definitions=[ - FnDefinition.make( - ~requiresNamespace, - ~name="makeContinuous", - ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(_, inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), - (), - ), - ], - (), - ), - Function.make( - ~name="makeDiscrete", - ~nameSpace, - ~definitions=[ - FnDefinition.make( - ~requiresNamespace, - ~name="makeDiscrete", - ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(_, inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), - (), - ), - ], - (), - ), - ] -} - -module Functionn = { - let nameSpace = "Function" - let library = [ - Function.make( - ~name="declare", - ~nameSpace, - ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", - ~examples=[ - `declareFn({ - fn: {|a,b| a }, - inputs: [ - {min: 0, max: 100}, - {min: 30, max: 50} - ] -})`, - ], - ~isExperimental=true, - ~definitions=[ - FnDefinition.make( - ~requiresNamespace=true, - ~name="declare", - ~inputs=[Declaration.frType], - ~run=(_, inputs, _) => { - inputs->getOrError(0)->E.R.bind(Declaration.fromExpressionValue) - }, - (), - ), - ], - (), - ), - ] -} - -module DistributionCreation = { - let nameSpace = "Dist" - let output = ReducerInterface_InternalExpressionValue.EvtDistribution - - let fnMake = (~name, ~examples, ~definitions) => { - Function.make(~name, ~nameSpace, ~output, ~examples, ~definitions, ()) - } - - module TwoArgDist = { - let process = (~fn, ~env, r) => - r - ->E.R.bind(Process.DistOrNumberToDist.twoValuesUsingSymbolicDist(~fn, ~values=_, ~env)) - ->E.R2.fmap(Wrappers.evDistribution) - - let make = (name, fn) => { - FnDefinition.make( - ~requiresNamespace=false, - ~name, - ~inputs=[FRTypeDistOrNumber, FRTypeDistOrNumber], - ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env), - (), - ) - } - - let makeRecordP5P95 = (name, fn) => { - FnDefinition.make( - ~requiresNamespace=false, - ~name, - ~inputs=[FRTypeRecord([("p5", FRTypeDistOrNumber), ("p95", FRTypeDistOrNumber)])], - ~run=(_, inputs, env) => - inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), - (), - ) - } - - let makeRecordMeanStdev = (name, fn) => { - FnDefinition.make( - ~name, - ~requiresNamespace=false, - ~inputs=[FRTypeRecord([("mean", FRTypeDistOrNumber), ("stdev", FRTypeDistOrNumber)])], - ~run=(_, inputs, env) => - inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), - (), - ) - } - } - - module OneArgDist = { - let process = (~fn, ~env, r) => - r - ->E.R.bind(Process.DistOrNumberToDist.oneValueUsingSymbolicDist(~fn, ~value=_, ~env)) - ->E.R2.fmap(Wrappers.evDistribution) - - let make = (name, fn) => - FnDefinition.make( - ~requiresNamespace=false, - ~name, - ~inputs=[FRTypeDistOrNumber], - ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env), - (), - ) - } - - let library = [ - fnMake( - ~name="normal", - ~examples=["normal(5,1)", "normal({p5: 4, p95: 10})", "normal({mean: 5, stdev: 2})"], - ~definitions=[ - TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)), - TwoArgDist.makeRecordP5P95("normal", r => - twoArgs(SymbolicDist.Normal.from90PercentCI, r)->Ok - ), - TwoArgDist.makeRecordMeanStdev("normal", twoArgs(SymbolicDist.Normal.make)), - ], - ), - fnMake( - ~name="lognormal", - ~examples=[ - "lognormal(0.5, 0.8)", - "lognormal({p5: 4, p95: 10})", - "lognormal({mean: 5, stdev: 2})", - ], - ~definitions=[ - TwoArgDist.make("lognormal", twoArgs(SymbolicDist.Lognormal.make)), - TwoArgDist.makeRecordP5P95("lognormal", r => - twoArgs(SymbolicDist.Lognormal.from90PercentCI, r)->Ok - ), - TwoArgDist.makeRecordMeanStdev( - "lognormal", - twoArgs(SymbolicDist.Lognormal.fromMeanAndStdev), - ), - ], - ), - fnMake( - ~name="uniform", - ~examples=[`uniform(10, 12)`], - ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], - ), - fnMake( - ~name="beta", - ~examples=[`beta(20, 25)`, `beta({mean: 0.39, stdev: 0.1})`], - ~definitions=[ - TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make)), - TwoArgDist.makeRecordMeanStdev("beta", twoArgs(SymbolicDist.Beta.fromMeanAndStdev)), - ], - ), - fnMake( - ~name="cauchy", - ~examples=[`cauchy(5, 1)`], - ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], - ), - fnMake( - ~name="gamma", - ~examples=[`gamma(5, 1)`], - ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], - ), - fnMake( - ~name="logistic", - ~examples=[`logistic(5, 1)`], - ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], - ), - fnMake( - ~name="to (distribution)", - ~examples=[`5 to 10`, `to(5,10)`, `-5 to 5`], - ~definitions=[ - TwoArgDist.make("to", twoArgs(SymbolicDist.From90thPercentile.make)), - TwoArgDist.make( - "credibleIntervalToDistribution", - twoArgs(SymbolicDist.From90thPercentile.make), - ), - ], - ), - fnMake( - ~name="exponential", - ~examples=[`exponential(2)`], - ~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)], - ), - fnMake( - ~name="bernoulli", - ~examples=[`bernoulli(0.5)`], - ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], - ), - fnMake( - ~name="pointMass", - ~examples=[`pointMass(0.5)`], - ~definitions=[OneArgDist.make("pointMass", SymbolicDist.Float.makeSafe)], - ), - ] -} - -module Number = { - let nameSpace = "Number" - let requiresNamespace = false - - module NumberToNumber = { - let make = (name, fn) => - FnDefinition.make( - ~requiresNamespace, - ~name, - ~inputs=[FRTypeNumber], - ~run=(_, inputs, _) => { - inputs - ->getOrError(0) - ->E.R.bind(Prepare.oneNumber) - ->E.R2.fmap(fn) - ->E.R2.fmap(Wrappers.evNumber) - }, - (), - ) - } - - module ArrayNumberDist = { - let make = (name, fn) => { - FnDefinition.make( - ~requiresNamespace=false, - ~name, - ~inputs=[FRTypeArray(FRTypeNumber)], - ~run=(_, inputs, _) => - Prepare.ToTypedArray.numbers(inputs) - ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) - ->E.R.bind(fn), - (), - ) - } - let make2 = (name, fn) => { - FnDefinition.make( - ~name, - ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(_, inputs, _) => - Prepare.ToTypedArray.numbers(inputs) - ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) - ->E.R.bind(fn), - (), - ) - } - } - - let library = [ - Function.make( - ~name="floor", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`floor(3.5)`], - ~definitions=[NumberToNumber.make("floor", Js.Math.floor_float)], - (), - ), - Function.make( - ~name="ceiling", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`ceiling(3.5)`], - ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)], - (), - ), - Function.make( - ~name="absolute value", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`abs(3.5)`], - ~definitions=[NumberToNumber.make("abs", Js.Math.abs_float)], - (), - ), - Function.make( - ~name="exponent", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`exp(3.5)`], - ~definitions=[NumberToNumber.make("exp", Js.Math.exp)], - (), - ), - Function.make( - ~name="log", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`log(3.5)`], - ~definitions=[NumberToNumber.make("log", Js.Math.log)], - (), - ), - Function.make( - ~name="log base 10", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`log10(3.5)`], - ~definitions=[NumberToNumber.make("log10", Js.Math.log10)], - (), - ), - Function.make( - ~name="log base 2", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`log2(3.5)`], - ~definitions=[NumberToNumber.make("log2", Js.Math.log2)], - (), - ), - Function.make( - ~name="round", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`round(3.5)`], - ~definitions=[NumberToNumber.make("round", Js.Math.round)], - (), - ), - Function.make( - ~name="sum", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`sum([3,5,2])`], - ~definitions=[ArrayNumberDist.make("sum", r => r->E.A.Floats.sum->Wrappers.evNumber->Ok)], - (), - ), - Function.make( - ~name="product", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`product([3,5,2])`], - ~definitions=[ - ArrayNumberDist.make("product", r => r->E.A.Floats.product->Wrappers.evNumber->Ok), - ], - (), - ), - Function.make( - ~name="min", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`min([3,5,2])`], - ~definitions=[ArrayNumberDist.make("min", r => r->E.A.Floats.min->Wrappers.evNumber->Ok)], - (), - ), - Function.make( - ~name="max", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`max([3,5,2])`], - ~definitions=[ArrayNumberDist.make("max", r => r->E.A.Floats.max->Wrappers.evNumber->Ok)], - (), - ), - Function.make( - ~name="mean", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`mean([3,5,2])`], - ~definitions=[ArrayNumberDist.make("mean", r => r->E.A.Floats.mean->Wrappers.evNumber->Ok)], - (), - ), - Function.make( - ~name="geometric mean", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`geomean([3,5,2])`], - ~definitions=[ - ArrayNumberDist.make("geomean", r => r->E.A.Floats.geomean->Wrappers.evNumber->Ok), - ], - (), - ), - Function.make( - ~name="standard deviation", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`stdev([3,5,2,3,5])`], - ~definitions=[ArrayNumberDist.make("stdev", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok)], - (), - ), - Function.make( - ~name="variance", - ~nameSpace, - ~output=EvtNumber, - ~examples=[`variance([3,5,2,3,5])`], - ~definitions=[ - ArrayNumberDist.make("variance", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok), - ], - (), - ), - Function.make( - ~name="sort", - ~nameSpace, - ~output=EvtArray, - ~examples=[`sort([3,5,2,3,5])`], - ~definitions=[ - ArrayNumberDist.make("sort", r => - r->E.A.Floats.sort->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok - ), - ], - (), - ), - Function.make( - ~name="cumulative sum", - ~nameSpace, - ~output=EvtArray, - ~examples=[`cumsum([3,5,2,3,5])`], - ~definitions=[ - ArrayNumberDist.make("cumsum", r => - r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok - ), - ], - (), - ), - Function.make( - ~name="cumulative prod", - ~nameSpace, - ~output=EvtArray, - ~examples=[`cumprod([3,5,2,3,5])`], - ~definitions=[ - ArrayNumberDist.make("cumprod", r => - r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok - ), - ], - (), - ), - Function.make( - ~name="diff", - ~nameSpace, - ~output=EvtArray, - ~examples=[`diff([3,5,2,3,5])`], - ~definitions=[ - ArrayNumberDist.make("diff", r => - r->E.A.Floats.diff->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok - ), - ], - (), - ), - ] -} - -module Dict = { - let nameSpace = "Dict" - module Internals = { - type t = ReducerInterface_InternalExpressionValue.map - - let keys = (a: t): internalExpressionValue => IEvArray( - Belt.Map.String.keysToArray(a)->E.A2.fmap(Wrappers.evString), - ) - - let values = (a: t): internalExpressionValue => IEvArray(Belt.Map.String.valuesToArray(a)) - - let toList = (a: t): internalExpressionValue => - Belt.Map.String.toArray(a) - ->E.A2.fmap(((key, value)) => Wrappers.evArray([IEvString(key), value])) - ->Wrappers.evArray - - let fromList = (items: array): result< - internalExpressionValue, - string, - > => - items - ->E.A2.fmap(item => { - switch (item: internalExpressionValue) { - | IEvArray([IEvString(string), value]) => (string, value)->Ok - | _ => Error(impossibleError) - } - }) - ->E.A.R.firstErrorOrOpen - ->E.R2.fmap(Belt.Map.String.fromArray) - ->E.R2.fmap(Wrappers.evRecord) - - let merge = (a: t, b: t): internalExpressionValue => IEvRecord( - Belt.Map.String.merge(a, b, (_, _, c) => c), - ) - - //Belt.Map.String has a function for mergeMany, but I couldn't understand how to use it yet. - let mergeMany = (a: array): internalExpressionValue => { - let mergedValues = - a->E.A2.fmap(Belt.Map.String.toArray)->Belt.Array.concatMany->Belt.Map.String.fromArray - IEvRecord(mergedValues) - } - } - - let library = [ - Function.make( - ~name="merge", - ~nameSpace, - ~output=EvtRecord, - ~examples=[`Dict.merge({a: 1, b: 2}, {c: 3, d: 4})`], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace=true, - ~name="merge", - ~inputs=[FRTypeDict(FRTypeAny), FRTypeDict(FRTypeAny)], - ~run=(inputs, _, _) => { - switch inputs { - | [IEvRecord(d1), IEvRecord(d2)] => Internals.merge(d1, d2)->Ok - | _ => Error(impossibleError) - } - }, - (), - ), - ], - (), - ), - //TODO: Change to use new mergeMany() function. - Function.make( - ~name="mergeMany", - ~nameSpace, - ~output=EvtRecord, - ~examples=[`Dict.mergeMany([{a: 1, b: 2}, {c: 3, d: 4}])`], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace=true, - ~name="mergeMany", - ~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))], - ~run=(_, inputs, _) => - inputs - ->Prepare.ToTypedArray.dicts - ->E.R2.fmap(E.Dict.concatMany) - ->E.R2.fmap(Js.Dict.map((. r) => FunctionRegistry_Core.FRType.matchReverse(r))) - ->E.R2.fmap(r => r->Js.Dict.entries->Belt.Map.String.fromArray) - ->E.R2.fmap(Wrappers.evRecord), - (), - ), - ], - (), - ), - Function.make( - ~name="keys", - ~nameSpace, - ~output=EvtArray, - ~examples=[`Dict.keys({a: 1, b: 2})`], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace=true, - ~name="keys", - ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _, _) => - switch inputs { - | [IEvRecord(d1)] => Internals.keys(d1)->Ok - | _ => Error(impossibleError) - }, - (), - ), - ], - (), - ), - Function.make( - ~name="values", - ~nameSpace, - ~output=EvtArray, - ~examples=[`Dict.values({a: 1, b: 2})`], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace=true, - ~name="values", - ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _, _) => - switch inputs { - | [IEvRecord(d1)] => Internals.values(d1)->Ok - | _ => Error(impossibleError) - }, - (), - ), - ], - (), - ), - Function.make( - ~name="toList", - ~nameSpace, - ~output=EvtArray, - ~examples=[`Dict.toList({a: 1, b: 2})`], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace=true, - ~name="toList", - ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _, _) => - switch inputs { - | [IEvRecord(dict)] => dict->Internals.toList->Ok - | _ => Error(impossibleError) - }, - (), - ), - ], - (), - ), - Function.make( - ~name="fromList", - ~nameSpace, - ~output=EvtRecord, - ~examples=[`Dict.fromList({a: 1, b: 2})`], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace=true, - ~name="fromList", - ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], - ~run=(inputs, _, _) => - switch inputs { - | [IEvArray(items)] => Internals.fromList(items) - | _ => Error(impossibleError) - }, - (), - ), - ], - (), - ), - ] -} - -module List = { - let nameSpace = "List" - let requiresNamespace = true - - module Internals = { - let makeFromNumber = ( - n: float, - value: internalExpressionValue, - ): internalExpressionValue => IEvArray(Belt.Array.make(E.Float.toInt(n), value)) - - let upTo = (low: float, high: float): internalExpressionValue => IEvArray( - E.A.Floats.range(low, high, (high -. low +. 1.0)->E.Float.toInt)->E.A2.fmap( - Wrappers.evNumber, - ), - ) - - let first = (v: array): result => - v->E.A.first |> E.O.toResult("No first element") - - let last = (v: array): result => - v->E.A.last |> E.O.toResult("No last element") - - let reverse = (array: array): internalExpressionValue => IEvArray( - Belt.Array.reverse(array), - ) - } - - let library = [ - Function.make( - ~name="make", - ~nameSpace, - ~output=EvtArray, - ~examples=[`List.make(2, "testValue")`], - ~definitions=[ - //Todo: If the second item is a function with no args, it could be nice to run this function and return the result. - FnDefinition.make( - ~requiresNamespace, - ~name="make", - ~inputs=[FRTypeNumber, FRTypeAny], - ~run=(inputs, _, _) => { - switch inputs { - | [IEvNumber(number), value] => Internals.makeFromNumber(number, value)->Ok - | _ => Error(impossibleError) - } - }, - (), - ), - ], - (), - ), - Function.make( - ~name="upTo", - ~nameSpace, - ~output=EvtArray, - ~examples=[`List.upTo(1,4)`], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace, - ~name="upTo", - ~inputs=[FRTypeNumber, FRTypeNumber], - ~run=(_, inputs, _) => - inputs - ->Prepare.ToValueTuple.twoNumbers - ->E.R2.fmap(((low, high)) => Internals.upTo(low, high)), - (), - ), - ], - (), - ), - Function.make( - ~name="first", - ~nameSpace, - ~examples=[`List.first([1,4,5])`], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace, - ~name="first", - ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _, _) => - switch inputs { - | [IEvArray(array)] => Internals.first(array) - | _ => Error(impossibleError) - }, - (), - ), - ], - (), - ), - Function.make( - ~name="last", - ~nameSpace, - ~examples=[`List.last([1,4,5])`], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace=false, - ~name="last", - ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _, _) => - switch inputs { - | [IEvArray(array)] => Internals.last(array) - | _ => Error(impossibleError) - }, - (), - ), - ], - (), - ), - Function.make( - ~name="reverse", - ~nameSpace, - ~output=EvtArray, - ~examples=[`List.reverse([1,4,5])`], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace=false, - ~name="reverse", - ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _, _) => - switch inputs { - | [IEvArray(array)] => Internals.reverse(array)->Ok - | _ => Error(impossibleError) - }, - (), - ), - ], - (), - ), - ] -} - -module Scoring = { - let nameSpace = "Dist" - let requiresNamespace = false - - let runScoring = (estimate, answer, prior, env) => { - GenericDist.Score.logScore(~estimate, ~answer, ~prior, ~env) - ->E.R2.fmap(FunctionRegistry_Helpers.Wrappers.evNumber) - ->E.R2.errMap(DistributionTypes.Error.toString) - } - - let library = [ - Function.make( - ~name="logScore", - ~nameSpace, - ~output=EvtNumber, - ~examples=[ - "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)}, prior: normal(5.5,3)})", - "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)}})", - "Dist.logScore({estimate: normal(5,2), answer: 4.5})", - ], - ~definitions=[ - FnDefinition.make( - ~requiresNamespace, - ~name="logScore", - ~inputs=[ - FRTypeRecord([ - ("estimate", FRTypeDist), - ("answer", FRTypeDistOrNumber), - ("prior", FRTypeDist), - ]), - ], - ~run=(_, inputs, env) => { - switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.threeArgs(inputs) { - | Ok([ - FRValueDist(estimate), - FRValueDistOrNumber(FRValueDist(d)), - FRValueDist(prior), - ]) => - runScoring(estimate, Score_Dist(d), Some(prior), env) - | Ok([ - FRValueDist(estimate), - FRValueDistOrNumber(FRValueNumber(d)), - FRValueDist(prior), - ]) => - runScoring(estimate, Score_Scalar(d), Some(prior), env) - | Error(e) => Error(e) - | _ => Error(FunctionRegistry_Helpers.impossibleError) - } - }, - (), - ), - FnDefinition.make( - ~name="logScore", - ~requiresNamespace, - ~inputs=[FRTypeRecord([("estimate", FRTypeDist), ("answer", FRTypeDistOrNumber)])], - ~run=(_, inputs, env) => { - switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs(inputs) { - | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueDist(d))]) => - runScoring(estimate, Score_Dist(d), None, env) - | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueNumber(d))]) => - runScoring(estimate, Score_Scalar(d), None, env) - | Error(e) => Error(e) - | _ => Error(FunctionRegistry_Helpers.impossibleError) - } - }, - (), - ), - ], - (), - ), - Function.make( - ~name="klDivergence", - ~nameSpace, - ~output=EvtNumber, - ~examples=[ - "Dist.klDivergence(normal(5,2), normal(5,1.5)", - ], - ~definitions=[ - FnDefinition.make( - ~name="klDivergence", - ~requiresNamespace, - ~inputs=[FRTypeDist, FRTypeDist], - ~run=(_, inputs, env) => { - switch inputs { - | [FRValueDist(estimate), FRValueDist(d)] => - runScoring(estimate, Score_Dist(d), None, env) - | _ => Error(FunctionRegistry_Helpers.impossibleError) - } - }, - (), - ), - ], - (), - ), - ] -} - let registry = Belt.Array.concatMany([ - PointSet.library, - Functionn.library, - Number.library, - Dict.library, - List.library, - DistributionCreation.library, - Scoring.library, + FR_Dict.library, + FR_Dist.library, + FR_Fn.library, + FR_List.library, + FR_Number.library, + FR_Pointset.library, + FR_Scoring.library ]) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res new file mode 100644 index 00000000..c8d28a78 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res @@ -0,0 +1,169 @@ +open FunctionRegistry_Core +open FunctionRegistry_Helpers + +let nameSpace = "Dict" + +module Internals = { + type t = ReducerInterface_InternalExpressionValue.map + + let keys = (a: t): internalExpressionValue => IEvArray( + Belt.Map.String.keysToArray(a)->E.A2.fmap(Wrappers.evString), + ) + + let values = (a: t): internalExpressionValue => IEvArray(Belt.Map.String.valuesToArray(a)) + + let toList = (a: t): internalExpressionValue => + Belt.Map.String.toArray(a) + ->E.A2.fmap(((key, value)) => Wrappers.evArray([IEvString(key), value])) + ->Wrappers.evArray + + let fromList = (items: array): result => + items + ->E.A2.fmap(item => { + switch (item: internalExpressionValue) { + | IEvArray([IEvString(string), value]) => (string, value)->Ok + | _ => Error(impossibleError) + } + }) + ->E.A.R.firstErrorOrOpen + ->E.R2.fmap(Belt.Map.String.fromArray) + ->E.R2.fmap(Wrappers.evRecord) + + let merge = (a: t, b: t): internalExpressionValue => IEvRecord( + Belt.Map.String.merge(a, b, (_, _, c) => c), + ) + + //Belt.Map.String has a function for mergeMany, but I couldn't understand how to use it yet. + let mergeMany = (a: array): internalExpressionValue => { + let mergedValues = + a->E.A2.fmap(Belt.Map.String.toArray)->Belt.Array.concatMany->Belt.Map.String.fromArray + IEvRecord(mergedValues) + } +} + +let library = [ + Function.make( + ~name="merge", + ~nameSpace, + ~output=EvtRecord, + ~examples=[`Dict.merge({a: 1, b: 2}, {c: 3, d: 4})`], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=true, + ~name="merge", + ~inputs=[FRTypeDict(FRTypeAny), FRTypeDict(FRTypeAny)], + ~run=(inputs, _, _) => { + switch inputs { + | [IEvRecord(d1), IEvRecord(d2)] => Internals.merge(d1, d2)->Ok + | _ => Error(impossibleError) + } + }, + (), + ), + ], + (), + ), + //TODO: Change to use new mergeMany() function. + Function.make( + ~name="mergeMany", + ~nameSpace, + ~output=EvtRecord, + ~examples=[`Dict.mergeMany([{a: 1, b: 2}, {c: 3, d: 4}])`], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=true, + ~name="mergeMany", + ~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))], + ~run=(_, inputs, _) => + inputs + ->Prepare.ToTypedArray.dicts + ->E.R2.fmap(E.Dict.concatMany) + ->E.R2.fmap(Js.Dict.map((. r) => FunctionRegistry_Core.FRType.matchReverse(r))) + ->E.R2.fmap(r => r->Js.Dict.entries->Belt.Map.String.fromArray) + ->E.R2.fmap(Wrappers.evRecord), + (), + ), + ], + (), + ), + Function.make( + ~name="keys", + ~nameSpace, + ~output=EvtArray, + ~examples=[`Dict.keys({a: 1, b: 2})`], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=true, + ~name="keys", + ~inputs=[FRTypeDict(FRTypeAny)], + ~run=(inputs, _, _) => + switch inputs { + | [IEvRecord(d1)] => Internals.keys(d1)->Ok + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="values", + ~nameSpace, + ~output=EvtArray, + ~examples=[`Dict.values({a: 1, b: 2})`], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=true, + ~name="values", + ~inputs=[FRTypeDict(FRTypeAny)], + ~run=(inputs, _, _) => + switch inputs { + | [IEvRecord(d1)] => Internals.values(d1)->Ok + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="toList", + ~nameSpace, + ~output=EvtArray, + ~examples=[`Dict.toList({a: 1, b: 2})`], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=true, + ~name="toList", + ~inputs=[FRTypeDict(FRTypeAny)], + ~run=(inputs, _, _) => + switch inputs { + | [IEvRecord(dict)] => dict->Internals.toList->Ok + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="fromList", + ~nameSpace, + ~output=EvtRecord, + ~examples=[`Dict.fromList({a: 1, b: 2})`], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=true, + ~name="fromList", + ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], + ~run=(inputs, _, _) => + switch inputs { + | [IEvArray(items)] => Internals.fromList(items) + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), +] diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res new file mode 100644 index 00000000..35e17dd3 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res @@ -0,0 +1,155 @@ +open FunctionRegistry_Core +open FunctionRegistry_Helpers +let twoArgs = E.Tuple2.toFnCall + +module DistributionCreation = { + let nameSpace = "Dist" + let output = ReducerInterface_InternalExpressionValue.EvtDistribution + + let fnMake = (~name, ~examples, ~definitions) => { + Function.make(~name, ~nameSpace, ~output, ~examples, ~definitions, ()) + } + + module TwoArgDist = { + let process = (~fn, ~env, r) => + r + ->E.R.bind(Process.DistOrNumberToDist.twoValuesUsingSymbolicDist(~fn, ~values=_, ~env)) + ->E.R2.fmap(Wrappers.evDistribution) + + let make = (name, fn) => { + FnDefinition.make( + ~requiresNamespace=false, + ~name, + ~inputs=[FRTypeDistOrNumber, FRTypeDistOrNumber], + ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env), + (), + ) + } + + let makeRecordP5P95 = (name, fn) => { + FnDefinition.make( + ~requiresNamespace=false, + ~name, + ~inputs=[FRTypeRecord([("p5", FRTypeDistOrNumber), ("p95", FRTypeDistOrNumber)])], + ~run=(_, inputs, env) => + inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), + (), + ) + } + + let makeRecordMeanStdev = (name, fn) => { + FnDefinition.make( + ~name, + ~requiresNamespace=false, + ~inputs=[FRTypeRecord([("mean", FRTypeDistOrNumber), ("stdev", FRTypeDistOrNumber)])], + ~run=(_, inputs, env) => + inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), + (), + ) + } + } + + module OneArgDist = { + let process = (~fn, ~env, r) => + r + ->E.R.bind(Process.DistOrNumberToDist.oneValueUsingSymbolicDist(~fn, ~value=_, ~env)) + ->E.R2.fmap(Wrappers.evDistribution) + + let make = (name, fn) => + FnDefinition.make( + ~requiresNamespace=false, + ~name, + ~inputs=[FRTypeDistOrNumber], + ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env), + (), + ) + } + + let library = [ + fnMake( + ~name="normal", + ~examples=["normal(5,1)", "normal({p5: 4, p95: 10})", "normal({mean: 5, stdev: 2})"], + ~definitions=[ + TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)), + TwoArgDist.makeRecordP5P95("normal", r => + twoArgs(SymbolicDist.Normal.from90PercentCI, r)->Ok + ), + TwoArgDist.makeRecordMeanStdev("normal", twoArgs(SymbolicDist.Normal.make)), + ], + ), + fnMake( + ~name="lognormal", + ~examples=[ + "lognormal(0.5, 0.8)", + "lognormal({p5: 4, p95: 10})", + "lognormal({mean: 5, stdev: 2})", + ], + ~definitions=[ + TwoArgDist.make("lognormal", twoArgs(SymbolicDist.Lognormal.make)), + TwoArgDist.makeRecordP5P95("lognormal", r => + twoArgs(SymbolicDist.Lognormal.from90PercentCI, r)->Ok + ), + TwoArgDist.makeRecordMeanStdev( + "lognormal", + twoArgs(SymbolicDist.Lognormal.fromMeanAndStdev), + ), + ], + ), + fnMake( + ~name="uniform", + ~examples=[`uniform(10, 12)`], + ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], + ), + fnMake( + ~name="beta", + ~examples=[`beta(20, 25)`, `beta({mean: 0.39, stdev: 0.1})`], + ~definitions=[ + TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make)), + TwoArgDist.makeRecordMeanStdev("beta", twoArgs(SymbolicDist.Beta.fromMeanAndStdev)), + ], + ), + fnMake( + ~name="cauchy", + ~examples=[`cauchy(5, 1)`], + ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], + ), + fnMake( + ~name="gamma", + ~examples=[`gamma(5, 1)`], + ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], + ), + fnMake( + ~name="logistic", + ~examples=[`logistic(5, 1)`], + ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], + ), + fnMake( + ~name="to (distribution)", + ~examples=[`5 to 10`, `to(5,10)`, `-5 to 5`], + ~definitions=[ + TwoArgDist.make("to", twoArgs(SymbolicDist.From90thPercentile.make)), + TwoArgDist.make( + "credibleIntervalToDistribution", + twoArgs(SymbolicDist.From90thPercentile.make), + ), + ], + ), + fnMake( + ~name="exponential", + ~examples=[`exponential(2)`], + ~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)], + ), + fnMake( + ~name="bernoulli", + ~examples=[`bernoulli(0.5)`], + ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], + ), + fnMake( + ~name="pointMass", + ~examples=[`pointMass(0.5)`], + ~definitions=[OneArgDist.make("pointMass", SymbolicDist.Float.makeSafe)], + ), + ] +} + +let library = DistributionCreation.library \ No newline at end of file diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res new file mode 100644 index 00000000..b30cac2d --- /dev/null +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res @@ -0,0 +1,61 @@ +open FunctionRegistry_Core +open FunctionRegistry_Helpers + +module Declaration = { + let frType = FRTypeRecord([ + ("fn", FRTypeLambda), + ("inputs", FRTypeArray(FRTypeRecord([("min", FRTypeNumber), ("max", FRTypeNumber)]))), + ]) + + let fromExpressionValue = (e: frValue): result => { + switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs([e]) { + | Ok([FRValueLambda(lambda), FRValueArray(inputs)]) => { + open FunctionRegistry_Helpers.Prepare + let getMinMax = arg => + ToValueArray.Record.toArgs([arg]) + ->E.R.bind(ToValueTuple.twoNumbers) + ->E.R2.fmap(((min, max)) => Declaration.ContinuousFloatArg.make(min, max)) + inputs + ->E.A2.fmap(getMinMax) + ->E.A.R.firstErrorOrOpen + ->E.R2.fmap(args => ReducerInterface_InternalExpressionValue.IEvDeclaration( + Declaration.make(lambda, args), + )) + } + | Error(r) => Error(r) + | Ok(_) => Error(FunctionRegistry_Helpers.impossibleError) + } + } +} + +let nameSpace = "Function" + +let library = [ + Function.make( + ~name="declare", + ~nameSpace, + ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", + ~examples=[ + `declareFn({ + fn: {|a,b| a }, + inputs: [ + {min: 0, max: 100}, + {min: 30, max: 50} + ] +})`, + ], + ~isExperimental=true, + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=true, + ~name="declare", + ~inputs=[Declaration.frType], + ~run=(_, inputs, _) => { + inputs->getOrError(0)->E.R.bind(Declaration.fromExpressionValue) + }, + (), + ), + ], + (), + ), +] diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res new file mode 100644 index 00000000..9c064966 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res @@ -0,0 +1,128 @@ +open FunctionRegistry_Core +open FunctionRegistry_Helpers + +let nameSpace = "List" +let requiresNamespace = true + +module Internals = { + let makeFromNumber = ( + n: float, + value: internalExpressionValue, + ): internalExpressionValue => IEvArray(Belt.Array.make(E.Float.toInt(n), value)) + + let upTo = (low: float, high: float): internalExpressionValue => IEvArray( + E.A.Floats.range(low, high, (high -. low +. 1.0)->E.Float.toInt)->E.A2.fmap(Wrappers.evNumber), + ) + + let first = (v: array): result => + v->E.A.first |> E.O.toResult("No first element") + + let last = (v: array): result => + v->E.A.last |> E.O.toResult("No last element") + + let reverse = (array: array): internalExpressionValue => IEvArray( + Belt.Array.reverse(array), + ) +} + +let library = [ + Function.make( + ~name="make", + ~nameSpace, + ~output=EvtArray, + ~examples=[`List.make(2, "testValue")`], + ~definitions=[ + //Todo: If the second item is a function with no args, it could be nice to run this function and return the result. + FnDefinition.make( + ~requiresNamespace, + ~name="make", + ~inputs=[FRTypeNumber, FRTypeAny], + ~run=(inputs, _, _) => { + switch inputs { + | [IEvNumber(number), value] => Internals.makeFromNumber(number, value)->Ok + | _ => Error(impossibleError) + } + }, + (), + ), + ], + (), + ), + Function.make( + ~name="upTo", + ~nameSpace, + ~output=EvtArray, + ~examples=[`List.upTo(1,4)`], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace, + ~name="upTo", + ~inputs=[FRTypeNumber, FRTypeNumber], + ~run=(_, inputs, _) => + inputs + ->Prepare.ToValueTuple.twoNumbers + ->E.R2.fmap(((low, high)) => Internals.upTo(low, high)), + (), + ), + ], + (), + ), + Function.make( + ~name="first", + ~nameSpace, + ~examples=[`List.first([1,4,5])`], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace, + ~name="first", + ~inputs=[FRTypeArray(FRTypeAny)], + ~run=(inputs, _, _) => + switch inputs { + | [IEvArray(array)] => Internals.first(array) + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="last", + ~nameSpace, + ~examples=[`List.last([1,4,5])`], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=false, + ~name="last", + ~inputs=[FRTypeArray(FRTypeAny)], + ~run=(inputs, _, _) => + switch inputs { + | [IEvArray(array)] => Internals.last(array) + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="reverse", + ~nameSpace, + ~output=EvtArray, + ~examples=[`List.reverse([1,4,5])`], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace=false, + ~name="reverse", + ~inputs=[FRTypeArray(FRTypeAny)], + ~run=(inputs, _, _) => + switch inputs { + | [IEvArray(array)] => Internals.reverse(array)->Ok + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), +] diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res new file mode 100644 index 00000000..0dba4c9a --- /dev/null +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res @@ -0,0 +1,233 @@ +open FunctionRegistry_Core +open FunctionRegistry_Helpers + +let nameSpace = "Number" +let requiresNamespace = false + +module NumberToNumber = { + let make = (name, fn) => + FnDefinition.make( + ~requiresNamespace, + ~name, + ~inputs=[FRTypeNumber], + ~run=(_, inputs, _) => { + inputs + ->getOrError(0) + ->E.R.bind(Prepare.oneNumber) + ->E.R2.fmap(fn) + ->E.R2.fmap(Wrappers.evNumber) + }, + (), + ) +} + +module ArrayNumberDist = { + let make = (name, fn) => { + FnDefinition.make( + ~requiresNamespace=false, + ~name, + ~inputs=[FRTypeArray(FRTypeNumber)], + ~run=(_, inputs, _) => + Prepare.ToTypedArray.numbers(inputs) + ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) + ->E.R.bind(fn), + (), + ) + } + let make2 = (name, fn) => { + FnDefinition.make( + ~name, + ~inputs=[FRTypeArray(FRTypeAny)], + ~run=(_, inputs, _) => + Prepare.ToTypedArray.numbers(inputs) + ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) + ->E.R.bind(fn), + (), + ) + } +} + +let library = [ + Function.make( + ~name="floor", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`floor(3.5)`], + ~definitions=[NumberToNumber.make("floor", Js.Math.floor_float)], + (), + ), + Function.make( + ~name="ceiling", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`ceiling(3.5)`], + ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)], + (), + ), + Function.make( + ~name="absolute value", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`abs(3.5)`], + ~definitions=[NumberToNumber.make("abs", Js.Math.abs_float)], + (), + ), + Function.make( + ~name="exponent", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`exp(3.5)`], + ~definitions=[NumberToNumber.make("exp", Js.Math.exp)], + (), + ), + Function.make( + ~name="log", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`log(3.5)`], + ~definitions=[NumberToNumber.make("log", Js.Math.log)], + (), + ), + Function.make( + ~name="log base 10", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`log10(3.5)`], + ~definitions=[NumberToNumber.make("log10", Js.Math.log10)], + (), + ), + Function.make( + ~name="log base 2", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`log2(3.5)`], + ~definitions=[NumberToNumber.make("log2", Js.Math.log2)], + (), + ), + Function.make( + ~name="round", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`round(3.5)`], + ~definitions=[NumberToNumber.make("round", Js.Math.round)], + (), + ), + Function.make( + ~name="sum", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`sum([3,5,2])`], + ~definitions=[ArrayNumberDist.make("sum", r => r->E.A.Floats.sum->Wrappers.evNumber->Ok)], + (), + ), + Function.make( + ~name="product", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`product([3,5,2])`], + ~definitions=[ + ArrayNumberDist.make("product", r => r->E.A.Floats.product->Wrappers.evNumber->Ok), + ], + (), + ), + Function.make( + ~name="min", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`min([3,5,2])`], + ~definitions=[ArrayNumberDist.make("min", r => r->E.A.Floats.min->Wrappers.evNumber->Ok)], + (), + ), + Function.make( + ~name="max", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`max([3,5,2])`], + ~definitions=[ArrayNumberDist.make("max", r => r->E.A.Floats.max->Wrappers.evNumber->Ok)], + (), + ), + Function.make( + ~name="mean", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`mean([3,5,2])`], + ~definitions=[ArrayNumberDist.make("mean", r => r->E.A.Floats.mean->Wrappers.evNumber->Ok)], + (), + ), + Function.make( + ~name="geometric mean", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`geomean([3,5,2])`], + ~definitions=[ + ArrayNumberDist.make("geomean", r => r->E.A.Floats.geomean->Wrappers.evNumber->Ok), + ], + (), + ), + Function.make( + ~name="standard deviation", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`stdev([3,5,2,3,5])`], + ~definitions=[ArrayNumberDist.make("stdev", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok)], + (), + ), + Function.make( + ~name="variance", + ~nameSpace, + ~output=EvtNumber, + ~examples=[`variance([3,5,2,3,5])`], + ~definitions=[ + ArrayNumberDist.make("variance", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok), + ], + (), + ), + Function.make( + ~name="sort", + ~nameSpace, + ~output=EvtArray, + ~examples=[`sort([3,5,2,3,5])`], + ~definitions=[ + ArrayNumberDist.make("sort", r => + r->E.A.Floats.sort->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + ), + ], + (), + ), + Function.make( + ~name="cumulative sum", + ~nameSpace, + ~output=EvtArray, + ~examples=[`cumsum([3,5,2,3,5])`], + ~definitions=[ + ArrayNumberDist.make("cumsum", r => + r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + ), + ], + (), + ), + Function.make( + ~name="cumulative prod", + ~nameSpace, + ~output=EvtArray, + ~examples=[`cumprod([3,5,2,3,5])`], + ~definitions=[ + ArrayNumberDist.make("cumprod", r => + r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + ), + ], + (), + ), + Function.make( + ~name="diff", + ~nameSpace, + ~output=EvtArray, + ~examples=[`diff([3,5,2,3,5])`], + ~definitions=[ + ArrayNumberDist.make("diff", r => + r->E.A.Floats.diff->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + ), + ], + (), + ), +] diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res new file mode 100644 index 00000000..92e4ab5f --- /dev/null +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -0,0 +1,55 @@ +open FunctionRegistry_Core +open FunctionRegistry_Helpers + +let nameSpace = "PointSet" +let requiresNamespace = true + +let inputsTodist = (inputs: array, makeDist) => { + let array = inputs->getOrError(0)->E.R.bind(Prepare.ToValueArray.Array.openA) + let xyCoords = + array->E.R.bind(xyCoords => + xyCoords + ->E.A2.fmap(xyCoord => + [xyCoord]->Prepare.ToValueArray.Record.twoArgs->E.R.bind(Prepare.ToValueTuple.twoNumbers) + ) + ->E.A.R.firstErrorOrOpen + ) + let expressionValue = + xyCoords + ->E.R.bind(r => r->XYShape.T.makeFromZipped->E.R2.errMap(XYShape.Error.toString)) + ->E.R2.fmap(r => ReducerInterface_InternalExpressionValue.IEvDistribution( + PointSet(makeDist(r)), + )) + expressionValue +} + +let library = [ + Function.make( + ~name="makeContinuous", + ~nameSpace, + ~definitions=[ + FnDefinition.make( + ~requiresNamespace, + ~name="makeContinuous", + ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], + ~run=(_, inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + (), + ), + ], + (), + ), + Function.make( + ~name="makeDiscrete", + ~nameSpace, + ~definitions=[ + FnDefinition.make( + ~requiresNamespace, + ~name="makeDiscrete", + ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], + ~run=(_, inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + (), + ), + ], + (), + ), +] diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res new file mode 100644 index 00000000..19886841 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res @@ -0,0 +1,90 @@ +open FunctionRegistry_Core + +let nameSpace = "Dist" +let requiresNamespace = false + +let runScoring = (estimate, answer, prior, env) => { + GenericDist.Score.logScore(~estimate, ~answer, ~prior, ~env) + ->E.R2.fmap(FunctionRegistry_Helpers.Wrappers.evNumber) + ->E.R2.errMap(DistributionTypes.Error.toString) +} + +let library = [ + Function.make( + ~name="logScore", + ~nameSpace, + ~output=EvtNumber, + ~examples=[ + "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)}, prior: normal(5.5,3)})", + "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)}})", + "Dist.logScore({estimate: normal(5,2), answer: 4.5})", + ], + ~definitions=[ + FnDefinition.make( + ~requiresNamespace, + ~name="logScore", + ~inputs=[ + FRTypeRecord([ + ("estimate", FRTypeDist), + ("answer", FRTypeDistOrNumber), + ("prior", FRTypeDist), + ]), + ], + ~run=(_, inputs, env) => { + switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.threeArgs(inputs) { + | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueDist(d)), FRValueDist(prior)]) => + runScoring(estimate, Score_Dist(d), Some(prior), env) + | Ok([ + FRValueDist(estimate), + FRValueDistOrNumber(FRValueNumber(d)), + FRValueDist(prior), + ]) => + runScoring(estimate, Score_Scalar(d), Some(prior), env) + | Error(e) => Error(e) + | _ => Error(FunctionRegistry_Helpers.impossibleError) + } + }, + (), + ), + FnDefinition.make( + ~name="logScore", + ~requiresNamespace, + ~inputs=[FRTypeRecord([("estimate", FRTypeDist), ("answer", FRTypeDistOrNumber)])], + ~run=(_, inputs, env) => { + switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs(inputs) { + | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueDist(d))]) => + runScoring(estimate, Score_Dist(d), None, env) + | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueNumber(d))]) => + runScoring(estimate, Score_Scalar(d), None, env) + | Error(e) => Error(e) + | _ => Error(FunctionRegistry_Helpers.impossibleError) + } + }, + (), + ), + ], + (), + ), + Function.make( + ~name="klDivergence", + ~nameSpace, + ~output=EvtNumber, + ~examples=["Dist.klDivergence(normal(5,2), normal(5,1.5)"], + ~definitions=[ + FnDefinition.make( + ~name="klDivergence", + ~requiresNamespace, + ~inputs=[FRTypeDist, FRTypeDist], + ~run=(_, inputs, env) => { + switch inputs { + | [FRValueDist(estimate), FRValueDist(d)] => + runScoring(estimate, Score_Dist(d), None, env) + | _ => Error(FunctionRegistry_Helpers.impossibleError) + } + }, + (), + ), + ], + (), + ), +] From d88fb9576748d1236e69015ac78689b64378b7b8 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 16 Jul 2022 18:11:38 -0700 Subject: [PATCH 022/203] Simple reformatting, got RequiresNamespace to work --- .../__tests__/FunctionRegistry_test.res | 5 ++--- .../FunctionRegistry_Core.res | 16 ++++++++------ .../FunctionRegistry_Library.res | 2 +- .../FunctionRegistry/Library/FR_Dict.res | 12 +++++----- .../FunctionRegistry/Library/FR_Dist.res | 9 +++----- .../FunctionRegistry/Library/FR_Fn.res | 2 +- .../FunctionRegistry/Library/FR_List.res | 10 ++++----- .../FunctionRegistry/Library/FR_Number.res | 22 +++++++++++++++++-- .../FunctionRegistry/Library/FR_Pointset.res | 4 ++-- .../FunctionRegistry/Library/FR_Scoring.res | 7 +++--- .../ReducerInterface_ExternalLibrary.res | 9 +++++--- 11 files changed, 58 insertions(+), 40 deletions(-) diff --git a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res index 47d3005a..2909f7d1 100644 --- a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res +++ b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res @@ -18,11 +18,11 @@ module FooImplementation = { let fn = Function.make( ~name="add", ~nameSpace="Foo", + ~requiresNamespace=false, ~examples=["Foo.add(1, 2)", "Foo.add(1, 2, 3)"], ~output=EvtNumber, ~definitions=[ FnDefinition.make( - ~requiresNamespace=false, ~name="add", ~inputs=[FRTypeNumber, FRTypeNumber], ~run=(_, inputs, _) => @@ -33,7 +33,6 @@ module FooImplementation = { (), ), FnDefinition.make( - ~requiresNamespace=true, ~name="add", ~inputs=[FRTypeNumber, FRTypeNumber, FRTypeNumber], ~run=(_, inputs, _) => @@ -92,4 +91,4 @@ describe("Fn auto-testing", () => { let expectedOutputType = FooImplementation.fn.output |> E.O.toExn("") expect(responseType)->toEqual(Ok(expectedOutputType)) }) -}) \ No newline at end of file +}) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index d2d2a080..887ac3f7 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -41,7 +41,6 @@ and frValueDictParam = (string, frValue) and frValueDistOrNumber = FRValueNumber(float) | FRValueDist(DistributionTypes.genericDist) type fnDefinition = { - requiresNamespace: bool, name: string, inputs: array, run: ( @@ -54,6 +53,7 @@ type fnDefinition = { type function = { name: string, definitions: array, + requiresNamespace: bool, nameSpace: string, output: option, examples: array, @@ -352,9 +352,8 @@ module FnDefinition = { let toLambda = (t: t) => Reducer_Module.convertOptionToFfiFn(t.name, toFfiFn(t))->Reducer_Module.eLambdaFFIValue - let make = (~requiresNamespace=true, ~name, ~inputs, ~run, ()): t => { + let make = (~name, ~inputs, ~run, ()): t => { name: name, - requiresNamespace: requiresNamespace, inputs: inputs, run: run, } @@ -374,6 +373,7 @@ module Function = { let make = ( ~name, ~nameSpace, + ~requiresNamespace, ~definitions, ~examples=?, ~output=?, @@ -387,6 +387,7 @@ module Function = { output: output, examples: examples |> E.O.default([]), isExperimental: isExperimental, + requiresNamespace: requiresNamespace, description: description, } @@ -427,6 +428,9 @@ module NameSpace = { module Registry = { let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) + + let exportedSubset = (r: registry): registry => r |> E.A.filter(r => !r.requiresNamespace) + let definitionsWithFunctions = (r: registry) => r->E.A2.fmap(fn => fn.definitions->E.A2.fmap(def => (def, fn)))->E.A.concatMany @@ -442,7 +446,6 @@ module Registry = { ~env: GenericDist.env, ) => { let matchToDef = m => Matcher.Registry.matchToDef(registry, m) - //Js.log(toSimple(registry)) let showNameMatchDefinitions = matches => { let defs = matches @@ -460,17 +463,16 @@ module Registry = { } } - //todo: get namespace from project. let allNamespaces = (t: registry) => t->E.A2.fmap(r => r.nameSpace)->E.A.uniq let makeModules = (prevBindings: Reducer_Module.t, t: registry): Reducer_Module.t => { let nameSpaces = allNamespaces(t) let nameSpaceBindings = nameSpaces->E.A2.fmap(nameSpace => { - let foo: NameSpace.t = { + let namespaceModule: NameSpace.t = { name: nameSpace, functions: t->E.A2.filter(r => r.nameSpace == nameSpace), } - (nameSpace, NameSpace.toModule(foo)) + (nameSpace, NameSpace.toModule(namespaceModule)) }) E.A.reduce(nameSpaceBindings, prevBindings, (acc, (name, fn)) => acc->Reducer_Module.defineModule(name, fn) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 949837b5..3c74398a 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -5,5 +5,5 @@ let registry = Belt.Array.concatMany([ FR_List.library, FR_Number.library, FR_Pointset.library, - FR_Scoring.library + FR_Scoring.library, ]) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res index c8d28a78..fdb8e191 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res @@ -45,11 +45,11 @@ let library = [ Function.make( ~name="merge", ~nameSpace, + ~requiresNamespace=true, ~output=EvtRecord, ~examples=[`Dict.merge({a: 1, b: 2}, {c: 3, d: 4})`], ~definitions=[ FnDefinition.make( - ~requiresNamespace=true, ~name="merge", ~inputs=[FRTypeDict(FRTypeAny), FRTypeDict(FRTypeAny)], ~run=(inputs, _, _) => { @@ -67,11 +67,11 @@ let library = [ Function.make( ~name="mergeMany", ~nameSpace, + ~requiresNamespace=true, ~output=EvtRecord, ~examples=[`Dict.mergeMany([{a: 1, b: 2}, {c: 3, d: 4}])`], ~definitions=[ FnDefinition.make( - ~requiresNamespace=true, ~name="mergeMany", ~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))], ~run=(_, inputs, _) => @@ -89,11 +89,11 @@ let library = [ Function.make( ~name="keys", ~nameSpace, + ~requiresNamespace=true, ~output=EvtArray, ~examples=[`Dict.keys({a: 1, b: 2})`], ~definitions=[ FnDefinition.make( - ~requiresNamespace=true, ~name="keys", ~inputs=[FRTypeDict(FRTypeAny)], ~run=(inputs, _, _) => @@ -109,11 +109,11 @@ let library = [ Function.make( ~name="values", ~nameSpace, + ~requiresNamespace=true, ~output=EvtArray, ~examples=[`Dict.values({a: 1, b: 2})`], ~definitions=[ FnDefinition.make( - ~requiresNamespace=true, ~name="values", ~inputs=[FRTypeDict(FRTypeAny)], ~run=(inputs, _, _) => @@ -129,11 +129,11 @@ let library = [ Function.make( ~name="toList", ~nameSpace, + ~requiresNamespace=true, ~output=EvtArray, ~examples=[`Dict.toList({a: 1, b: 2})`], ~definitions=[ FnDefinition.make( - ~requiresNamespace=true, ~name="toList", ~inputs=[FRTypeDict(FRTypeAny)], ~run=(inputs, _, _) => @@ -149,11 +149,11 @@ let library = [ Function.make( ~name="fromList", ~nameSpace, + ~requiresNamespace=true, ~output=EvtRecord, ~examples=[`Dict.fromList({a: 1, b: 2})`], ~definitions=[ FnDefinition.make( - ~requiresNamespace=true, ~name="fromList", ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], ~run=(inputs, _, _) => diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res index 35e17dd3..424983d8 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res @@ -5,9 +5,10 @@ let twoArgs = E.Tuple2.toFnCall module DistributionCreation = { let nameSpace = "Dist" let output = ReducerInterface_InternalExpressionValue.EvtDistribution + let requiresNamespace = false let fnMake = (~name, ~examples, ~definitions) => { - Function.make(~name, ~nameSpace, ~output, ~examples, ~definitions, ()) + Function.make(~name, ~nameSpace, ~output, ~examples, ~definitions, ~requiresNamespace, ()) } module TwoArgDist = { @@ -18,7 +19,6 @@ module DistributionCreation = { let make = (name, fn) => { FnDefinition.make( - ~requiresNamespace=false, ~name, ~inputs=[FRTypeDistOrNumber, FRTypeDistOrNumber], ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env), @@ -28,7 +28,6 @@ module DistributionCreation = { let makeRecordP5P95 = (name, fn) => { FnDefinition.make( - ~requiresNamespace=false, ~name, ~inputs=[FRTypeRecord([("p5", FRTypeDistOrNumber), ("p95", FRTypeDistOrNumber)])], ~run=(_, inputs, env) => @@ -40,7 +39,6 @@ module DistributionCreation = { let makeRecordMeanStdev = (name, fn) => { FnDefinition.make( ~name, - ~requiresNamespace=false, ~inputs=[FRTypeRecord([("mean", FRTypeDistOrNumber), ("stdev", FRTypeDistOrNumber)])], ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), @@ -57,7 +55,6 @@ module DistributionCreation = { let make = (name, fn) => FnDefinition.make( - ~requiresNamespace=false, ~name, ~inputs=[FRTypeDistOrNumber], ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env), @@ -152,4 +149,4 @@ module DistributionCreation = { ] } -let library = DistributionCreation.library \ No newline at end of file +let library = DistributionCreation.library diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res index b30cac2d..1e423f52 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res @@ -34,6 +34,7 @@ let library = [ Function.make( ~name="declare", ~nameSpace, + ~requiresNamespace=true, ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", ~examples=[ `declareFn({ @@ -47,7 +48,6 @@ let library = [ ~isExperimental=true, ~definitions=[ FnDefinition.make( - ~requiresNamespace=true, ~name="declare", ~inputs=[Declaration.frType], ~run=(_, inputs, _) => { diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res index 9c064966..25924232 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res @@ -29,12 +29,12 @@ let library = [ Function.make( ~name="make", ~nameSpace, + ~requiresNamespace, ~output=EvtArray, ~examples=[`List.make(2, "testValue")`], ~definitions=[ //Todo: If the second item is a function with no args, it could be nice to run this function and return the result. FnDefinition.make( - ~requiresNamespace, ~name="make", ~inputs=[FRTypeNumber, FRTypeAny], ~run=(inputs, _, _) => { @@ -51,11 +51,11 @@ let library = [ Function.make( ~name="upTo", ~nameSpace, + ~requiresNamespace, ~output=EvtArray, ~examples=[`List.upTo(1,4)`], ~definitions=[ FnDefinition.make( - ~requiresNamespace, ~name="upTo", ~inputs=[FRTypeNumber, FRTypeNumber], ~run=(_, inputs, _) => @@ -70,10 +70,10 @@ let library = [ Function.make( ~name="first", ~nameSpace, + ~requiresNamespace, ~examples=[`List.first([1,4,5])`], ~definitions=[ FnDefinition.make( - ~requiresNamespace, ~name="first", ~inputs=[FRTypeArray(FRTypeAny)], ~run=(inputs, _, _) => @@ -89,10 +89,10 @@ let library = [ Function.make( ~name="last", ~nameSpace, + ~requiresNamespace, ~examples=[`List.last([1,4,5])`], ~definitions=[ FnDefinition.make( - ~requiresNamespace=false, ~name="last", ~inputs=[FRTypeArray(FRTypeAny)], ~run=(inputs, _, _) => @@ -109,10 +109,10 @@ let library = [ ~name="reverse", ~nameSpace, ~output=EvtArray, + ~requiresNamespace=false, ~examples=[`List.reverse([1,4,5])`], ~definitions=[ FnDefinition.make( - ~requiresNamespace=false, ~name="reverse", ~inputs=[FRTypeArray(FRTypeAny)], ~run=(inputs, _, _) => diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res index 0dba4c9a..10d5d1f2 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res @@ -7,7 +7,6 @@ let requiresNamespace = false module NumberToNumber = { let make = (name, fn) => FnDefinition.make( - ~requiresNamespace, ~name, ~inputs=[FRTypeNumber], ~run=(_, inputs, _) => { @@ -24,7 +23,6 @@ module NumberToNumber = { module ArrayNumberDist = { let make = (name, fn) => { FnDefinition.make( - ~requiresNamespace=false, ~name, ~inputs=[FRTypeArray(FRTypeNumber)], ~run=(_, inputs, _) => @@ -51,6 +49,7 @@ let library = [ Function.make( ~name="floor", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`floor(3.5)`], ~definitions=[NumberToNumber.make("floor", Js.Math.floor_float)], @@ -59,6 +58,7 @@ let library = [ Function.make( ~name="ceiling", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`ceiling(3.5)`], ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)], @@ -67,6 +67,7 @@ let library = [ Function.make( ~name="absolute value", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`abs(3.5)`], ~definitions=[NumberToNumber.make("abs", Js.Math.abs_float)], @@ -75,6 +76,7 @@ let library = [ Function.make( ~name="exponent", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`exp(3.5)`], ~definitions=[NumberToNumber.make("exp", Js.Math.exp)], @@ -83,6 +85,7 @@ let library = [ Function.make( ~name="log", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`log(3.5)`], ~definitions=[NumberToNumber.make("log", Js.Math.log)], @@ -91,6 +94,7 @@ let library = [ Function.make( ~name="log base 10", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`log10(3.5)`], ~definitions=[NumberToNumber.make("log10", Js.Math.log10)], @@ -99,6 +103,7 @@ let library = [ Function.make( ~name="log base 2", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`log2(3.5)`], ~definitions=[NumberToNumber.make("log2", Js.Math.log2)], @@ -107,6 +112,7 @@ let library = [ Function.make( ~name="round", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`round(3.5)`], ~definitions=[NumberToNumber.make("round", Js.Math.round)], @@ -115,6 +121,7 @@ let library = [ Function.make( ~name="sum", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`sum([3,5,2])`], ~definitions=[ArrayNumberDist.make("sum", r => r->E.A.Floats.sum->Wrappers.evNumber->Ok)], @@ -123,6 +130,7 @@ let library = [ Function.make( ~name="product", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`product([3,5,2])`], ~definitions=[ @@ -133,6 +141,7 @@ let library = [ Function.make( ~name="min", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`min([3,5,2])`], ~definitions=[ArrayNumberDist.make("min", r => r->E.A.Floats.min->Wrappers.evNumber->Ok)], @@ -141,6 +150,7 @@ let library = [ Function.make( ~name="max", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`max([3,5,2])`], ~definitions=[ArrayNumberDist.make("max", r => r->E.A.Floats.max->Wrappers.evNumber->Ok)], @@ -149,6 +159,7 @@ let library = [ Function.make( ~name="mean", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`mean([3,5,2])`], ~definitions=[ArrayNumberDist.make("mean", r => r->E.A.Floats.mean->Wrappers.evNumber->Ok)], @@ -157,6 +168,7 @@ let library = [ Function.make( ~name="geometric mean", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`geomean([3,5,2])`], ~definitions=[ @@ -167,6 +179,7 @@ let library = [ Function.make( ~name="standard deviation", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`stdev([3,5,2,3,5])`], ~definitions=[ArrayNumberDist.make("stdev", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok)], @@ -175,6 +188,7 @@ let library = [ Function.make( ~name="variance", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[`variance([3,5,2,3,5])`], ~definitions=[ @@ -185,6 +199,7 @@ let library = [ Function.make( ~name="sort", ~nameSpace, + ~requiresNamespace, ~output=EvtArray, ~examples=[`sort([3,5,2,3,5])`], ~definitions=[ @@ -197,6 +212,7 @@ let library = [ Function.make( ~name="cumulative sum", ~nameSpace, + ~requiresNamespace, ~output=EvtArray, ~examples=[`cumsum([3,5,2,3,5])`], ~definitions=[ @@ -209,6 +225,7 @@ let library = [ Function.make( ~name="cumulative prod", ~nameSpace, + ~requiresNamespace, ~output=EvtArray, ~examples=[`cumprod([3,5,2,3,5])`], ~definitions=[ @@ -221,6 +238,7 @@ let library = [ Function.make( ~name="diff", ~nameSpace, + ~requiresNamespace, ~output=EvtArray, ~examples=[`diff([3,5,2,3,5])`], ~definitions=[ 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 92e4ab5f..9a0745c1 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -27,9 +27,9 @@ let library = [ Function.make( ~name="makeContinuous", ~nameSpace, + ~requiresNamespace, ~definitions=[ FnDefinition.make( - ~requiresNamespace, ~name="makeContinuous", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], ~run=(_, inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), @@ -41,9 +41,9 @@ let library = [ Function.make( ~name="makeDiscrete", ~nameSpace, + ~requiresNamespace, ~definitions=[ FnDefinition.make( - ~requiresNamespace, ~name="makeDiscrete", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], ~run=(_, inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res index 19886841..0ba1f5c3 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res @@ -1,7 +1,7 @@ open FunctionRegistry_Core let nameSpace = "Dist" -let requiresNamespace = false +let requiresNamespace = true let runScoring = (estimate, answer, prior, env) => { GenericDist.Score.logScore(~estimate, ~answer, ~prior, ~env) @@ -13,6 +13,7 @@ let library = [ Function.make( ~name="logScore", ~nameSpace, + ~requiresNamespace, ~output=EvtNumber, ~examples=[ "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)}, prior: normal(5.5,3)})", @@ -21,7 +22,6 @@ let library = [ ], ~definitions=[ FnDefinition.make( - ~requiresNamespace, ~name="logScore", ~inputs=[ FRTypeRecord([ @@ -48,7 +48,6 @@ let library = [ ), FnDefinition.make( ~name="logScore", - ~requiresNamespace, ~inputs=[FRTypeRecord([("estimate", FRTypeDist), ("answer", FRTypeDistOrNumber)])], ~run=(_, inputs, env) => { switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs(inputs) { @@ -69,11 +68,11 @@ let library = [ ~name="klDivergence", ~nameSpace, ~output=EvtNumber, + ~requiresNamespace, ~examples=["Dist.klDivergence(normal(5,2), normal(5,1.5)"], ~definitions=[ FnDefinition.make( ~name="klDivergence", - ~requiresNamespace, ~inputs=[FRTypeDist, FRTypeDist], ~run=(_, inputs, env) => { switch inputs { diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res index 3e6172c9..c9b72b69 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res @@ -18,9 +18,12 @@ type internalExpressionValue = InternalExpressionValue.t let registry = FunctionRegistry_Library.registry let tryRegistry = ((fnName, args): InternalExpressionValue.functionCall, env) => { - FunctionRegistry_Core.Registry.matchAndRun(~registry, ~fnName, ~args, ~env)->E.O2.fmap( - E.R2.errMap(_, s => Reducer_ErrorValue.RETodo(s)), - ) + FunctionRegistry_Core.Registry.matchAndRun( + ~registry=FunctionRegistry_Core.Registry.exportedSubset(registry), + ~fnName, + ~args, + ~env, + )->E.O2.fmap(E.R2.errMap(_, s => Reducer_ErrorValue.RETodo(s))) } let dispatch = (call: InternalExpressionValue.functionCall, environment, chain): result< From 5e8b46b7df7d7d5e724f44a263260308457e0306 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 16 Jul 2022 19:06:48 -0700 Subject: [PATCH 023/203] Cleaning up Function Registry to Reducer interface --- .../__tests__/FunctionRegistry_test.res | 3 +- .../FunctionRegistry_Core.res | 12 ++++-- .../FunctionRegistry_Library.res | 2 + .../ReducerInterface_ExternalLibrary.res | 40 +------------------ .../ReducerInterface_StdLib.res | 5 ++- .../SquiggleLibrary/SquiggleLibrary_Math.res | 4 +- 6 files changed, 18 insertions(+), 48 deletions(-) diff --git a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res index 2909f7d1..376f8c86 100644 --- a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res +++ b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res @@ -50,8 +50,7 @@ module FooImplementation = { let library = [fn] } -let makeBindings = (previousBindings: Bindings.t): Bindings.t => - previousBindings->FunctionRegistry_Core.Registry.makeModules(FooImplementation.library) +let makeBindings = FunctionRegistry_Core.Registry.makeBindings(_, FooImplementation.library) let stdLibWithFoo = Bindings.emptyBindings->makeBindings diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 887ac3f7..1af459f9 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -429,7 +429,7 @@ module NameSpace = { module Registry = { let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) - let exportedSubset = (r: registry): registry => r |> E.A.filter(r => !r.requiresNamespace) + let _exportedSubset = (r: registry): registry => r |> E.A.filter(r => !r.requiresNamespace) let definitionsWithFunctions = (r: registry) => r->E.A2.fmap(fn => fn.definitions->E.A2.fmap(def => (def, fn)))->E.A.concatMany @@ -439,7 +439,7 @@ module Registry = { to the registry, then it's possible that there could be a match after the registry is called. However, for now, we could just call the registry last. */ - let matchAndRun = ( + let _matchAndRun = ( ~registry: registry, ~fnName: string, ~args: array, @@ -463,9 +463,15 @@ module Registry = { } } + let dispatch = (registry, (fnName, args): ReducerInterface_InternalExpressionValue.functionCall, env) => { + _matchAndRun(~registry=_exportedSubset(registry), ~fnName, ~args, ~env)->E.O2.fmap( + E.R2.errMap(_, s => Reducer_ErrorValue.RETodo(s)), + ) + } + let allNamespaces = (t: registry) => t->E.A2.fmap(r => r.nameSpace)->E.A.uniq - let makeModules = (prevBindings: Reducer_Module.t, t: registry): Reducer_Module.t => { + let makeBindings = (prevBindings: Reducer_Module.t, t: registry): Reducer_Module.t => { let nameSpaces = allNamespaces(t) let nameSpaceBindings = nameSpaces->E.A2.fmap(nameSpace => { let namespaceModule: NameSpace.t = { diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 3c74398a..6c8d1bb0 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -7,3 +7,5 @@ let registry = Belt.Array.concatMany([ FR_Pointset.library, FR_Scoring.library, ]) + +let dispatch = FunctionRegistry_Core.Registry.dispatch(registry) \ No newline at end of file diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res index c9b72b69..312dfd38 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res @@ -1,31 +1,9 @@ module InternalExpressionValue = ReducerInterface_InternalExpressionValue - type internalExpressionValue = InternalExpressionValue.t -// module Sample = { -// // In real life real libraries should be somewhere else -// /* -// For an example of mapping polymorphic custom functions. To be deleted after real integration -// */ -// let customAdd = (a: float, b: float): float => {a +. b} -// } - /* Map external calls of Reducer */ - -// I expect that it's important to build this first, so it doesn't get recalculated for each tryRegistry() call. -let registry = FunctionRegistry_Library.registry - -let tryRegistry = ((fnName, args): InternalExpressionValue.functionCall, env) => { - FunctionRegistry_Core.Registry.matchAndRun( - ~registry=FunctionRegistry_Core.Registry.exportedSubset(registry), - ~fnName, - ~args, - ~env, - )->E.O2.fmap(E.R2.errMap(_, s => Reducer_ErrorValue.RETodo(s))) -} - let dispatch = (call: InternalExpressionValue.functionCall, environment, chain): result< internalExpressionValue, 'e, @@ -35,22 +13,6 @@ let dispatch = (call: InternalExpressionValue.functionCall, environment, chain): () => ReducerInterface_Date.dispatch(call, environment), () => ReducerInterface_Duration.dispatch(call, environment), () => ReducerInterface_Number.dispatch(call, environment), - () => tryRegistry(call, environment), + () => FunctionRegistry_Library.dispatch(call, environment), ])->E.O2.default(chain(call, environment)) } -/* -If your dispatch is too big you can divide it into smaller dispatches and pass the call so that it gets called finally. - -The final chain(call) invokes the builtin default functions of the interpreter. - -Via chain(call), all MathJs operators and functions are available for string, number , boolean, array and record - .e.g + - / * > >= < <= == /= not and or sin cos log ln concat, etc. - -// See https://mathjs.org/docs/expressions/syntax.html -// See https://mathjs.org/docs/reference/functions.html - -Remember from the users point of view, there are no different modules: -// "doSth( constructorType1 )" -// "doSth( constructorType2 )" -doSth gets dispatched to the correct module because of the type signature. You get function and operator abstraction for free. You don't need to combine different implementations into one type. That would be duplicating the repsonsibility of the dispatcher. -*/ diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res index c08b7cb1..ae9d4c55 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res @@ -1,6 +1,9 @@ module Module = Reducer_Module -let internalStdLib = Module.emptyModule->SquiggleLibrary_Math.makeBindings +let internalStdLib = + Module.emptyModule + ->SquiggleLibrary_Math.makeBindings + ->FunctionRegistry_Core.Registry.makeBindings(FunctionRegistry_Library.registry) @genType let externalStdLib = internalStdLib->Module.toTypeScriptBindings diff --git a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res index b7b925ed..c96a8f82 100644 --- a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res +++ b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res @@ -21,6 +21,4 @@ let mathBindings: Bindings.t = //TODO: This should be in a different place. let makeBindings = (previousBindings: Bindings.t): Bindings.t => - previousBindings - ->Bindings.defineModule("Math", mathBindings) - ->FunctionRegistry_Core.Registry.makeModules(FunctionRegistry_Library.registry) + previousBindings->Bindings.defineModule("Math", mathBindings) \ No newline at end of file From 395477ed120b43d359fa9acf20b6baa39643b8b3 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 16 Jul 2022 19:50:18 -0700 Subject: [PATCH 024/203] Initial testing of FunctionRegistry Library --- .../__tests__/FunctionRegistry_test.res | 14 +++++----- ...leLibrary_FunctionRegistryLibrary_test.res | 27 +++++++++++++++++++ .../FunctionRegistry_Core.res | 9 ++++++- ...ducerInterface_InternalExpressionValue.res | 20 ++++++++++++++ 4 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res diff --git a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res index 376f8c86..bfb4ab9f 100644 --- a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res +++ b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res @@ -15,15 +15,15 @@ module FooImplementation = { open FunctionRegistry_Core open FunctionRegistry_Helpers - let fn = Function.make( + let fn1 = Function.make( ~name="add", ~nameSpace="Foo", ~requiresNamespace=false, - ~examples=["Foo.add(1, 2)", "Foo.add(1, 2, 3)"], + ~examples=["Foo.add2(1, 2)", "Foo.add3(1, 2, 3)"], ~output=EvtNumber, ~definitions=[ FnDefinition.make( - ~name="add", + ~name="add2", ~inputs=[FRTypeNumber, FRTypeNumber], ~run=(_, inputs, _) => switch inputs { @@ -33,7 +33,7 @@ module FooImplementation = { (), ), FnDefinition.make( - ~name="add", + ~name="add3", ~inputs=[FRTypeNumber, FRTypeNumber, FRTypeNumber], ~run=(_, inputs, _) => switch inputs { @@ -47,7 +47,7 @@ module FooImplementation = { (), ) - let library = [fn] + let library = [fn1] } let makeBindings = FunctionRegistry_Core.Registry.makeBindings(_, FooImplementation.library) @@ -78,7 +78,7 @@ describe("Module", () => { }) describe("Fn auto-testing", () => { - let items = FooImplementation.fn.examples->E.A.to_list + let items = FooImplementation.fn1.examples->E.A.to_list testAll("tests of validity", items, r => { expect(r->evalWithFoo->E.R.isOk)->toEqual(true) @@ -87,7 +87,7 @@ describe("Fn auto-testing", () => { testAll("tests of type", items, r => { let responseType = r->evalWithFoo->E.R2.fmap(ReducerInterface_InternalExpressionValue.valueToValueType) - let expectedOutputType = FooImplementation.fn.output |> E.O.toExn("") + let expectedOutputType = FooImplementation.fn1.output |> E.O.toExn("") expect(responseType)->toEqual(Ok(expectedOutputType)) }) }) diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res new file mode 100644 index 00000000..23e83a45 --- /dev/null +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -0,0 +1,27 @@ +open Jest +open Expect + +let expectEvalToBeOk = (expr: string) => + Reducer.evaluate(expr)->Reducer_Helpers.rRemoveDefaultsExternal->E.R.isOk->expect->toBe(true) + +let registry = FunctionRegistry_Library.registry +let examples = E.A.to_list(FunctionRegistry_Core.Registry.allExamples(registry)) + +describe("Fn auto-testing", () => { + testAll("tests of validity", examples, r => { + expectEvalToBeOk(r) + }) + + // testAll( + // "tests of type", + // E.A.to_list(FunctionRegistry_Core.Registry.allExamplesWithFns(registry)), + // ((fn, example)) => { + // let responseType = + // example + // ->Reducer.evaluate + // ->E.R2.fmap(ReducerInterface_InternalExpressionValue.externalValueToValueType) + // let expectedOutputType = fn.output |> E.O.toExn("") + // expect(responseType)->toEqual(Ok(expectedOutputType)) + // }, + // ) +}) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 1af459f9..f35bbb5e 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -429,6 +429,9 @@ module NameSpace = { module Registry = { let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) + let allExamples = (r: registry) => r->E.A2.fmap(r => r.examples)->E.A.concatMany + let allExamplesWithFns = (r: registry) => r->E.A2.fmap(fn => (fn.examples->E.A2.fmap(example => (fn, example))))->E.A.concatMany + let _exportedSubset = (r: registry): registry => r |> E.A.filter(r => !r.requiresNamespace) let definitionsWithFunctions = (r: registry) => @@ -463,7 +466,11 @@ module Registry = { } } - let dispatch = (registry, (fnName, args): ReducerInterface_InternalExpressionValue.functionCall, env) => { + let dispatch = ( + registry, + (fnName, args): ReducerInterface_InternalExpressionValue.functionCall, + env, + ) => { _matchAndRun(~registry=_exportedSubset(registry), ~fnName, ~args, ~env)->E.O2.fmap( E.R2.errMap(_, s => Reducer_ErrorValue.RETodo(s)), ) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res index a6766071..3beea889 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res @@ -160,6 +160,26 @@ let valueToValueType = value => | IEvTypeIdentifier(_) => EvtTypeIdentifier } +let externalValueToValueType = (value: ExternalExpressionValue.t) => + switch value { + | EvArray(_) => EvtArray + | EvArrayString(_) => EvtArrayString + | EvBool(_) => EvtBool + | EvCall(_) => EvtCall + | EvDate(_) => EvtDate + | EvDeclaration(_) => EvtDeclaration + | EvDistribution(_) => EvtDistribution + | EvLambda(_) => EvtLambda + | EvModule(_) => EvtModule + | EvNumber(_) => EvtNumber + | EvRecord(_) => EvtRecord + | EvString(_) => EvtString + | EvSymbol(_) => EvtSymbol + | EvTimeDuration(_) => EvtTimeDuration + | EvType(_) => EvtType + | EvTypeIdentifier(_) => EvtTypeIdentifier + } + let functionCallToCallSignature = (functionCall: functionCall): functionCallSignature => { let (fn, args) = functionCall CallSignature(fn, args->Js.Array2.map(valueToValueType)) From c5447b8d7ab9186c6a93031bb535c4052677c297 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 16 Jul 2022 20:32:37 -0700 Subject: [PATCH 025/203] All autogenerated FunctionLibrary tests pass --- .../__tests__/FunctionRegistry_test.res | 8 +++--- ...leLibrary_FunctionRegistryLibrary_test.res | 28 +++++++++++-------- .../FunctionRegistry/Library/FR_Dict.res | 2 +- .../FunctionRegistry/Library/FR_Fn.res | 3 +- .../FunctionRegistry/Library/FR_Number.res | 2 +- .../FunctionRegistry/Library/FR_Scoring.res | 6 ++-- 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res index bfb4ab9f..d68d9b01 100644 --- a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res +++ b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res @@ -67,12 +67,12 @@ let evalToStringResultWithFoo = sourceCode => evalWithFoo(sourceCode)->InternalExpressionValue.toStringResult describe("Module", () => { - test("add(1,2)", () => { - let result = evalToStringResultWithFoo("Foo.add(1,2)") + test("add2(1,2)", () => { + let result = evalToStringResultWithFoo("Foo.add2(1,2)") expect(result)->toEqual("Ok(3)") }) - test("add(1,2,3)", () => { - let result = evalToStringResultWithFoo("Foo.add(1,2,3)") + test("add3(1,2,3)", () => { + let result = evalToStringResultWithFoo("Foo.add3(1,2,3)") expect(result)->toEqual("Ok(6)") }) }) diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res index 23e83a45..a3b73d2b 100644 --- a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -12,16 +12,20 @@ describe("Fn auto-testing", () => { expectEvalToBeOk(r) }) - // testAll( - // "tests of type", - // E.A.to_list(FunctionRegistry_Core.Registry.allExamplesWithFns(registry)), - // ((fn, example)) => { - // let responseType = - // example - // ->Reducer.evaluate - // ->E.R2.fmap(ReducerInterface_InternalExpressionValue.externalValueToValueType) - // let expectedOutputType = fn.output |> E.O.toExn("") - // expect(responseType)->toEqual(Ok(expectedOutputType)) - // }, - // ) + testAll( + "tests of type", + E.A.to_list( + FunctionRegistry_Core.Registry.allExamplesWithFns(registry)->E.A2.filter(((fn, _)) => + E.O.isSome(fn.output) + ), + ), + ((fn, example)) => { + let responseType = + example + ->Reducer.evaluate + ->E.R2.fmap(ReducerInterface_InternalExpressionValue.externalValueToValueType) + let expectedOutputType = fn.output |> E.O.toExn("") + expect(responseType)->toEqual(Ok(expectedOutputType)) + }, + ) }) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res index fdb8e191..4a52f187 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res @@ -151,7 +151,7 @@ let library = [ ~nameSpace, ~requiresNamespace=true, ~output=EvtRecord, - ~examples=[`Dict.fromList({a: 1, b: 2})`], + ~examples=[`Dict.fromList([["a", 1], ["b", 2]])`], ~definitions=[ FnDefinition.make( ~name="fromList", diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res index 1e423f52..512d564a 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res @@ -35,9 +35,10 @@ let library = [ ~name="declare", ~nameSpace, ~requiresNamespace=true, + ~output=EvtDeclaration, ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", ~examples=[ - `declareFn({ + `Function.declare({ fn: {|a,b| a }, inputs: [ {min: 0, max: 100}, diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res index 10d5d1f2..6bf9ff9e 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res @@ -60,7 +60,7 @@ let library = [ ~nameSpace, ~requiresNamespace, ~output=EvtNumber, - ~examples=[`ceiling(3.5)`], + ~examples=[`ceil(3.5)`], ~definitions=[NumberToNumber.make("ceil", Js.Math.ceil_float)], (), ), diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res index 0ba1f5c3..d8d5ddd0 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res @@ -16,8 +16,8 @@ let library = [ ~requiresNamespace, ~output=EvtNumber, ~examples=[ - "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)}, prior: normal(5.5,3)})", - "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)}})", + "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1), prior: normal(5.5,3)})", + "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)})", "Dist.logScore({estimate: normal(5,2), answer: 4.5})", ], ~definitions=[ @@ -69,7 +69,7 @@ let library = [ ~nameSpace, ~output=EvtNumber, ~requiresNamespace, - ~examples=["Dist.klDivergence(normal(5,2), normal(5,1.5)"], + ~examples=["Dist.klDivergence(normal(5,2), normal(5,1.5))"], ~definitions=[ FnDefinition.make( ~name="klDivergence", From b502e21a0f606c525a35a7a54aa0ad448654337d Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 16 Jul 2022 20:33:15 -0700 Subject: [PATCH 026/203] Format --- .../src/rescript/FunctionRegistry/FunctionRegistry_Core.res | 3 ++- .../src/rescript/FunctionRegistry/FunctionRegistry_Library.res | 2 +- .../src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index f35bbb5e..85cf5609 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -430,7 +430,8 @@ module Registry = { let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) let allExamples = (r: registry) => r->E.A2.fmap(r => r.examples)->E.A.concatMany - let allExamplesWithFns = (r: registry) => r->E.A2.fmap(fn => (fn.examples->E.A2.fmap(example => (fn, example))))->E.A.concatMany + let allExamplesWithFns = (r: registry) => + r->E.A2.fmap(fn => fn.examples->E.A2.fmap(example => (fn, example)))->E.A.concatMany let _exportedSubset = (r: registry): registry => r |> E.A.filter(r => !r.requiresNamespace) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 6c8d1bb0..52a424e0 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -8,4 +8,4 @@ let registry = Belt.Array.concatMany([ FR_Scoring.library, ]) -let dispatch = FunctionRegistry_Core.Registry.dispatch(registry) \ No newline at end of file +let dispatch = FunctionRegistry_Core.Registry.dispatch(registry) diff --git a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res index c96a8f82..d719afd0 100644 --- a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res +++ b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res @@ -21,4 +21,4 @@ let mathBindings: Bindings.t = //TODO: This should be in a different place. let makeBindings = (previousBindings: Bindings.t): Bindings.t => - previousBindings->Bindings.defineModule("Math", mathBindings) \ No newline at end of file + previousBindings->Bindings.defineModule("Math", mathBindings) From 08a7b8586bf797b7252242d43e1bebb565dd731c Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 16 Jul 2022 22:01:26 -0700 Subject: [PATCH 027/203] Simple tests for function library --- ...leLibrary_FunctionRegistryLibrary_test.res | 47 +++++++++++++++++++ packages/squiggle-lang/package.json | 1 - .../FunctionRegistry/Library/FR_Number.res | 6 +-- .../squiggle-lang/src/rescript/Utility/E.res | 2 +- 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res index a3b73d2b..77052d9b 100644 --- a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -1,5 +1,6 @@ open Jest open Expect +open Reducer_TestHelpers let expectEvalToBeOk = (expr: string) => Reducer.evaluate(expr)->Reducer_Helpers.rRemoveDefaultsExternal->E.R.isOk->expect->toBe(true) @@ -29,3 +30,49 @@ describe("Fn auto-testing", () => { }, ) }) + +describe("FunctionRegistry Library", () => { + testEvalToBe("List.make(3, 'HI')", "Ok(['HI','HI','HI'])") + testEvalToBe("make(3, 'HI')", "Error(Function not found: make(Number,String))") + testEvalToBe("List.upTo(1,3)", "Ok([1,2,3])") + testEvalToBe("List.first([3,5,8])", "Ok(3)") + testEvalToBe("List.last([3,5,8])", "Ok(8)") + testEvalToBe("List.reverse([3,5,8])", "Ok([8,5,3])") + testEvalToBe("Dist.normal(5,2)", "Ok(Normal(5,2))") + testEvalToBe("normal(5,2)", "Ok(Normal(5,2))") + testEvalToBe("normal({mean:5,stdev:2})", "Ok(Normal(5,2))") + testEvalToBe("-2 to 4", "Ok(Normal(1,1.8238704957353074))") + testEvalToBe("pointMass(5)", "Ok(PointMass(5))") + testEvalToBe("Number.floor(5.5)", "Ok(5)") + testEvalToBe("Number.ceil(5.5)", "Ok(6)") + testEvalToBe("floor(5.5)", "Ok(5)") + testEvalToBe("ceil(5.5)", "Ok(6)") + testEvalToBe("Number.abs(5.5)", "Ok(5.5)") + testEvalToBe("abs(5.5)", "Ok(5.5)") + testEvalToBe("Number.exp(10)", "Ok(22026.465794806718)") + testEvalToBe("Number.log10(10)", "Ok(1)") + testEvalToBe("Number.log2(10)", "Ok(3.321928094887362)") + testEvalToBe("Number.sum([2,5,3])", "Ok(10)") + testEvalToBe("sum([2,5,3])", "Ok(10)") + testEvalToBe("Number.product([2,5,3])", "Ok(30)") + testEvalToBe("Number.min([2,5,3])", "Ok(2)") + testEvalToBe("Number.max([2,5,3])", "Ok(5)") + testEvalToBe("Number.mean([0,5,10])", "Ok(5)") + testEvalToBe("Number.geomean([1,5,18])", "Ok(4.481404746557164)") + testEvalToBe("Number.stdev([0,5,10,15])", "Ok(5.5901699437494745)") + testEvalToBe("Number.variance([0,5,10,15])", "Ok(31.25)") + testEvalToBe("Number.sort([10,0,15,5])", "Ok([0,5,10,15])") + testEvalToBe("Number.cumsum([1,5,3])", "Ok([1,6,9])") + testEvalToBe("Number.cumprod([1,5,3])", "Ok([1,5,15])") + testEvalToBe("Number.diff([1,5,3])", "Ok([4,-2])") + testEvalToBe( + "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1), prior: normal(5.5,3)})", + "Ok(-0.33591375663884876)", + ) + testEvalToBe( + "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)})", + "Ok(0.32244107041564646)", + ) + testEvalToBe("Dist.logScore({estimate: normal(5,2), answer: 4.5})", "Ok(1.6433360626394853)") + testEvalToBe("Dist.klDivergence(normal(5,2), normal(5,1.5))", "Ok(0.06874342818671068)") +}) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index ba6449ce..b2067205 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -15,7 +15,6 @@ "start": "rescript build -w -with-deps", "clean": "rescript clean && rm -rf dist", "test:reducer": "jest __tests__/Reducer*/", - "test:reducer2": "jest __tests__/FunctionRegistry_test", "benchmark": "ts-node benchmark/conversion_tests.ts", "test": "jest", "test:ts": "jest __tests__/TS/", diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res index 6bf9ff9e..c7027f06 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res @@ -192,7 +192,7 @@ let library = [ ~output=EvtNumber, ~examples=[`variance([3,5,2,3,5])`], ~definitions=[ - ArrayNumberDist.make("variance", r => r->E.A.Floats.stdev->Wrappers.evNumber->Ok), + ArrayNumberDist.make("variance", r => r->E.A.Floats.variance->Wrappers.evNumber->Ok), ], (), ), @@ -217,7 +217,7 @@ let library = [ ~examples=[`cumsum([3,5,2,3,5])`], ~definitions=[ ArrayNumberDist.make("cumsum", r => - r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + r->E.A.Floats.cumSum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok ), ], (), @@ -230,7 +230,7 @@ let library = [ ~examples=[`cumprod([3,5,2,3,5])`], ~definitions=[ ArrayNumberDist.make("cumprod", r => - r->E.A.Floats.cumsum->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + r->E.A.Floats.cumProd->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok ), ], (), diff --git a/packages/squiggle-lang/src/rescript/Utility/E.res b/packages/squiggle-lang/src/rescript/Utility/E.res index fd328a1c..eba85545 100644 --- a/packages/squiggle-lang/src/rescript/Utility/E.res +++ b/packages/squiggle-lang/src/rescript/Utility/E.res @@ -752,7 +752,7 @@ module A = { let diff = (t: t): array => Belt.Array.zipBy(t, Belt.Array.sliceToEnd(t, 1), (left, right) => right -. left) - let cumsum = (t: t): array => accumulate((a, b) => a +. b, t) + let cumSum = (t: t): array => accumulate((a, b) => a +. b, t) let cumProd = (t: t): array => accumulate((a, b) => a *. b, t) exception RangeError(string) From 8fb75d57fc2b3617b7b2fa8ecdfed117698b9d7e Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Mon, 18 Jul 2022 10:27:41 +0200 Subject: [PATCH 028/203] type check --- ...educer_Type_TypeChecker_arguments_test.res | 52 +++++ .../Reducer_Type_TypeChecker_test.res | 78 +++++++ .../Reducer_Dispatch_BuiltInMacros.res | 2 +- .../rescript/Reducer/Reducer_ErrorValue.res | 4 +- .../Reducer_Type/Reducer_Type_Modifiers.res | 53 +++++ .../Reducer/Reducer_Type/Reducer_Type_T.res | 1 + .../Reducer_Type/Reducer_Type_TypeChecker.res | 191 +++++++++++++----- 7 files changed, 331 insertions(+), 50 deletions(-) create mode 100644 packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res create mode 100644 packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_test.res create mode 100644 packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Modifiers.res diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res new file mode 100644 index 00000000..4f490bd5 --- /dev/null +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res @@ -0,0 +1,52 @@ +module Expression = Reducer_Expression +module ExpressionT = Reducer_Expression_T +module ErrorValue = Reducer_ErrorValue +module InternalExpressionValue = ReducerInterface_InternalExpressionValue +module Module = Reducer_Module +module T = Reducer_Type_T +module TypeChecker = Reducer_Type_TypeChecker + +open Jest +open Expect + +let checkArgumentsSourceCode = (aTypeSourceCode: string, sourceCode: string): result< + 'v, + ErrorValue.t, +> => { + let reducerFn = Expression.reduceExpression + let rResult = + Reducer.parse(sourceCode)->Belt.Result.flatMap(expr => + reducerFn(expr, Module.emptyBindings, InternalExpressionValue.defaultEnvironment) + ) + rResult->Belt.Result.flatMap(result => + switch result { + | IEvArray(args) => TypeChecker.checkArguments(aTypeSourceCode, args, reducerFn) + | _ => Js.Exn.raiseError("Arguments has to be an array") + } + ) +} + +let myCheckArguments = (aTypeSourceCode: string, sourceCode: string): string => + switch checkArgumentsSourceCode(aTypeSourceCode, sourceCode) { + | Ok(_) => "Ok" + | Error(error) => ErrorValue.errorToString(error) + } + +let myCheckArgumentsExpectEqual = (aTypeSourceCode, sourceCode, answer) => + expect(myCheckArguments(aTypeSourceCode, sourceCode))->toEqual(answer) + +let _myCheckArgumentsTest = (test, aTypeSourceCode, sourceCode, answer) => + test(aTypeSourceCode, () => myCheckArgumentsExpectEqual(aTypeSourceCode, sourceCode, answer)) + +let myCheckArgumentsTest = (aTypeSourceCode, sourceCode, answer) => + _myCheckArgumentsTest(test, aTypeSourceCode, sourceCode, answer) +module MySkip = { + let myCheckArgumentsTest = (aTypeSourceCode, sourceCode, answer) => + _myCheckArgumentsTest(Skip.test, aTypeSourceCode, sourceCode, answer) +} +module MyOnly = { + let myCheckArgumentsTest = (aTypeSourceCode, sourceCode, answer) => + _myCheckArgumentsTest(Only.test, aTypeSourceCode, sourceCode, answer) +} + +myCheckArgumentsTest("number=>number=>number", "[1,2]", "Ok") 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 new file mode 100644 index 00000000..5b093060 --- /dev/null +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_test.res @@ -0,0 +1,78 @@ +module Expression = Reducer_Expression +module ExpressionT = Reducer_Expression_T +module ErrorValue = Reducer_ErrorValue +module InternalExpressionValue = ReducerInterface_InternalExpressionValue +module Module = Reducer_Module +module T = Reducer_Type_T +module TypeChecker = Reducer_Type_TypeChecker + +open Jest +open Expect + +// In development, you are expected to use TypeChecker.isTypeOf(aTypeSourceCode, result, reducerFn). +// isTypeOfSourceCode is written to use strings instead of expression values. + +let isTypeOfSourceCode = (aTypeSourceCode: string, sourceCode: string): result< + 'v, + ErrorValue.t, +> => { + let reducerFn = Expression.reduceExpression + let rResult = + Reducer.parse(sourceCode)->Belt.Result.flatMap(expr => + reducerFn(expr, Module.emptyBindings, InternalExpressionValue.defaultEnvironment) + ) + rResult->Belt.Result.flatMap(result => TypeChecker.isTypeOf(aTypeSourceCode, result, reducerFn)) +} + +let myTypeCheck = (aTypeSourceCode: string, sourceCode: string): string => + switch isTypeOfSourceCode(aTypeSourceCode, sourceCode) { + | Ok(_) => "Ok" + | Error(error) => ErrorValue.errorToString(error) + } + +let myTypeCheckExpectEqual = (aTypeSourceCode, sourceCode, answer) => + expect(myTypeCheck(aTypeSourceCode, sourceCode))->toEqual(answer) + +let _myTypeCheckTest = (test, aTypeSourceCode, sourceCode, answer) => + test(aTypeSourceCode, () => myTypeCheckExpectEqual(aTypeSourceCode, sourceCode, answer)) + +let myTypeCheckTest = (aTypeSourceCode, sourceCode, answer) => + _myTypeCheckTest(test, aTypeSourceCode, sourceCode, answer) +module MySkip = { + let myTypeCheckTest = (aTypeSourceCode, sourceCode, answer) => + _myTypeCheckTest(Skip.test, aTypeSourceCode, sourceCode, answer) +} +module MyOnly = { + let myTypeCheckTest = (aTypeSourceCode, sourceCode, answer) => + _myTypeCheckTest(Only.test, aTypeSourceCode, sourceCode, answer) +} + +myTypeCheckTest("number", "1", "Ok") +myTypeCheckTest("number", "'2'", "Expected type: number but got: '2'") +myTypeCheckTest("string", "3", "Expected type: string but got: 3") +myTypeCheckTest("string", "'a'", "Ok") +myTypeCheckTest("[number]", "[1,2,3]", "Ok") +myTypeCheckTest("[number]", "['a','a','a']", "Expected type: number but got: 'a'") +myTypeCheckTest("[number]", "[1,'a',3]", "Expected type: number but got: 'a'") +myTypeCheckTest("[number, string]", "[1,'a']", "Ok") +myTypeCheckTest("[number, string]", "[1, 2]", "Expected type: string but got: 2") +myTypeCheckTest( + "[number, string, string]", + "[1,'a']", + "Expected type: [number, string, string] but got: [1,'a']", +) +myTypeCheckTest( + "[number, string]", + "[1,'a', 3]", + "Expected type: [number, string] but got: [1,'a',3]", +) +myTypeCheckTest("{age: number, name: string}", "{age: 1, name: 'a'}", "Ok") +myTypeCheckTest( + "{age: number, name: string}", + "{age: 1, name: 'a', job: 'IT'}", + "Expected type: {age: number, name: string} but got: {age: 1,job: 'IT',name: 'a'}", +) +myTypeCheckTest("number | string", "1", "Ok") +myTypeCheckTest("date | string", "1", "Expected type: (date | string) but got: 1") +myTypeCheckTest("number<-min(10)", "10", "Ok") +myTypeCheckTest("number<-min(10)", "0", "Expected type: number<-min(10) but got: 0") diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltInMacros.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltInMacros.res index e0e6902e..397265ae 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltInMacros.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltInMacros.res @@ -144,7 +144,7 @@ let dispatchMacroCall = ( let ifTrueBlock = eBlock(list{ifTrue}) ExpressionWithContext.withContext(ifTrueBlock, bindings)->Ok } - | _ => REExpectedType("Boolean")->Error + | _ => REExpectedType("Boolean", "")->Error } ) } diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_ErrorValue.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_ErrorValue.res index beaee7f7..211c9f53 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_ErrorValue.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_ErrorValue.res @@ -7,7 +7,7 @@ type errorValue = | REArrayIndexNotFound(string, int) | REAssignmentExpected | REDistributionError(DistributionTypes.error) - | REExpectedType(string) + | REExpectedType(string, string) | REExpressionExpected | REFunctionExpected(string) | REFunctionNotFound(string) @@ -55,6 +55,6 @@ let errorToString = err => | RESymbolNotFound(symbolName) => `${symbolName} is not defined` | RESyntaxError(desc, _) => `Syntax Error: ${desc}` | RETodo(msg) => `TODO: ${msg}` - | REExpectedType(typeName) => `Expected type: ${typeName}` + | REExpectedType(typeName, valueString) => `Expected type: ${typeName} but got: ${valueString}` | REUnitNotFound(unitName) => `Unit not found: ${unitName}` } diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Modifiers.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Modifiers.res new file mode 100644 index 00000000..457e97d8 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Modifiers.res @@ -0,0 +1,53 @@ +module InternalExpressionValue = ReducerInterface_InternalExpressionValue +module T = Reducer_Type_T + +let isMin = (modifierArg: InternalExpressionValue.t, aValue: InternalExpressionValue.t): bool => { + let pair = (modifierArg, aValue) + switch pair { + | (IEvNumber(a), IEvNumber(b)) => a <= b + | _ => false + } +} + +let isMax = (modifierArg: InternalExpressionValue.t, aValue: InternalExpressionValue.t): bool => { + let pair = (modifierArg, aValue) + switch pair { + | (IEvNumber(a), IEvNumber(b)) => a >= b + | _ => false + } +} + +let isMemberOf = ( + modifierArg: InternalExpressionValue.t, + aValue: InternalExpressionValue.t, +): bool => { + let pair = (modifierArg, aValue) + switch pair { + | (ievA, IEvArray(b)) => Js.Array2.includes(b, ievA) + | _ => false + } +} + +let checkModifier = ( + key: string, + modifierArg: InternalExpressionValue.t, + aValue: InternalExpressionValue.t, +): bool => + switch key { + | "min" => isMin(modifierArg, aValue) + | "max" => isMax(modifierArg, aValue) + | "isMemberOf" => isMemberOf(modifierArg, aValue) + | _ => false + } + +let checkModifiers = ( + modifiers: Belt.Map.String.t, + aValue: InternalExpressionValue.t, +): bool => { + modifiers->Belt.Map.String.reduce(true, (acc, key, modifierArg) => + switch acc { + | true => checkModifier(key, modifierArg, aValue) + | _ => acc + } + ) +} diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res index 0e3b240d..d8011d23 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res @@ -11,6 +11,7 @@ type rec iType = | ItTypeRecord({properties: Belt.Map.String.t}) type t = iType +type typeErrorValue = TypeMismatch(t, InternalExpressionValue.t) let rec toString = (t: t): string => { switch t { 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 a1a6bdc2..2778d3e4 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 @@ -1,71 +1,168 @@ -// module ErrorValue = Reducer_ErrorValue +module ExpressionT = Reducer_Expression_T module InternalExpressionValue = ReducerInterface_InternalExpressionValue module T = Reducer_Type_T -// module TypeBuilder = Reducer_Type_TypeBuilder +module TypeModifiers = Reducer_Type_Modifiers open InternalExpressionValue -type typeErrorValue = TypeError(T.t, InternalExpressionValue.t) - -let rec isOfResolvedIType = (anIType: T.iType, aValue): result => { +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 { + switch aTypeName == valueTypeName { | true => Ok(true) - | false => TypeError(anIType, aValue)->Error + | false => T.TypeMismatch(anIType, aValue)->Error } } - let _caseRecord = (anIType, evValue, propertyMap, map) => { - Belt.Map.String.reduce(propertyMap, Ok(true), (acc, property, propertyType) => { + let caseRecord = (anIType, propertyMap: Belt.Map.String.t, evValue) => + switch evValue { + | IEvRecord(aRecord) => + if ( + Js.Array2.length(propertyMap->Belt.Map.String.keysToArray) == + Js.Array2.length(aRecord->Belt.Map.String.keysToArray) + ) { + Belt.Map.String.reduce(propertyMap, Ok(true), (acc, property, propertyType) => { + Belt.Result.flatMap(acc, _ => + switch Belt.Map.String.get(aRecord, property) { + | Some(propertyValue) => isITypeOf(propertyType, propertyValue) + | None => T.TypeMismatch(anIType, evValue)->Error + } + ) + }) + } else { + T.TypeMismatch(anIType, evValue)->Error + } + + | _ => T.TypeMismatch(anIType, evValue)->Error + } + + let caseArray = (anIType, elementType, evValue) => + switch evValue { + | IEvArray(anArray) => + Belt.Array.reduce(anArray, Ok(true), (acc, element) => + Belt.Result.flatMap(acc, _ => + switch isITypeOf(elementType, element) { + | Ok(_) => Ok(true) + | Error(error) => error->Error + } + ) + ) + | _ => T.TypeMismatch(anIType, evValue)->Error + } + + let caseTuple = (anIType, elementTypes, evValue) => + switch evValue { + | IEvArray(anArray) => + if Js.Array2.length(elementTypes) == Js.Array2.length(anArray) { + let zipped = Belt.Array.zip(elementTypes, anArray) + Belt.Array.reduce(zipped, Ok(true), (acc, (elementType, element)) => + switch acc { + | Ok(_) => + switch isITypeOf(elementType, element) { + | Ok(_) => acc + | Error(error) => Error(error) + } + | _ => acc + } + ) + } else { + T.TypeMismatch(anIType, evValue)->Error + } + | _ => T.TypeMismatch(anIType, evValue)->Error + } + + let caseOr = (anIType, anITypeArray, evValue) => + switch Belt.Array.reduce(anITypeArray, Ok(false), (acc, anIType) => Belt.Result.flatMap(acc, _ => - switch Belt.Map.String.get(map, property) { - | Some(propertyValue) => isOfResolvedIType(propertyType, propertyValue) - | None => TypeError(anIType, evValue)->Error + switch acc { + | Ok(false) => + switch isITypeOf(anIType, evValue) { + | Ok(_) => Ok(true) + | Error(_) => acc + } + | _ => acc } ) - }) - } - let _caseArray = (anIType, evValue, elementType, anArray) => { - Belt.Array.reduceWithIndex(anArray, Ok(true), (acc, element, _index) => { - switch isOfResolvedIType(elementType, element) { - | Ok(_) => acc - | Error(_) => TypeError(anIType, evValue)->Error + ) { + | Ok(true) => Ok(true) + | Ok(false) => T.TypeMismatch(anIType, evValue)->Error + | Error(error) => Error(error) + } + + let caseModifiedType = ( + anIType: T.iType, + modifiedType: T.iType, + modifiers: Belt.Map.String.t, + aValue: InternalExpressionValue.t, + ) => { + isITypeOf(modifiedType, aValue)->Belt.Result.flatMap(_result => { + if TypeModifiers.checkModifiers(modifiers, aValue) { + Ok(true) + } else { + T.TypeMismatch(anIType, aValue)->Error } }) } switch anIType { | ItTypeIdentifier(name) => caseTypeIdentifier(name, aValue) - // TODO: Work in progress. Code is commented to make an a release of other features - // | ItModifiedType({modifiedType: anIType}) => raise(Reducer_Exception.ImpossibleException) - // | ItTypeOr({typeOr: anITypeArray}) => raise(Reducer_Exception.ImpossibleException) - // | ItTypeFunction({inputs: anITypeArray, output: anIType}) => - // raise(Reducer_Exception.ImpossibleException) - // | ItTypeArray({element: anIType}) => raise(Reducer_Exception.ImpossibleException) - // | ItTypeTuple({elements: anITypeArray}) => raise(Reducer_Exception.ImpossibleException) - // | ItTypeRecord({properties: anITypeMap}) => raise(Reducer_Exception.ImpossibleException) - | _ => raise(Reducer_Exception.ImpossibleException("Reducer_TypeChecker-isOfResolvedIType")) + | ItModifiedType({modifiedType, modifiers}) => + caseModifiedType(anIType, modifiedType, modifiers, aValue) //{modifiedType: iType, modifiers: Belt.Map.String.t} + | ItTypeOr({typeOr}) => caseOr(anIType, typeOr, aValue) + | ItTypeFunction(_) => + raise( + Reducer_Exception.ImpossibleException( + "Reducer_TypeChecker-functions are without a type at the moment", + ), + ) + | ItTypeArray({element}) => caseArray(anIType, element, aValue) + | ItTypeTuple({elements}) => caseTuple(anIType, elements, aValue) + | ItTypeRecord({properties}) => caseRecord(anIType, properties, aValue) } } -// let isOfResolvedType = (aType: InternalExpressionValue.t, aValue): result => -// aType->T.fromIEvValue->isOfResolvedIType(aValue) +let isTypeOf = ( + typeExpressionSourceCode: string, + aValue: InternalExpressionValue.t, + reducerFn: ExpressionT.reducerFn, +): result => { + switch typeExpressionSourceCode->Reducer_Type_Compile.fromTypeExpression(reducerFn) { + | Ok(anIType) => + switch isITypeOf(anIType, aValue) { + | Ok(_) => Ok(aValue) + | Error(T.TypeMismatch(anIType, evValue)) => + Error( + ErrorValue.REExpectedType(anIType->T.toString, evValue->InternalExpressionValue.toString), + ) + } + | Error(error) => Error(error) // Directly propagating - err => err - causes type mismatch + } +} -// TODO: Work in progress. Code is commented to make an a release of other features -// let checkArguments = ( -// evFunctionType: InternalExpressionValue.t, -// args: array, -// ) => { -// let functionType = switch evFunctionType { -// | IEvRecord(functionType) => functionType -// | _ => raise(Reducer_Exception.ImpossibleException) -// } -// let evInputs = functionType->Belt.Map.String.getWithDefault("inputs", []->IEvArray) -// let inputs = switch evInputs { -// | IEvArray(inputs) => inputs -// | _ => raise(Reducer_Exception.ImpossibleException) -// } -// let rTupleType = TypeBuilder.typeTuple(inputs) -// Belt.Result.flatMap(rTupleType, tupleType => isOfResolvedType(tupleType, args->IEvArray)) -// } +let checkITypeArguments = (anIType: T.iType, args: array): result< + bool, + T.typeErrorValue, +> => { + switch anIType { + | T.ItTypeFunction({inputs}) => isITypeOf(T.ItTypeTuple({elements: inputs}), args->IEvArray) + | _ => T.TypeMismatch(anIType, args->IEvArray)->Error + } +} + +let checkArguments = ( + typeExpressionSourceCode: string, + args: array, + reducerFn: ExpressionT.reducerFn, +): result => { + switch typeExpressionSourceCode->Reducer_Type_Compile.fromTypeExpression(reducerFn) { + | Ok(anIType) => + switch checkITypeArguments(anIType, args) { + | Ok(_) => Ok(args->IEvArray) + | Error(T.TypeMismatch(anIType, evValue)) => + Error( + ErrorValue.REExpectedType(anIType->T.toString, evValue->InternalExpressionValue.toString), + ) + } + | Error(error) => Error(error) // Directly propagating - err => err - causes type mismatch + } +} From 6966c8d3e51ef8fac1b9870ede6aec561baaf7dc Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Mon, 18 Jul 2022 15:17:41 +0200 Subject: [PATCH 029/203] ternary validation --- .../__tests__/Reducer/Reducer_ternaryOperator_test.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_ternaryOperator_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_ternaryOperator_test.res index 25353e89..22fa8328 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_ternaryOperator_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_ternaryOperator_test.res @@ -10,5 +10,5 @@ describe("Evaluate ternary operator", () => { testEvalToBe("false ? 'YES' : 'NO'", "Ok('NO')") testEvalToBe("2 > 1 ? 'YES' : 'NO'", "Ok('YES')") testEvalToBe("2 <= 1 ? 'YES' : 'NO'", "Ok('NO')") - testEvalToBe("1+1 ? 'YES' : 'NO'", "Error(Expected type: Boolean)") + testEvalToBe("1+1 ? 'YES' : 'NO'", "Error(Expected type: Boolean but got: )") }) From 628b1055352a7b0ef2d38710640600a0d2a4b5a1 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 18 Jul 2022 08:24:11 -0700 Subject: [PATCH 030/203] PointSet -> Pointset --- .../FunctionRegistry_Core.res | 2 +- .../FunctionRegistry/Library/FR_Pointset.res | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 85cf5609..7ac42686 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -333,7 +333,7 @@ module FnDefinition = { let isMatch = (t: t, args: array) => { let argValues = FRType.matchWithExpressionValueArray(t.inputs, args) switch argValues { - | Some(values) => true + | Some(_) => true | None => false } } 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 9a0745c1..dc4daead 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -1,7 +1,7 @@ open FunctionRegistry_Core open FunctionRegistry_Helpers -let nameSpace = "PointSet" +let nameSpace = "Pointset" let requiresNamespace = true let inputsTodist = (inputs: array, makeDist) => { @@ -28,6 +28,15 @@ let library = [ ~name="makeContinuous", ~nameSpace, ~requiresNamespace, + ~examples=[ + `Pointset.makeContinuous([ + {x: 0, y: 0.2}, + {x: 1, y: 0.7}, + {x: 2, y: 0.8}, + {x: 3, y: 0.2} + ])`, + ], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( ~name="makeContinuous", @@ -42,6 +51,15 @@ let library = [ ~name="makeDiscrete", ~nameSpace, ~requiresNamespace, + ~examples=[ + `Pointset.makeDiscrete([ + {x: 0, y: 0.2}, + {x: 1, y: 0.7}, + {x: 2, y: 0.8}, + {x: 3, y: 0.2} + ])`, + ], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( ~name="makeDiscrete", From 8f742bf99f011f1cac69d8a38652b5c224b1cdde Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 18 Jul 2022 08:47:02 -0700 Subject: [PATCH 031/203] Quick fix for component --- packages/components/src/components/FunctionChart1Dist.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/components/src/components/FunctionChart1Dist.tsx b/packages/components/src/components/FunctionChart1Dist.tsx index 650d2753..f8d072d7 100644 --- a/packages/components/src/components/FunctionChart1Dist.tsx +++ b/packages/components/src/components/FunctionChart1Dist.tsx @@ -88,7 +88,7 @@ let getPercentiles = ({ chartSettings, fn, environment }) => { let chartPointsData: point[] = chartPointsToRender.map((x) => { let result = runForeign(fn, [x], environment); if (result.tag === "Ok") { - if (result.value.tag == "distribution") { + if (result.value.tag === "distribution") { return { x, value: { tag: "Ok", value: result.value.value } }; } else { return { @@ -165,12 +165,14 @@ export const FunctionChart1Dist: React.FC = ({ setMouseOverlay(NaN); } const signalListeners = { mousemove: handleHover, mouseout: handleOut }; + + //TODO: This custom error handling is a bit hacky and should be improved. let mouseItem: result = !!mouseOverlay ? runForeign(fn, [mouseOverlay], environment) : { tag: "Error", value: { - tag: "REExpectedType", + tag: "RETodo", value: "Hover x-coordinate returned NaN. Expected a number.", }, }; From c1429e09078a8669b34ce55b61f94490d2fc1a29 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Mon, 18 Jul 2022 18:16:49 +0200 Subject: [PATCH 032/203] simplified modules --- .../Reducer_Peggy_ToExpression_test.res | 1 - .../Reducer_Type/Reducer_Type_Compile_test.res | 2 +- .../Reducer_Type_TypeChecker_arguments_test.res | 4 ++-- .../Reducer_Type/Reducer_Type_TypeChecker_test.res | 4 ++-- .../Reducer/Reducer_Bindings/Reducer_Bindings.res | 3 +++ .../Reducer/Reducer_Type/Reducer_Type_Compile.res | 12 ++++++++---- .../ReducerInterface_InternalExpressionValue.res | 2 +- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res index 74bf59e0..b8a81f25 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_test.res @@ -3,7 +3,6 @@ module InternalExpressionValue = ReducerInterface_InternalExpressionValue open Jest open Reducer_Peggy_TestHelpers -open Expect describe("Peggy to Expression", () => { describe("literals operators parenthesis", () => { diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res index 3f97ca3f..4de688d1 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res @@ -1,6 +1,6 @@ module Expression = Reducer_Expression module InternalExpressionValue = ReducerInterface_InternalExpressionValue -module Module = Reducer_Module +module Bindings = Reducer_Bindings module T = Reducer_Type_T module TypeCompile = Reducer_Type_Compile diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res index 4f490bd5..9c23e38e 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res @@ -2,7 +2,7 @@ module Expression = Reducer_Expression module ExpressionT = Reducer_Expression_T module ErrorValue = Reducer_ErrorValue module InternalExpressionValue = ReducerInterface_InternalExpressionValue -module Module = Reducer_Module +module Bindings = Reducer_Bindings module T = Reducer_Type_T module TypeChecker = Reducer_Type_TypeChecker @@ -16,7 +16,7 @@ let checkArgumentsSourceCode = (aTypeSourceCode: string, sourceCode: string): re let reducerFn = Expression.reduceExpression let rResult = Reducer.parse(sourceCode)->Belt.Result.flatMap(expr => - reducerFn(expr, Module.emptyBindings, InternalExpressionValue.defaultEnvironment) + reducerFn(expr, Bindings.emptyBindings, InternalExpressionValue.defaultEnvironment) ) rResult->Belt.Result.flatMap(result => switch result { 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 5b093060..d845d550 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 @@ -2,7 +2,7 @@ module Expression = Reducer_Expression module ExpressionT = Reducer_Expression_T module ErrorValue = Reducer_ErrorValue module InternalExpressionValue = ReducerInterface_InternalExpressionValue -module Module = Reducer_Module +module Bindings = Reducer_Bindings module T = Reducer_Type_T module TypeChecker = Reducer_Type_TypeChecker @@ -19,7 +19,7 @@ let isTypeOfSourceCode = (aTypeSourceCode: string, sourceCode: string): result< let reducerFn = Expression.reduceExpression let rResult = Reducer.parse(sourceCode)->Belt.Result.flatMap(expr => - reducerFn(expr, Module.emptyBindings, InternalExpressionValue.defaultEnvironment) + reducerFn(expr, Bindings.emptyBindings, InternalExpressionValue.defaultEnvironment) ) rResult->Belt.Result.flatMap(result => TypeChecker.isTypeOf(aTypeSourceCode, result, reducerFn)) } diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Bindings/Reducer_Bindings.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Bindings/Reducer_Bindings.res index f02cd54f..28175d7a 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Bindings/Reducer_Bindings.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Bindings/Reducer_Bindings.res @@ -1,3 +1,6 @@ +// Only Bindings as the global module is supported +// Other module operations such as import export will be prepreocessed jobs + module ExpressionT = Reducer_Expression_T module InternalExpressionValue = ReducerInterface_InternalExpressionValue open Reducer_ErrorValue 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 c7a776b7..2119ee62 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 @@ -1,7 +1,7 @@ module ErrorValue = Reducer_ErrorValue module ExpressionT = Reducer_Expression_T module InternalExpressionValue = ReducerInterface_InternalExpressionValue -module Module = Reducer_Module +module Bindings = Reducer_Bindings module T = Reducer_Type_T let ievFromTypeExpression = ( @@ -11,11 +11,15 @@ let ievFromTypeExpression = ( let sIndex = "compiled" let sourceCode = `type ${sIndex}=${typeExpressionSourceCode}` Reducer_Expression.parse(sourceCode)->Belt.Result.flatMap(expr => { - let rContext = reducerFn(expr, Module.emptyBindings, InternalExpressionValue.defaultEnvironment) + let rContext = reducerFn( + expr, + Bindings.emptyBindings, + InternalExpressionValue.defaultEnvironment, + ) Belt.Result.map(rContext, context => switch context { - | IEvModule(nameSpace) => - switch Module.getType(nameSpace, sIndex) { + | IEvBindings(nameSpace) => + switch Bindings.getType(nameSpace, sIndex) { | Some(value) => value | None => raise(Reducer_Exception.ImpossibleException("Reducer_Type_Compile-none")) } diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res index 06ab2376..4523b02a 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res @@ -84,7 +84,7 @@ let toStringWithType = aValue => | IEvDeclaration(_) => `Declaration::${toString(aValue)}` | IEvDistribution(_) => `Distribution::${toString(aValue)}` | IEvLambda(_) => `Lambda::${toString(aValue)}` - | IEvBindings(_) => `Module::${toString(aValue)}` + | IEvBindings(_) => `Bindings::${toString(aValue)}` | IEvNumber(_) => `Number::${toString(aValue)}` | IEvRecord(_) => `Record::${toString(aValue)}` | IEvString(_) => `String::${toString(aValue)}` From 15d63a6a962545790e9e45490d097f319b760760 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Mon, 18 Jul 2022 18:31:09 +0200 Subject: [PATCH 033/203] type modifiers -> type contracts --- .../Reducer_Peggy/Reducer_Peggy_Parse_type_test.res | 6 +++--- .../Reducer_Peggy_ToExpression_type_test.res | 6 +++--- ...Type_Modifiers.res => Reducer_Type_Contracts.res} | 4 ++-- .../rescript/Reducer/Reducer_Type/Reducer_Type_T.res | 12 ++++++------ .../Reducer_Type/Reducer_Type_TypeChecker.res | 10 +++++----- 5 files changed, 19 insertions(+), 19 deletions(-) rename packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/{Reducer_Type_Modifiers.res => Reducer_Type_Contracts.res} (90%) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_Parse_type_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_Parse_type_test.res index f1dcd4bc..4f7dabdc 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_Parse_type_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_Parse_type_test.res @@ -20,7 +20,7 @@ describe("Peggy parse type", () => { "{(::$_typeOf_$ :f (::$_typeFunction_$ (::$_constructArray_$ (#number #number #number))))}", ) }) - describe("high priority modifier", () => { + describe("high priority contract", () => { testParse( "answer: number<-min<-max(100)|string", "{(::$_typeOf_$ :answer (::$_typeOr_$ (::$_constructArray_$ ((::$_typeModifier_max_$ (::$_typeModifier_min_$ #number) 100) #string))))}", @@ -30,7 +30,7 @@ describe("Peggy parse type", () => { "{(::$_typeOf_$ :answer (::$_typeModifier_memberOf_$ #number (::$_constructArray_$ (1 3 5))))}", ) }) - describe("low priority modifier", () => { + describe("low priority contract", () => { testParse( "answer: number | string $ opaque", "{(::$_typeOf_$ :answer (::$_typeModifier_opaque_$ (::$_typeOr_$ (::$_constructArray_$ (#number #string)))))}", @@ -70,7 +70,7 @@ describe("Peggy parse type", () => { "{(::$_typeOf_$ :answer (::$_typeModifier_opaque_$ (::$_typeOr_$ (::$_constructArray_$ (#number #string)))))}", ) }) - describe("squiggle expressions in type modifiers", () => { + describe("squiggle expressions in type contracts", () => { testParse( "odds1 = [1,3,5]; odds2 = [7, 9]; type odds = number<-memberOf(concat(odds1, odds2))", "{:odds1 = {(::$_constructArray_$ (1 3 5))}; :odds2 = {(::$_constructArray_$ (7 9))}; (::$_typeAlias_$ #odds (::$_typeModifier_memberOf_$ #number (::concat :odds1 :odds2)))}", diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res index 12d2d62b..9849adb0 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res @@ -40,7 +40,7 @@ describe("Peggy Types to Expression", () => { (), ) }) - describe("high priority modifier", () => { + describe("high priority contract", () => { testToExpression( "answer: number<-min(1)<-max(100)|string", "{(:$_typeOf_$ :answer (:$_typeOr_$ (:$_constructArray_$ ((:$_typeModifier_max_$ (:$_typeModifier_min_$ #number 1) 100) #string))))}", @@ -78,7 +78,7 @@ describe("Peggy Types to Expression", () => { (), ) }) - describe("low priority modifier", () => { + describe("low priority contract", () => { testToExpression( "answer: number | string $ opaque", "{(:$_typeOf_$ :answer (:$_typeModifier_opaque_$ (:$_typeOr_$ (:$_constructArray_$ (#number #string)))))}", @@ -86,7 +86,7 @@ describe("Peggy Types to Expression", () => { (), ) }) - describe("squiggle expressions in type modifiers", () => { + describe("squiggle expressions in type contracts", () => { testToExpression( "odds1 = [1,3,5]; odds2 = [7, 9]; type odds = number<-memberOf(concat(odds1, odds2))", "{(:$_let_$ :odds1 {(:$_constructArray_$ (1 3 5))}); (:$_let_$ :odds2 {(:$_constructArray_$ (7 9))}); (:$_typeAlias_$ #odds (:$_typeModifier_memberOf_$ #number (:concat :odds1 :odds2)))}", diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Modifiers.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Contracts.res similarity index 90% rename from packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Modifiers.res rename to packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Contracts.res index 457e97d8..7b68f178 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Modifiers.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Contracts.res @@ -41,10 +41,10 @@ let checkModifier = ( } let checkModifiers = ( - modifiers: Belt.Map.String.t, + contracts: Belt.Map.String.t, aValue: InternalExpressionValue.t, ): bool => { - modifiers->Belt.Map.String.reduce(true, (acc, key, modifierArg) => + contracts->Belt.Map.String.reduce(true, (acc, key, modifierArg) => switch acc { | true => checkModifier(key, modifierArg, aValue) | _ => acc diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res index d8011d23..511fe815 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_T.res @@ -3,7 +3,7 @@ open InternalExpressionValue type rec iType = | ItTypeIdentifier(string) - | ItModifiedType({modifiedType: iType, modifiers: Belt.Map.String.t}) + | ItModifiedType({modifiedType: iType, contracts: Belt.Map.String.t}) | ItTypeOr({typeOr: array}) | ItTypeFunction({inputs: array, output: iType}) | ItTypeArray({element: iType}) @@ -16,8 +16,8 @@ type typeErrorValue = TypeMismatch(t, InternalExpressionValue.t) let rec toString = (t: t): string => { switch t { | ItTypeIdentifier(s) => s - | ItModifiedType({modifiedType, modifiers}) => - `${toString(modifiedType)}${modifiers->Belt.Map.String.reduce("", (acc, k, v) => + | ItModifiedType({modifiedType, contracts}) => + `${toString(modifiedType)}${contracts->Belt.Map.String.reduce("", (acc, k, v) => Js.String2.concatMany(acc, ["<-", k, "(", InternalExpressionValue.toString(v), ")"]) )}` | ItTypeOr({typeOr}) => `(${Js.Array2.map(typeOr, toString)->Js.Array2.joinWith(" | ")})` @@ -82,7 +82,7 @@ let rec fromTypeMap = typeMap => { default, ) - let modifiers = + let contracts = typeMap->Belt.Map.String.keep((k, _v) => ["min", "max", "memberOf"]->Js.Array2.includes(k)) let makeIt = switch evTypeTag { @@ -96,9 +96,9 @@ let rec fromTypeMap = typeMap => { | _ => raise(Reducer_Exception.ImpossibleException("Reducer_Type_T-evTypeTag")) } - Belt.Map.String.isEmpty(modifiers) + Belt.Map.String.isEmpty(contracts) ? makeIt - : ItModifiedType({modifiedType: makeIt, modifiers: modifiers}) + : ItModifiedType({modifiedType: makeIt, contracts: contracts}) } and fromIEvValue = (ievValue: InternalExpressionValue.t): iType => 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 2778d3e4..e4336df5 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 @@ -1,7 +1,7 @@ module ExpressionT = Reducer_Expression_T module InternalExpressionValue = ReducerInterface_InternalExpressionValue module T = Reducer_Type_T -module TypeModifiers = Reducer_Type_Modifiers +module TypeContracts = Reducer_Type_Contracts open InternalExpressionValue let rec isITypeOf = (anIType: T.iType, aValue): result => { @@ -92,11 +92,11 @@ let rec isITypeOf = (anIType: T.iType, aValue): result = let caseModifiedType = ( anIType: T.iType, modifiedType: T.iType, - modifiers: Belt.Map.String.t, + contracts: Belt.Map.String.t, aValue: InternalExpressionValue.t, ) => { isITypeOf(modifiedType, aValue)->Belt.Result.flatMap(_result => { - if TypeModifiers.checkModifiers(modifiers, aValue) { + if TypeContracts.checkModifiers(contracts, aValue) { Ok(true) } else { T.TypeMismatch(anIType, aValue)->Error @@ -106,8 +106,8 @@ let rec isITypeOf = (anIType: T.iType, aValue): result = switch anIType { | ItTypeIdentifier(name) => caseTypeIdentifier(name, aValue) - | ItModifiedType({modifiedType, modifiers}) => - caseModifiedType(anIType, modifiedType, modifiers, aValue) //{modifiedType: iType, modifiers: Belt.Map.String.t} + | ItModifiedType({modifiedType, contracts}) => + caseModifiedType(anIType, modifiedType, contracts, aValue) //{modifiedType: iType, contracts: Belt.Map.String.t} | ItTypeOr({typeOr}) => caseOr(anIType, typeOr, aValue) | ItTypeFunction(_) => raise( From 6e1be862d2bcf1dd685ff830a52eab192832003b Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Mon, 18 Jul 2022 18:51:05 +0200 Subject: [PATCH 034/203] reducer passed to external library --- .../Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res | 3 +-- .../ReducerInterface/ReducerInterface_ExternalLibrary.res | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index d0d88b2a..aa27d7ec 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -255,11 +255,10 @@ let dispatch = (call: functionCall, environment, reducer: ExpressionT.reducerFn) errorValue, > => try { - let callInternalWithReducer = (call, environment) => callInternal(call, environment, reducer) let (fn, args) = call // There is a bug that prevents string match in patterns // So we have to recreate a copy of the string - ExternalLibrary.dispatch((Js.String.make(fn), args), environment, callInternalWithReducer) + ExternalLibrary.dispatch((Js.String.make(fn), args), environment, reducer, callInternal) } catch { | Js.Exn.Error(obj) => REJavaScriptExn(Js.Exn.message(obj), Js.Exn.name(obj))->Error | _ => RETodo("unhandled rescript exception")->Error diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res index 3e6172c9..2a479bb5 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res @@ -23,7 +23,7 @@ let tryRegistry = ((fnName, args): InternalExpressionValue.functionCall, env) => ) } -let dispatch = (call: InternalExpressionValue.functionCall, environment, chain): result< +let dispatch = (call: InternalExpressionValue.functionCall, environment, reducer, chain): result< internalExpressionValue, 'e, > => { @@ -33,7 +33,7 @@ let dispatch = (call: InternalExpressionValue.functionCall, environment, chain): () => ReducerInterface_Duration.dispatch(call, environment), () => ReducerInterface_Number.dispatch(call, environment), () => tryRegistry(call, environment), - ])->E.O2.default(chain(call, environment)) + ])->E.O2.default(chain(call, environment, reducer)) } /* If your dispatch is too big you can divide it into smaller dispatches and pass the call so that it gets called finally. From 4535041876760f18bd80ef46f3832390cbd2c889 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Mon, 18 Jul 2022 22:52:19 +0200 Subject: [PATCH 035/203] less test clutter --- .../Reducer_Type_Compile_test.res | 36 ++++++--------- ...educer_Type_TypeChecker_arguments_test.res | 15 +------ .../Reducer_Type_TypeChecker_test.res | 44 ++++++++----------- 3 files changed, 33 insertions(+), 62 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res index 4de688d1..71f90373 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_Compile_test.res @@ -15,7 +15,7 @@ let myIevEvalToString = (aTypeSourceCode: string) => let myIevExpectEqual = (aTypeSourceCode, answer) => expect(myIevEvalToString(aTypeSourceCode))->toEqual(answer) -let _myIevTest = (test, aTypeSourceCode, answer) => +let myIevTest = (test, aTypeSourceCode, answer) => test(aTypeSourceCode, () => myIevExpectEqual(aTypeSourceCode, answer)) let myTypeEval = (aTypeSourceCode: string) => @@ -25,38 +25,28 @@ let myTypeEvalToString = (aTypeSourceCode: string) => myTypeEval(aTypeSourceCode let myTypeExpectEqual = (aTypeSourceCode, answer) => expect(myTypeEvalToString(aTypeSourceCode))->toEqual(answer) -let _myTypeTest = (test, aTypeSourceCode, answer) => +let myTypeTest = (test, aTypeSourceCode, answer) => test(aTypeSourceCode, () => myTypeExpectEqual(aTypeSourceCode, answer)) -let myIevTest = (aTypeSourceCode, answer) => _myIevTest(test, aTypeSourceCode, answer) -let myTypeTest = (aTypeSourceCode, answer) => _myTypeTest(test, aTypeSourceCode, answer) -module MySkip = { - let myIevTest = (aTypeSourceCode, answer) => _myIevTest(Skip.test, aTypeSourceCode, answer) - let myTypeTest = (aTypeSourceCode, answer) => _myTypeTest(Skip.test, aTypeSourceCode, answer) -} -module MyOnly = { - let myIevTest = (aTypeSourceCode, answer) => _myIevTest(Only.test, aTypeSourceCode, answer) - let myTypeTest = (aTypeSourceCode, answer) => _myTypeTest(Only.test, aTypeSourceCode, answer) -} - // | ItTypeIdentifier(string) -myTypeTest("number", "number") -myTypeTest("(number)", "number") +myTypeTest(test, "number", "number") +myTypeTest(test, "(number)", "number") // | ItModifiedType({modifiedType: iType}) -myIevTest("number<-min(0)", "Ok({min: 0,typeIdentifier: #number,typeTag: 'typeIdentifier'})") -myTypeTest("number<-min(0)", "number<-min(0)") +myIevTest(test, "number<-min(0)", "Ok({min: 0,typeIdentifier: #number,typeTag: 'typeIdentifier'})") +myTypeTest(test, "number<-min(0)", "number<-min(0)") // | ItTypeOr({typeOr: array}) -myTypeTest("number | string", "(number | string)") +myTypeTest(test, "number | string", "(number | string)") // | ItTypeFunction({inputs: array, output: iType}) -myTypeTest("number => number => number", "(number => number => number)") +myTypeTest(test, "number => number => number", "(number => number => number)") // | ItTypeArray({element: iType}) -myIevTest("[number]", "Ok({element: #number,typeTag: 'typeArray'})") -myTypeTest("[number]", "[number]") +myIevTest(test, "[number]", "Ok({element: #number,typeTag: 'typeArray'})") +myTypeTest(test, "[number]", "[number]") // | ItTypeTuple({elements: array}) -myTypeTest("[number, string]", "[number, string]") +myTypeTest(test, "[number, string]", "[number, string]") // | ItTypeRecord({properties: Belt.Map.String.t}) myIevTest( + test, "{age: number, name: string}", "Ok({properties: {age: #number,name: #string},typeTag: 'typeRecord'})", ) -myTypeTest("{age: number, name: string}", "{age: number, name: string}") +myTypeTest(test, "{age: number, name: string}", "{age: number, name: string}") diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res index 9c23e38e..07da15bb 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_arguments_test.res @@ -35,18 +35,7 @@ let myCheckArguments = (aTypeSourceCode: string, sourceCode: string): string => let myCheckArgumentsExpectEqual = (aTypeSourceCode, sourceCode, answer) => expect(myCheckArguments(aTypeSourceCode, sourceCode))->toEqual(answer) -let _myCheckArgumentsTest = (test, aTypeSourceCode, sourceCode, answer) => +let myCheckArgumentsTest = (test, aTypeSourceCode, sourceCode, answer) => test(aTypeSourceCode, () => myCheckArgumentsExpectEqual(aTypeSourceCode, sourceCode, answer)) -let myCheckArgumentsTest = (aTypeSourceCode, sourceCode, answer) => - _myCheckArgumentsTest(test, aTypeSourceCode, sourceCode, answer) -module MySkip = { - let myCheckArgumentsTest = (aTypeSourceCode, sourceCode, answer) => - _myCheckArgumentsTest(Skip.test, aTypeSourceCode, sourceCode, answer) -} -module MyOnly = { - let myCheckArgumentsTest = (aTypeSourceCode, sourceCode, answer) => - _myCheckArgumentsTest(Only.test, aTypeSourceCode, sourceCode, answer) -} - -myCheckArgumentsTest("number=>number=>number", "[1,2]", "Ok") +myCheckArgumentsTest(test, "number=>number=>number", "[1,2]", "Ok") 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 d845d550..efd9bb18 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 @@ -33,46 +33,38 @@ let myTypeCheck = (aTypeSourceCode: string, sourceCode: string): string => let myTypeCheckExpectEqual = (aTypeSourceCode, sourceCode, answer) => expect(myTypeCheck(aTypeSourceCode, sourceCode))->toEqual(answer) -let _myTypeCheckTest = (test, aTypeSourceCode, sourceCode, answer) => +let myTypeCheckTest = (test, aTypeSourceCode, sourceCode, answer) => test(aTypeSourceCode, () => myTypeCheckExpectEqual(aTypeSourceCode, sourceCode, answer)) -let myTypeCheckTest = (aTypeSourceCode, sourceCode, answer) => - _myTypeCheckTest(test, aTypeSourceCode, sourceCode, answer) -module MySkip = { - let myTypeCheckTest = (aTypeSourceCode, sourceCode, answer) => - _myTypeCheckTest(Skip.test, aTypeSourceCode, sourceCode, answer) -} -module MyOnly = { - let myTypeCheckTest = (aTypeSourceCode, sourceCode, answer) => - _myTypeCheckTest(Only.test, aTypeSourceCode, sourceCode, answer) -} - -myTypeCheckTest("number", "1", "Ok") -myTypeCheckTest("number", "'2'", "Expected type: number but got: '2'") -myTypeCheckTest("string", "3", "Expected type: string but got: 3") -myTypeCheckTest("string", "'a'", "Ok") -myTypeCheckTest("[number]", "[1,2,3]", "Ok") -myTypeCheckTest("[number]", "['a','a','a']", "Expected type: number but got: 'a'") -myTypeCheckTest("[number]", "[1,'a',3]", "Expected type: number but got: 'a'") -myTypeCheckTest("[number, string]", "[1,'a']", "Ok") -myTypeCheckTest("[number, string]", "[1, 2]", "Expected type: string but got: 2") +myTypeCheckTest(test, "number", "1", "Ok") +myTypeCheckTest(test, "number", "'2'", "Expected type: number but got: '2'") +myTypeCheckTest(test, "string", "3", "Expected type: string but got: 3") +myTypeCheckTest(test, "string", "'a'", "Ok") +myTypeCheckTest(test, "[number]", "[1,2,3]", "Ok") +myTypeCheckTest(test, "[number]", "['a','a','a']", "Expected type: number but got: 'a'") +myTypeCheckTest(test, "[number]", "[1,'a',3]", "Expected type: number but got: 'a'") +myTypeCheckTest(test, "[number, string]", "[1,'a']", "Ok") +myTypeCheckTest(test, "[number, string]", "[1, 2]", "Expected type: string but got: 2") myTypeCheckTest( + test, "[number, string, string]", "[1,'a']", "Expected type: [number, string, string] but got: [1,'a']", ) myTypeCheckTest( + test, "[number, string]", "[1,'a', 3]", "Expected type: [number, string] but got: [1,'a',3]", ) -myTypeCheckTest("{age: number, name: string}", "{age: 1, name: 'a'}", "Ok") +myTypeCheckTest(test, "{age: number, name: string}", "{age: 1, name: 'a'}", "Ok") myTypeCheckTest( + test, "{age: number, name: string}", "{age: 1, name: 'a', job: 'IT'}", "Expected type: {age: number, name: string} but got: {age: 1,job: 'IT',name: 'a'}", ) -myTypeCheckTest("number | string", "1", "Ok") -myTypeCheckTest("date | string", "1", "Expected type: (date | string) but got: 1") -myTypeCheckTest("number<-min(10)", "10", "Ok") -myTypeCheckTest("number<-min(10)", "0", "Expected type: number<-min(10) but got: 0") +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") From 30f721eeb613392459413a143b6dec7e507c330d Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 18 Jul 2022 16:10:19 -0700 Subject: [PATCH 036/203] Simple conversion away from using modules --- .../src/components/SquigglePlayground.tsx | 1 - .../__tests__/FunctionRegistry_test.res | 74 ++++++++--------- .../FunctionRegistry_Core.res | 83 ++++++++----------- .../ReducerInterface_StdLib.res | 1 - 4 files changed, 73 insertions(+), 86 deletions(-) diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index a8f5852a..3b901809 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 ( diff --git a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res index d68d9b01..6ee66f60 100644 --- a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res +++ b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res @@ -1,7 +1,7 @@ module InternalExpressionValue = ReducerInterface_InternalExpressionValue module ExpressionT = Reducer_Expression_T -module Module = Reducer_Module -module Bindings = Reducer_Module +// module Module = Reducer_Module +// module Bindings = Reducer_Module module ErrorValue = Reducer_ErrorValue open Jest @@ -49,45 +49,45 @@ module FooImplementation = { let library = [fn1] } + +// let makeBindings = FunctionRegistry_Core.Registry.makeBindings(_, FooImplementation.library) -let makeBindings = FunctionRegistry_Core.Registry.makeBindings(_, FooImplementation.library) +// let stdLibWithFoo = Bindings.emptyBindings->makeBindings -let stdLibWithFoo = Bindings.emptyBindings->makeBindings +// let evalWithFoo = sourceCode => +// Reducer_Expression.parse(sourceCode)->Belt.Result.flatMap(expr => +// Reducer_Expression.reduceExpression( +// expr, +// stdLibWithFoo, +// InternalExpressionValue.defaultEnvironment, +// ) +// ) -let evalWithFoo = sourceCode => - Reducer_Expression.parse(sourceCode)->Belt.Result.flatMap(expr => - Reducer_Expression.reduceExpression( - expr, - stdLibWithFoo, - InternalExpressionValue.defaultEnvironment, - ) - ) +// let evalToStringResultWithFoo = sourceCode => +// evalWithFoo(sourceCode)->InternalExpressionValue.toStringResult -let evalToStringResultWithFoo = sourceCode => - evalWithFoo(sourceCode)->InternalExpressionValue.toStringResult +// describe("Module", () => { +// test("add2(1,2)", () => { +// let result = evalToStringResultWithFoo("Foo.add2(1,2)") +// expect(result)->toEqual("Ok(3)") +// }) +// test("add3(1,2,3)", () => { +// let result = evalToStringResultWithFoo("Foo.add3(1,2,3)") +// expect(result)->toEqual("Ok(6)") +// }) +// }) -describe("Module", () => { - test("add2(1,2)", () => { - let result = evalToStringResultWithFoo("Foo.add2(1,2)") - expect(result)->toEqual("Ok(3)") - }) - test("add3(1,2,3)", () => { - let result = evalToStringResultWithFoo("Foo.add3(1,2,3)") - expect(result)->toEqual("Ok(6)") - }) -}) +// describe("Fn auto-testing", () => { +// let items = FooImplementation.fn1.examples->E.A.to_list -describe("Fn auto-testing", () => { - let items = FooImplementation.fn1.examples->E.A.to_list +// testAll("tests of validity", items, r => { +// expect(r->evalWithFoo->E.R.isOk)->toEqual(true) +// }) - testAll("tests of validity", items, r => { - expect(r->evalWithFoo->E.R.isOk)->toEqual(true) - }) - - testAll("tests of type", items, r => { - let responseType = - r->evalWithFoo->E.R2.fmap(ReducerInterface_InternalExpressionValue.valueToValueType) - let expectedOutputType = FooImplementation.fn1.output |> E.O.toExn("") - expect(responseType)->toEqual(Ok(expectedOutputType)) - }) -}) +// testAll("tests of type", items, r => { +// let responseType = +// r->evalWithFoo->E.R2.fmap(ReducerInterface_InternalExpressionValue.valueToValueType) +// let expectedOutputType = FooImplementation.fn1.output |> E.O.toExn("") +// expect(responseType)->toEqual(Ok(expectedOutputType)) +// }) +// }) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 7ac42686..2b54e0fe 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -303,10 +303,13 @@ module Matcher = { } let findMatches = (r: registry, fnName: string, args: array) => { - switch _findExactMatches(r, fnName, args) { + let fnNameInParts = Js.String.split(".", fnName) + let fnToSearch = E.A.get(fnNameInParts, 1) |> E.O.default(fnNameInParts[0]) + + switch _findExactMatches(r, fnToSearch, args) { | Some(r) => Match.FullMatch(r) | None => - switch _findNameMatches(r, fnName, args) { + switch _findNameMatches(r, fnToSearch, args) { | Some(r) => Match.SameNameDifferentArguments(r) | None => Match.DifferentName } @@ -349,9 +352,6 @@ module FnDefinition = { let toFfiFn = (t: t): Reducer_Expression_T.optionFfiFn => (args, environment) => run(t, args, environment)->E.R.toOption - let toLambda = (t: t) => - Reducer_Module.convertOptionToFfiFn(t.name, toFfiFn(t))->Reducer_Module.eLambdaFFIValue - let make = (~name, ~inputs, ~run, ()): t => { name: name, inputs: inputs, @@ -405,39 +405,40 @@ module NameSpace = { let definitions = (t: t) => t.functions->E.A2.fmap(f => f.definitions)->E.A.concatMany let uniqueFnNames = (t: t) => definitions(t)->E.A2.fmap(r => r.name)->E.A.uniq let nameToDefinitions = (t: t, name: string) => definitions(t)->E.A2.filter(r => r.name == name) - - //todo: It could be good to set a warning if two definitions are both valid, but I don't expect this often. - let nameFfiFn = (t: t, name: string): Reducer_Expression_T.optionFfiFn => { - (args, environment) => { - let definitions = - nameToDefinitions(t, name)->E.A2.fmap((def, ()) => - FnDefinition.isMatch(def, args) - ? FnDefinition.run(def, args, environment) |> E.R.toOption - : None - ) - E.A.O.firstSomeFn(definitions) - } - } - - let toModule = (t: t): Reducer_Module.t => - E.A.reduce(uniqueFnNames(t), Reducer_Module.emptyStdLib, (acc, uniqueName) => { - let relevantDefinitions = nameFfiFn(t, uniqueName) - acc->Reducer_Module.defineFunction(uniqueName, relevantDefinitions) - }) } module Registry = { let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) - let allExamples = (r: registry) => r->E.A2.fmap(r => r.examples)->E.A.concatMany let allExamplesWithFns = (r: registry) => r->E.A2.fmap(fn => fn.examples->E.A2.fmap(example => (fn, example)))->E.A.concatMany + let allDefinitionsWithFns = (r: registry) => + r->E.A2.fmap(fn => fn.definitions->E.A2.fmap(definitions => (fn, definitions)))->E.A.concatMany + + let cache = (r: registry): Js.Dict.t> => { + let functionsWithFnNames = + allDefinitionsWithFns(r) + ->E.A2.fmap(((fn, def)) => { + let nameWithNamespace = `${fn.nameSpace}.${def.name}` + let nameWithoutNamespace = def.name + fn.requiresNamespace + ? [(nameWithNamespace, fn)] + : [(nameWithNamespace, fn), (nameWithoutNamespace, fn)] + }) + ->E.A.concatMany + let uniqueNames = functionsWithFnNames->E.A2.fmap(((name, _)) => name)->E.A.uniq + let cacheAsArray: array<(string, array)> = uniqueNames->E.A2.fmap(uniqueName => { + let relevantItems = + E.A2.filter(functionsWithFnNames, ((defName, _)) => defName == uniqueName)->E.A2.fmap( + E.Tuple2.second, + ) + (uniqueName, relevantItems) + }) + cacheAsArray->Js.Dict.fromArray + } + let _exportedSubset = (r: registry): registry => r |> E.A.filter(r => !r.requiresNamespace) - - let definitionsWithFunctions = (r: registry) => - r->E.A2.fmap(fn => fn.definitions->E.A2.fmap(def => (def, fn)))->E.A.concatMany - /* There's a (potential+minor) bug here: If a function definition is called outside of the calls to the registry, then it's possible that there could be a match after the registry is @@ -449,7 +450,10 @@ module Registry = { ~args: array, ~env: GenericDist.env, ) => { - let matchToDef = m => Matcher.Registry.matchToDef(registry, m) + let cc = cache(registry) + let relevantFunctions = Js.Dict.get(cc, fnName) |> E.O.default([]) + + let matchToDef = m => Matcher.Registry.matchToDef(relevantFunctions, m) let showNameMatchDefinitions = matches => { let defs = matches @@ -460,7 +464,8 @@ module Registry = { ->E.A2.joinWith("; ") `There are function matches for ${fnName}(), but with different arguments: ${defs}` } - switch Matcher.Registry.findMatches(registry, fnName, args) { + + switch Matcher.Registry.findMatches(relevantFunctions, fnName, args) { | Matcher.Match.FullMatch(match) => match->matchToDef->E.O2.fmap(FnDefinition.run(_, args, env)) | SameNameDifferentArguments(m) => Some(Error(showNameMatchDefinitions(m))) | _ => None @@ -476,20 +481,4 @@ module Registry = { E.R2.errMap(_, s => Reducer_ErrorValue.RETodo(s)), ) } - - let allNamespaces = (t: registry) => t->E.A2.fmap(r => r.nameSpace)->E.A.uniq - - let makeBindings = (prevBindings: Reducer_Module.t, t: registry): Reducer_Module.t => { - let nameSpaces = allNamespaces(t) - let nameSpaceBindings = nameSpaces->E.A2.fmap(nameSpace => { - let namespaceModule: NameSpace.t = { - name: nameSpace, - functions: t->E.A2.filter(r => r.nameSpace == nameSpace), - } - (nameSpace, NameSpace.toModule(namespaceModule)) - }) - E.A.reduce(nameSpaceBindings, prevBindings, (acc, (name, fn)) => - acc->Reducer_Module.defineModule(name, fn) - ) - } } diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res index 61493165..5c1a9c30 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res @@ -1,7 +1,6 @@ module Bindings = Reducer_Bindings let internalStdLib = Bindings.emptyBindings->SquiggleLibrary_Math.makeBindings - ->FunctionRegistry_Core.Registry.makeBindings(FunctionRegistry_Library.registry) @genType let externalStdLib = internalStdLib->Bindings.toTypeScriptBindings From ffaf349e0aa2f998b023f4c112d4d93aa1032981 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Tue, 19 Jul 2022 11:33:11 +1000 Subject: [PATCH 037/203] Basic mapSampleN support --- .../Reducer_Dispatch_BuiltIn_test.res | 4 +++ .../SampleSetDist/SampleSetDist.res | 5 ++++ .../Reducer_Dispatch_BuiltIn.res | 26 +++++++++++++++++-- .../squiggle-lang/src/rescript/Utility/E.res | 13 ++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res index 98192d31..65048ebb 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res @@ -21,6 +21,10 @@ describe("builtin", () => { "addOne(t)=t+1; toList(mapSamples(fromSamples([1,2,3,4,5,6]), addOne))", "Ok([2,3,4,5,6,7])", ) + testEval( + "toList(mapSamplesN([fromSamples([1,2,3,4,5,6]), fromSamples([6, 5, 4, 3, 2, 1])], {|x| x[0] > x[1] ? x[0] : x[1]}))", + "Ok([6,5,4,4,5,6])", + ) }) describe("builtin exception", () => { diff --git a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res index bfbaa795..dc15f7a1 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res +++ b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSetDist.res @@ -117,6 +117,11 @@ let map3 = ( ): result => E.A.zip3(get(t1), get(t2), get(t3))->E.A2.fmap(E.Tuple3.toFnCall(fn))->_fromSampleResultArray +let mapN = (~fn: array => result, ~t1: array): result< + t, + sampleSetError, +> => E.A.transpose(E.A.fmap(get, t1))->E.A2.fmap(fn)->_fromSampleResultArray + let mean = t => T.get(t)->E.A.Floats.mean let geomean = t => T.get(t)->E.A.Floats.geomean let mode = t => T.get(t)->E.A.Floats.mode diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index 484b0acb..c7ab817e 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -19,6 +19,15 @@ open Reducer_ErrorValue exception TestRescriptException +let parseSampleSetArray = (arr: array): option> => { + let parseSampleSet = (value: internalExpressionValue): option => + switch value { + | IEvDistribution(SampleSet(dist)) => Some(dist) + | _ => None + } + E.A.O.openIfAllSome(E.A.fmap(parseSampleSet, arr)) +} + let callInternal = (call: functionCall, environment, reducer: ExpressionT.reducerFn): result< 'b, errorValue, @@ -149,6 +158,11 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce doLambdaCall(aLambdaValue, list{IEvNumber(a), IEvNumber(b), IEvNumber(c)}) SampleSetDist.map3(~fn, ~t1, ~t2, ~t3)->toType } + + let mapN = (t1: array, aLambdaValue) => { + let fn = a => doLambdaCall(aLambdaValue, list{IEvArray(E.A.fmap(x => IEvNumber(x), a))}) + SampleSetDist.mapN(~fn, ~t1)->toType + } } let doReduceArray = (aValueArray, initialValue, aLambdaValue) => { @@ -230,6 +244,12 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce ], ) => SampleMap.map3(dist1, dist2, dist3, aLambdaValue) + | ("mapSamplesN", [IEvArray(aValueArray), IEvLambda(aLambdaValue)]) => + switch parseSampleSetArray(aValueArray) { + | Some(sampleSetArr) => SampleMap.mapN(sampleSetArr, aLambdaValue) + | None => + Error(REFunctionNotFound(call->functionCallToCallSignature->functionCallSignatureToString)) + } | ("reduce", [IEvArray(aValueArray), initialValue, IEvLambda(aLambdaValue)]) => doReduceArray(aValueArray, initialValue, aLambdaValue) | ("reduceReverse", [IEvArray(aValueArray), initialValue, IEvLambda(aLambdaValue)]) => @@ -246,7 +266,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce Error(REFunctionNotFound(call->functionCallToCallSignature->functionCallSignatureToString)) // Report full type signature as error } } - /* Reducer uses Result monad while reducing expressions */ @@ -262,5 +281,8 @@ let dispatch = (call: functionCall, environment, reducer: ExpressionT.reducerFn) ExternalLibrary.dispatch((Js.String.make(fn), args), environment, callInternalWithReducer) } catch { | Js.Exn.Error(obj) => REJavaScriptExn(Js.Exn.message(obj), Js.Exn.name(obj))->Error - | _ => RETodo("unhandled rescript exception")->Error + | err => { + Js.Console.log(err) + RETodo("unhandled rescript exception")->Error + } } diff --git a/packages/squiggle-lang/src/rescript/Utility/E.res b/packages/squiggle-lang/src/rescript/Utility/E.res index fd328a1c..f593cd48 100644 --- a/packages/squiggle-lang/src/rescript/Utility/E.res +++ b/packages/squiggle-lang/src/rescript/Utility/E.res @@ -631,6 +631,19 @@ module A = { ) let filter = Js.Array.filter let joinWith = Js.Array.joinWith + let transpose = (xs: array>): array> => { + let arr: array> = [] + for i in 0 to length(xs) - 1 { + for j in 0 to length(xs[i]) - 1 { + if Js.Array.length(arr) <= j { + ignore(Js.Array.push([xs[i][j]], arr)) + } else { + ignore(Js.Array.push(xs[i][j], arr[j])) + } + } + } + arr + } let all = (p: 'a => bool, xs: array<'a>): bool => length(filter(p, xs)) == length(xs) let any = (p: 'a => bool, xs: array<'a>): bool => length(filter(p, xs)) > 0 From 5bdc19f35f66986ed7f8b395ae547a99f90faba4 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Tue, 19 Jul 2022 11:38:43 +1000 Subject: [PATCH 038/203] Refactor sampleN code and remove log --- .../Reducer_Dispatch_BuiltIn.res | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index c7ab817e..40903521 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -19,15 +19,6 @@ open Reducer_ErrorValue exception TestRescriptException -let parseSampleSetArray = (arr: array): option> => { - let parseSampleSet = (value: internalExpressionValue): option => - switch value { - | IEvDistribution(SampleSet(dist)) => Some(dist) - | _ => None - } - E.A.O.openIfAllSome(E.A.fmap(parseSampleSet, arr)) -} - let callInternal = (call: functionCall, environment, reducer: ExpressionT.reducerFn): result< 'b, errorValue, @@ -159,9 +150,25 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce SampleSetDist.map3(~fn, ~t1, ~t2, ~t3)->toType } - let mapN = (t1: array, aLambdaValue) => { - let fn = a => doLambdaCall(aLambdaValue, list{IEvArray(E.A.fmap(x => IEvNumber(x), a))}) - SampleSetDist.mapN(~fn, ~t1)->toType + let mapN = (aValueArray: array, aLambdaValue) => { + switch parseSampleSetArray(aValueArray) { + | Some(t1) => + let fn = a => doLambdaCall(aLambdaValue, list{IEvArray(E.A.fmap(x => IEvNumber(x), a))}) + SampleSetDist.mapN(~fn, ~t1)->toType + | None => + Error(REFunctionNotFound(call->functionCallToCallSignature->functionCallSignatureToString)) + } + } + + let parseSampleSetArray = (arr: array): option< + array, + > => { + let parseSampleSet = (value: internalExpressionValue): option => + switch value { + | IEvDistribution(SampleSet(dist)) => Some(dist) + | _ => None + } + E.A.O.openIfAllSome(E.A.fmap(parseSampleSet, arr)) } } @@ -245,11 +252,7 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce ) => SampleMap.map3(dist1, dist2, dist3, aLambdaValue) | ("mapSamplesN", [IEvArray(aValueArray), IEvLambda(aLambdaValue)]) => - switch parseSampleSetArray(aValueArray) { - | Some(sampleSetArr) => SampleMap.mapN(sampleSetArr, aLambdaValue) - | None => - Error(REFunctionNotFound(call->functionCallToCallSignature->functionCallSignatureToString)) - } + SampleMap.mapN(aValueArray, aLambdaValue) | ("reduce", [IEvArray(aValueArray), initialValue, IEvLambda(aLambdaValue)]) => doReduceArray(aValueArray, initialValue, aLambdaValue) | ("reduceReverse", [IEvArray(aValueArray), initialValue, IEvLambda(aLambdaValue)]) => @@ -281,8 +284,5 @@ let dispatch = (call: functionCall, environment, reducer: ExpressionT.reducerFn) ExternalLibrary.dispatch((Js.String.make(fn), args), environment, callInternalWithReducer) } catch { | Js.Exn.Error(obj) => REJavaScriptExn(Js.Exn.message(obj), Js.Exn.name(obj))->Error - | err => { - Js.Console.log(err) - RETodo("unhandled rescript exception")->Error - } + | _ => RETodo("unhandled rescript exception")->Error } From 7887256ca10f5697d03e934866dbd5782cd502b8 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Tue, 19 Jul 2022 11:45:07 +1000 Subject: [PATCH 039/203] Reorder function declarations to compile --- .../Reducer_Dispatch_BuiltIn.res | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index 40903521..f0d8b3ab 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -150,16 +150,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce SampleSetDist.map3(~fn, ~t1, ~t2, ~t3)->toType } - let mapN = (aValueArray: array, aLambdaValue) => { - switch parseSampleSetArray(aValueArray) { - | Some(t1) => - let fn = a => doLambdaCall(aLambdaValue, list{IEvArray(E.A.fmap(x => IEvNumber(x), a))}) - SampleSetDist.mapN(~fn, ~t1)->toType - | None => - Error(REFunctionNotFound(call->functionCallToCallSignature->functionCallSignatureToString)) - } - } - let parseSampleSetArray = (arr: array): option< array, > => { @@ -170,6 +160,16 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce } E.A.O.openIfAllSome(E.A.fmap(parseSampleSet, arr)) } + + let mapN = (aValueArray: array, aLambdaValue) => { + switch parseSampleSetArray(aValueArray) { + | Some(t1) => + let fn = a => doLambdaCall(aLambdaValue, list{IEvArray(E.A.fmap(x => IEvNumber(x), a))}) + SampleSetDist.mapN(~fn, ~t1)->toType + | None => + Error(REFunctionNotFound(call->functionCallToCallSignature->functionCallSignatureToString)) + } + } } let doReduceArray = (aValueArray, initialValue, aLambdaValue) => { From 938b20b4cdb25f808a2aac3309661975b014cc65 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Tue, 19 Jul 2022 12:38:05 +1000 Subject: [PATCH 040/203] Print error messages when functions fail --- .../src/components/FunctionChart.tsx | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/components/src/components/FunctionChart.tsx b/packages/components/src/components/FunctionChart.tsx index 05e4d393..73378cd8 100644 --- a/packages/components/src/components/FunctionChart.tsx +++ b/packages/components/src/components/FunctionChart.tsx @@ -1,5 +1,10 @@ import * as React from "react"; -import { lambdaValue, environment, runForeign } from "@quri/squiggle-lang"; +import { + lambdaValue, + environment, + runForeign, + errorValueToString, +} from "@quri/squiggle-lang"; import { FunctionChart1Dist } from "./FunctionChart1Dist"; import { FunctionChart1Number } from "./FunctionChart1Number"; import { DistributionPlottingSettings } from "./DistributionChart"; @@ -45,10 +50,16 @@ export const FunctionChart: React.FC = ({ } }; const validResult = getValidResult(); - const resultType = - validResult.tag === "Ok" ? validResult.value.tag : ("Error" as const); - switch (resultType) { + if (validResult.tag === "Error") { + return ( + + {errorValueToString(validResult.value)} + + ); + } + + switch (validResult.value.tag) { case "distribution": return ( = ({ height={height} /> ); - case "Error": - return ( - The function failed to be run - ); default: return ( There is no function visualization for this type of output:{" "} - {resultType} + {validResult.value.tag} ); } From 03edf60663126d6cdd4af76085ff1ed5630cf298 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Tue, 19 Jul 2022 13:08:45 +1000 Subject: [PATCH 041/203] Show x coordinate when drawing discrete distributions --- packages/components/src/lib/distributionSpecBuilder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/lib/distributionSpecBuilder.ts b/packages/components/src/lib/distributionSpecBuilder.ts index 7a5bcd2f..d04f0c44 100644 --- a/packages/components/src/lib/distributionSpecBuilder.ts +++ b/packages/components/src/lib/distributionSpecBuilder.ts @@ -223,7 +223,7 @@ export function buildVegaSpec( }, size: [{ value: 100 }], tooltip: { - signal: "datum.y", + signal: "{ probability: datum.y, value: datum.x }", }, }, update: { From 905d2fbb23c1772f0ad1a32c42ca76e813759c45 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 18 Jul 2022 21:29:46 -0700 Subject: [PATCH 042/203] Removed now-uneeded Function Registry test file --- .../__tests__/FunctionRegistry_test.res | 93 ------------------- .../FunctionRegistry_Core.res | 3 +- 2 files changed, 1 insertion(+), 95 deletions(-) delete mode 100644 packages/squiggle-lang/__tests__/FunctionRegistry_test.res diff --git a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res b/packages/squiggle-lang/__tests__/FunctionRegistry_test.res deleted file mode 100644 index 6ee66f60..00000000 --- a/packages/squiggle-lang/__tests__/FunctionRegistry_test.res +++ /dev/null @@ -1,93 +0,0 @@ -module InternalExpressionValue = ReducerInterface_InternalExpressionValue -module ExpressionT = Reducer_Expression_T -// module Module = Reducer_Module -// module Bindings = Reducer_Module -module ErrorValue = Reducer_ErrorValue - -open Jest -open Expect - -// ---------------------- -// --- Start of Module File -// ---------------------- - -module FooImplementation = { - open FunctionRegistry_Core - open FunctionRegistry_Helpers - - let fn1 = Function.make( - ~name="add", - ~nameSpace="Foo", - ~requiresNamespace=false, - ~examples=["Foo.add2(1, 2)", "Foo.add3(1, 2, 3)"], - ~output=EvtNumber, - ~definitions=[ - FnDefinition.make( - ~name="add2", - ~inputs=[FRTypeNumber, FRTypeNumber], - ~run=(_, inputs, _) => - switch inputs { - | [FRValueNumber(a), FRValueNumber(b)] => Ok(Wrappers.evNumber(a +. b)) - | _ => Error("False") - }, - (), - ), - FnDefinition.make( - ~name="add3", - ~inputs=[FRTypeNumber, FRTypeNumber, FRTypeNumber], - ~run=(_, inputs, _) => - switch inputs { - | [FRValueNumber(a), FRValueNumber(b), FRValueNumber(c)] => - Ok(Wrappers.evNumber(a +. b +. c)) - | _ => Error("False") - }, - (), - ), - ], - (), - ) - - let library = [fn1] -} - -// let makeBindings = FunctionRegistry_Core.Registry.makeBindings(_, FooImplementation.library) - -// let stdLibWithFoo = Bindings.emptyBindings->makeBindings - -// let evalWithFoo = sourceCode => -// Reducer_Expression.parse(sourceCode)->Belt.Result.flatMap(expr => -// Reducer_Expression.reduceExpression( -// expr, -// stdLibWithFoo, -// InternalExpressionValue.defaultEnvironment, -// ) -// ) - -// let evalToStringResultWithFoo = sourceCode => -// evalWithFoo(sourceCode)->InternalExpressionValue.toStringResult - -// describe("Module", () => { -// test("add2(1,2)", () => { -// let result = evalToStringResultWithFoo("Foo.add2(1,2)") -// expect(result)->toEqual("Ok(3)") -// }) -// test("add3(1,2,3)", () => { -// let result = evalToStringResultWithFoo("Foo.add3(1,2,3)") -// expect(result)->toEqual("Ok(6)") -// }) -// }) - -// describe("Fn auto-testing", () => { -// let items = FooImplementation.fn1.examples->E.A.to_list - -// testAll("tests of validity", items, r => { -// expect(r->evalWithFoo->E.R.isOk)->toEqual(true) -// }) - -// testAll("tests of type", items, r => { -// let responseType = -// r->evalWithFoo->E.R2.fmap(ReducerInterface_InternalExpressionValue.valueToValueType) -// let expectedOutputType = FooImplementation.fn1.output |> E.O.toExn("") -// expect(responseType)->toEqual(Ok(expectedOutputType)) -// }) -// }) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 2b54e0fe..e7abc961 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -438,7 +438,6 @@ module Registry = { cacheAsArray->Js.Dict.fromArray } - let _exportedSubset = (r: registry): registry => r |> E.A.filter(r => !r.requiresNamespace) /* There's a (potential+minor) bug here: If a function definition is called outside of the calls to the registry, then it's possible that there could be a match after the registry is @@ -477,7 +476,7 @@ module Registry = { (fnName, args): ReducerInterface_InternalExpressionValue.functionCall, env, ) => { - _matchAndRun(~registry=_exportedSubset(registry), ~fnName, ~args, ~env)->E.O2.fmap( + _matchAndRun(~registry, ~fnName, ~args, ~env)->E.O2.fmap( E.R2.errMap(_, s => Reducer_ErrorValue.RETodo(s)), ) } From dbfee988d26f421be461d1a8d415cad5f3a06477 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 18 Jul 2022 22:14:46 -0700 Subject: [PATCH 043/203] Pulled out cache in Registry, to make more sense --- .../FunctionRegistry_Core.res | 40 +++++++++++-------- .../FunctionRegistry_Library.res | 5 ++- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index e7abc961..93b99f34 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -61,7 +61,8 @@ type function = { isExperimental: bool, } -type registry = array +type fnNameDict = Js.Dict.t> +type registry = {functions: array, fnNameDict: fnNameDict} module FRType = { type t = frType @@ -273,7 +274,8 @@ module Matcher = { module Registry = { let _findExactMatches = (r: registry, fnName: string, args: array) => { - let functionMatchPairs = r->E.A2.fmap(l => (l, Function.match(l, fnName, args))) + let functionMatchPairs = + r.functions->E.A2.fmap(l => (l, Function.match(l, fnName, args))) let fullMatch = functionMatchPairs->E.A.getBy(((_, match)) => Match.isFullMatch(match)) fullMatch->E.O.bind(((fn, match)) => switch match { @@ -284,7 +286,7 @@ module Matcher = { } let _findNameMatches = (r: registry, fnName: string, args: array) => { - let functionMatchPairs = r->E.A2.fmap(l => (l, Function.match(l, fnName, args))) + let functionMatchPairs = r.functions->E.A2.fmap(l => (l, Function.match(l, fnName, args))) let getNameMatches = functionMatchPairs ->E.A2.fmap(((fn, match)) => Match.isNameMatchOnly(match) ? Some((fn, match)) : None) @@ -319,7 +321,7 @@ module Matcher = { let matchToDef = (registry: registry, {fnName, inputIndex}: RegistryMatch.match): option< fnDefinition, > => - registry + registry.functions ->E.A.getBy(fn => fn.name === fnName) ->E.O.bind(fn => E.A.get(fn.definitions, inputIndex)) } @@ -408,17 +410,17 @@ module NameSpace = { } module Registry = { - let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) - let allExamples = (r: registry) => r->E.A2.fmap(r => r.examples)->E.A.concatMany + let toJson = (r: registry) => r.functions->E.A2.fmap(Function.toJson) + let allExamples = (r: registry) => r.functions->E.A2.fmap(r => r.examples)->E.A.concatMany let allExamplesWithFns = (r: registry) => - r->E.A2.fmap(fn => fn.examples->E.A2.fmap(example => (fn, example)))->E.A.concatMany + r.functions->E.A2.fmap(fn => fn.examples->E.A2.fmap(example => (fn, example)))->E.A.concatMany - let allDefinitionsWithFns = (r: registry) => - r->E.A2.fmap(fn => fn.definitions->E.A2.fmap(definitions => (fn, definitions)))->E.A.concatMany - - let cache = (r: registry): Js.Dict.t> => { + let buildFnNameDict = (r: array): fnNameDict => { + let allDefinitionsWithFns = r + ->E.A2.fmap(fn => fn.definitions->E.A2.fmap(definitions => (fn, definitions))) + ->E.A.concatMany let functionsWithFnNames = - allDefinitionsWithFns(r) + allDefinitionsWithFns ->E.A2.fmap(((fn, def)) => { let nameWithNamespace = `${fn.nameSpace}.${def.name}` let nameWithoutNamespace = def.name @@ -438,6 +440,11 @@ module Registry = { cacheAsArray->Js.Dict.fromArray } + let make = (fns: array):registry => { + let dict = buildFnNameDict(fns) + {functions: fns, fnNameDict: dict} + } + /* There's a (potential+minor) bug here: If a function definition is called outside of the calls to the registry, then it's possible that there could be a match after the registry is @@ -449,10 +456,9 @@ module Registry = { ~args: array, ~env: GenericDist.env, ) => { - let cc = cache(registry) - let relevantFunctions = Js.Dict.get(cc, fnName) |> E.O.default([]) - - let matchToDef = m => Matcher.Registry.matchToDef(relevantFunctions, m) + let relevantFunctions = Js.Dict.get(registry.fnNameDict, fnName) |> E.O.default([]) + let modified = {functions: relevantFunctions, fnNameDict: registry.fnNameDict} + let matchToDef = m => Matcher.Registry.matchToDef(registry, m) let showNameMatchDefinitions = matches => { let defs = matches @@ -464,7 +470,7 @@ module Registry = { `There are function matches for ${fnName}(), but with different arguments: ${defs}` } - switch Matcher.Registry.findMatches(relevantFunctions, fnName, args) { + switch Matcher.Registry.findMatches(modified, fnName, args) { | Matcher.Match.FullMatch(match) => match->matchToDef->E.O2.fmap(FnDefinition.run(_, args, env)) | SameNameDifferentArguments(m) => Some(Error(showNameMatchDefinitions(m))) | _ => None diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 52a424e0..1699ef96 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -1,4 +1,4 @@ -let registry = Belt.Array.concatMany([ +let fnList = Belt.Array.concatMany([ FR_Dict.library, FR_Dist.library, FR_Fn.library, @@ -8,4 +8,5 @@ let registry = Belt.Array.concatMany([ FR_Scoring.library, ]) -let dispatch = FunctionRegistry_Core.Registry.dispatch(registry) +let registry = FunctionRegistry_Core.Registry.make(fnList) +let dispatch = FunctionRegistry_Core.Registry.dispatch(registry) \ No newline at end of file From 173c17e13dd9f848b8b3fb9436f82fc9df4d5e47 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 18 Jul 2022 22:17:38 -0700 Subject: [PATCH 044/203] Simple cleanup --- .../ReducerInterface_ExternalLibrary.res | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res index 312dfd38..8a121cd0 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res @@ -16,3 +16,16 @@ let dispatch = (call: InternalExpressionValue.functionCall, environment, chain): () => FunctionRegistry_Library.dispatch(call, environment), ])->E.O2.default(chain(call, environment)) } + +/* +If your dispatch is too big you can divide it into smaller dispatches and pass the call so that it gets called finally. +The final chain(call) invokes the builtin default functions of the interpreter. +Via chain(call), all MathJs operators and functions are available for string, number , boolean, array and record + .e.g + - / * > >= < <= == /= not and or sin cos log ln concat, etc. +// See https://mathjs.org/docs/expressions/syntax.html +// See https://mathjs.org/docs/reference/functions.html +Remember from the users point of view, there are no different modules: +// "doSth( constructorType1 )" +// "doSth( constructorType2 )" +doSth gets dispatched to the correct module because of the type signature. You get function and operator abstraction for free. You don't need to combine different implementations into one type. That would be duplicating the repsonsibility of the dispatcher. +*/ \ No newline at end of file From 6f25fca814710192927b2b64969387ec90a6ebdf Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 18 Jul 2022 22:21:57 -0700 Subject: [PATCH 045/203] Minor cleanup --- .../FunctionRegistry/FunctionRegistry_Core.res | 12 ++++++------ .../FunctionRegistry/FunctionRegistry_Library.res | 2 +- .../ReducerInterface_ExternalLibrary.res | 6 +++++- .../SquiggleLibrary/SquiggleLibrary_Math.res | 1 - 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 93b99f34..9d1c6669 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -274,8 +274,7 @@ module Matcher = { module Registry = { let _findExactMatches = (r: registry, fnName: string, args: array) => { - let functionMatchPairs = - r.functions->E.A2.fmap(l => (l, Function.match(l, fnName, args))) + let functionMatchPairs = r.functions->E.A2.fmap(l => (l, Function.match(l, fnName, args))) let fullMatch = functionMatchPairs->E.A.getBy(((_, match)) => Match.isFullMatch(match)) fullMatch->E.O.bind(((fn, match)) => switch match { @@ -416,9 +415,10 @@ module Registry = { r.functions->E.A2.fmap(fn => fn.examples->E.A2.fmap(example => (fn, example)))->E.A.concatMany let buildFnNameDict = (r: array): fnNameDict => { - let allDefinitionsWithFns = r - ->E.A2.fmap(fn => fn.definitions->E.A2.fmap(definitions => (fn, definitions))) - ->E.A.concatMany + let allDefinitionsWithFns = + r + ->E.A2.fmap(fn => fn.definitions->E.A2.fmap(definitions => (fn, definitions))) + ->E.A.concatMany let functionsWithFnNames = allDefinitionsWithFns ->E.A2.fmap(((fn, def)) => { @@ -440,7 +440,7 @@ module Registry = { cacheAsArray->Js.Dict.fromArray } - let make = (fns: array):registry => { + let make = (fns: array): registry => { let dict = buildFnNameDict(fns) {functions: fns, fnNameDict: dict} } diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 1699ef96..9b0f6737 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -9,4 +9,4 @@ let fnList = Belt.Array.concatMany([ ]) let registry = FunctionRegistry_Core.Registry.make(fnList) -let dispatch = FunctionRegistry_Core.Registry.dispatch(registry) \ No newline at end of file +let dispatch = FunctionRegistry_Core.Registry.dispatch(registry) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res index 8a121cd0..43a1375c 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res @@ -19,13 +19,17 @@ let dispatch = (call: InternalExpressionValue.functionCall, environment, chain): /* If your dispatch is too big you can divide it into smaller dispatches and pass the call so that it gets called finally. + The final chain(call) invokes the builtin default functions of the interpreter. + Via chain(call), all MathJs operators and functions are available for string, number , boolean, array and record .e.g + - / * > >= < <= == /= not and or sin cos log ln concat, etc. + // See https://mathjs.org/docs/expressions/syntax.html // See https://mathjs.org/docs/reference/functions.html + Remember from the users point of view, there are no different modules: // "doSth( constructorType1 )" // "doSth( constructorType2 )" doSth gets dispatched to the correct module because of the type signature. You get function and operator abstraction for free. You don't need to combine different implementations into one type. That would be duplicating the repsonsibility of the dispatcher. -*/ \ No newline at end of file +*/ diff --git a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res index 50c8dd2f..ce74f476 100644 --- a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res +++ b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Math.res @@ -18,6 +18,5 @@ let mathBindings: Bindings.t = ->E.A2.fmap(((name, v)) => (name, ReducerInterface_InternalExpressionValue.IEvNumber(v))) ->Bindings.fromArray -//TODO: This should be in a different place. let makeBindings = (previousBindings: Bindings.t): Bindings.t => previousBindings->Bindings.merge(mathBindings) From 28036bfb36ac504c2035062a7eb5c37dd517cf6d Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 19 Jul 2022 08:12:04 -0700 Subject: [PATCH 046/203] Minor cleanup --- ...leLibrary_FunctionRegistryLibrary_test.res | 130 +++++++++--------- .../FunctionRegistry_Core.res | 7 +- 2 files changed, 68 insertions(+), 69 deletions(-) diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res index 77052d9b..d4f52e5c 100644 --- a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -8,71 +8,73 @@ let expectEvalToBeOk = (expr: string) => let registry = FunctionRegistry_Library.registry let examples = E.A.to_list(FunctionRegistry_Core.Registry.allExamples(registry)) -describe("Fn auto-testing", () => { - testAll("tests of validity", examples, r => { - expectEvalToBeOk(r) +describe("FunctionRegistry Library", () => { + describe("Regular tests", () => { + testEvalToBe("List.make(3, 'HI')", "Ok(['HI','HI','HI'])") + testEvalToBe("make(3, 'HI')", "Error(Function not found: make(Number,String))") + testEvalToBe("List.upTo(1,3)", "Ok([1,2,3])") + testEvalToBe("List.first([3,5,8])", "Ok(3)") + testEvalToBe("List.last([3,5,8])", "Ok(8)") + testEvalToBe("List.reverse([3,5,8])", "Ok([8,5,3])") + testEvalToBe("Dist.normal(5,2)", "Ok(Normal(5,2))") + testEvalToBe("normal(5,2)", "Ok(Normal(5,2))") + testEvalToBe("normal({mean:5,stdev:2})", "Ok(Normal(5,2))") + testEvalToBe("-2 to 4", "Ok(Normal(1,1.8238704957353074))") + testEvalToBe("pointMass(5)", "Ok(PointMass(5))") + testEvalToBe("Number.floor(5.5)", "Ok(5)") + testEvalToBe("Number.ceil(5.5)", "Ok(6)") + testEvalToBe("floor(5.5)", "Ok(5)") + testEvalToBe("ceil(5.5)", "Ok(6)") + testEvalToBe("Number.abs(5.5)", "Ok(5.5)") + testEvalToBe("abs(5.5)", "Ok(5.5)") + testEvalToBe("Number.exp(10)", "Ok(22026.465794806718)") + testEvalToBe("Number.log10(10)", "Ok(1)") + testEvalToBe("Number.log2(10)", "Ok(3.321928094887362)") + testEvalToBe("Number.sum([2,5,3])", "Ok(10)") + testEvalToBe("sum([2,5,3])", "Ok(10)") + testEvalToBe("Number.product([2,5,3])", "Ok(30)") + testEvalToBe("Number.min([2,5,3])", "Ok(2)") + testEvalToBe("Number.max([2,5,3])", "Ok(5)") + testEvalToBe("Number.mean([0,5,10])", "Ok(5)") + testEvalToBe("Number.geomean([1,5,18])", "Ok(4.481404746557164)") + testEvalToBe("Number.stdev([0,5,10,15])", "Ok(5.5901699437494745)") + testEvalToBe("Number.variance([0,5,10,15])", "Ok(31.25)") + testEvalToBe("Number.sort([10,0,15,5])", "Ok([0,5,10,15])") + testEvalToBe("Number.cumsum([1,5,3])", "Ok([1,6,9])") + testEvalToBe("Number.cumprod([1,5,3])", "Ok([1,5,15])") + testEvalToBe("Number.diff([1,5,3])", "Ok([4,-2])") + testEvalToBe( + "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1), prior: normal(5.5,3)})", + "Ok(-0.33591375663884876)", + ) + testEvalToBe( + "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)})", + "Ok(0.32244107041564646)", + ) + testEvalToBe("Dist.logScore({estimate: normal(5,2), answer: 4.5})", "Ok(1.6433360626394853)") + testEvalToBe("Dist.klDivergence(normal(5,2), normal(5,1.5))", "Ok(0.06874342818671068)") }) - testAll( - "tests of type", - E.A.to_list( - FunctionRegistry_Core.Registry.allExamplesWithFns(registry)->E.A2.filter(((fn, _)) => - E.O.isSome(fn.output) - ), - ), - ((fn, example)) => { - let responseType = - example - ->Reducer.evaluate - ->E.R2.fmap(ReducerInterface_InternalExpressionValue.externalValueToValueType) - let expectedOutputType = fn.output |> E.O.toExn("") - expect(responseType)->toEqual(Ok(expectedOutputType)) - }, - ) -}) + describe("Fn auto-testing", () => { + testAll("tests of validity", examples, r => { + expectEvalToBeOk(r) + }) -describe("FunctionRegistry Library", () => { - testEvalToBe("List.make(3, 'HI')", "Ok(['HI','HI','HI'])") - testEvalToBe("make(3, 'HI')", "Error(Function not found: make(Number,String))") - testEvalToBe("List.upTo(1,3)", "Ok([1,2,3])") - testEvalToBe("List.first([3,5,8])", "Ok(3)") - testEvalToBe("List.last([3,5,8])", "Ok(8)") - testEvalToBe("List.reverse([3,5,8])", "Ok([8,5,3])") - testEvalToBe("Dist.normal(5,2)", "Ok(Normal(5,2))") - testEvalToBe("normal(5,2)", "Ok(Normal(5,2))") - testEvalToBe("normal({mean:5,stdev:2})", "Ok(Normal(5,2))") - testEvalToBe("-2 to 4", "Ok(Normal(1,1.8238704957353074))") - testEvalToBe("pointMass(5)", "Ok(PointMass(5))") - testEvalToBe("Number.floor(5.5)", "Ok(5)") - testEvalToBe("Number.ceil(5.5)", "Ok(6)") - testEvalToBe("floor(5.5)", "Ok(5)") - testEvalToBe("ceil(5.5)", "Ok(6)") - testEvalToBe("Number.abs(5.5)", "Ok(5.5)") - testEvalToBe("abs(5.5)", "Ok(5.5)") - testEvalToBe("Number.exp(10)", "Ok(22026.465794806718)") - testEvalToBe("Number.log10(10)", "Ok(1)") - testEvalToBe("Number.log2(10)", "Ok(3.321928094887362)") - testEvalToBe("Number.sum([2,5,3])", "Ok(10)") - testEvalToBe("sum([2,5,3])", "Ok(10)") - testEvalToBe("Number.product([2,5,3])", "Ok(30)") - testEvalToBe("Number.min([2,5,3])", "Ok(2)") - testEvalToBe("Number.max([2,5,3])", "Ok(5)") - testEvalToBe("Number.mean([0,5,10])", "Ok(5)") - testEvalToBe("Number.geomean([1,5,18])", "Ok(4.481404746557164)") - testEvalToBe("Number.stdev([0,5,10,15])", "Ok(5.5901699437494745)") - testEvalToBe("Number.variance([0,5,10,15])", "Ok(31.25)") - testEvalToBe("Number.sort([10,0,15,5])", "Ok([0,5,10,15])") - testEvalToBe("Number.cumsum([1,5,3])", "Ok([1,6,9])") - testEvalToBe("Number.cumprod([1,5,3])", "Ok([1,5,15])") - testEvalToBe("Number.diff([1,5,3])", "Ok([4,-2])") - testEvalToBe( - "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1), prior: normal(5.5,3)})", - "Ok(-0.33591375663884876)", - ) - testEvalToBe( - "Dist.logScore({estimate: normal(5,2), answer: normal(5.2,1)})", - "Ok(0.32244107041564646)", - ) - testEvalToBe("Dist.logScore({estimate: normal(5,2), answer: 4.5})", "Ok(1.6433360626394853)") - testEvalToBe("Dist.klDivergence(normal(5,2), normal(5,1.5))", "Ok(0.06874342818671068)") + testAll( + "tests of type", + E.A.to_list( + FunctionRegistry_Core.Registry.allExamplesWithFns(registry)->E.A2.filter(((fn, _)) => + E.O.isSome(fn.output) + ), + ), + ((fn, example)) => { + let responseType = + example + ->Reducer.evaluate + ->E.R2.fmap(ReducerInterface_InternalExpressionValue.externalValueToValueType) + let expectedOutputType = fn.output |> E.O.toExn("") + expect(responseType)->toEqual(Ok(expectedOutputType)) + }, + ) + }) }) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 9d1c6669..25eb87b7 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -350,9 +350,6 @@ module FnDefinition = { } } - let toFfiFn = (t: t): Reducer_Expression_T.optionFfiFn => - (args, environment) => run(t, args, environment)->E.R.toOption - let make = (~name, ~inputs, ~run, ()): t => { name: name, inputs: inputs, @@ -414,7 +411,7 @@ module Registry = { let allExamplesWithFns = (r: registry) => r.functions->E.A2.fmap(fn => fn.examples->E.A2.fmap(example => (fn, example)))->E.A.concatMany - let buildFnNameDict = (r: array): fnNameDict => { + let _buildFnNameDict = (r: array): fnNameDict => { let allDefinitionsWithFns = r ->E.A2.fmap(fn => fn.definitions->E.A2.fmap(definitions => (fn, definitions))) @@ -441,7 +438,7 @@ module Registry = { } let make = (fns: array): registry => { - let dict = buildFnNameDict(fns) + let dict = _buildFnNameDict(fns) {functions: fns, fnNameDict: dict} } From 835ce6b81fb0081065caf47b43576fce4f972e0f Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 19 Jul 2022 08:42:08 -0700 Subject: [PATCH 047/203] Added reducer to Function Registry --- .../FunctionRegistry/FunctionRegistry_Core.res | 17 +++++++++++++---- .../FunctionRegistry/Library/FR_Dict.res | 12 ++++++------ .../FunctionRegistry/Library/FR_Dist.res | 10 ++++++---- .../rescript/FunctionRegistry/Library/FR_Fn.res | 2 +- .../FunctionRegistry/Library/FR_List.res | 10 +++++----- .../FunctionRegistry/Library/FR_Number.res | 6 +++--- .../FunctionRegistry/Library/FR_Pointset.res | 4 ++-- .../FunctionRegistry/Library/FR_Scoring.res | 6 +++--- .../ReducerInterface_ExternalLibrary.res | 12 +++++++----- 9 files changed, 46 insertions(+), 33 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index 25eb87b7..ea43561e 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -47,6 +47,7 @@ type fnDefinition = { array, array, GenericDist.env, + Reducer_Expression_T.reducerFn, ) => result, } @@ -342,10 +343,15 @@ module FnDefinition = { } } - let run = (t: t, args: array, env: GenericDist.env) => { + let run = ( + t: t, + args: array, + env: GenericDist.env, + reducer: Reducer_Expression_T.reducerFn, + ) => { let argValues = FRType.matchWithExpressionValueArray(t.inputs, args) switch argValues { - | Some(values) => t.run(args, values, env) + | Some(values) => t.run(args, values, env, reducer) | None => Error("Incorrect Types") } } @@ -452,6 +458,7 @@ module Registry = { ~fnName: string, ~args: array, ~env: GenericDist.env, + ~reducer: Reducer_Expression_T.reducerFn, ) => { let relevantFunctions = Js.Dict.get(registry.fnNameDict, fnName) |> E.O.default([]) let modified = {functions: relevantFunctions, fnNameDict: registry.fnNameDict} @@ -468,7 +475,8 @@ module Registry = { } switch Matcher.Registry.findMatches(modified, fnName, args) { - | Matcher.Match.FullMatch(match) => match->matchToDef->E.O2.fmap(FnDefinition.run(_, args, env)) + | Matcher.Match.FullMatch(match) => + match->matchToDef->E.O2.fmap(FnDefinition.run(_, args, env, reducer)) | SameNameDifferentArguments(m) => Some(Error(showNameMatchDefinitions(m))) | _ => None } @@ -478,8 +486,9 @@ module Registry = { registry, (fnName, args): ReducerInterface_InternalExpressionValue.functionCall, env, + reducer: Reducer_Expression_T.reducerFn, ) => { - _matchAndRun(~registry, ~fnName, ~args, ~env)->E.O2.fmap( + _matchAndRun(~registry, ~fnName, ~args, ~env, ~reducer)->E.O2.fmap( E.R2.errMap(_, s => Reducer_ErrorValue.RETodo(s)), ) } diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res index 4a52f187..69ceb9c6 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res @@ -52,7 +52,7 @@ let library = [ FnDefinition.make( ~name="merge", ~inputs=[FRTypeDict(FRTypeAny), FRTypeDict(FRTypeAny)], - ~run=(inputs, _, _) => { + ~run=(inputs, _, _, _) => { switch inputs { | [IEvRecord(d1), IEvRecord(d2)] => Internals.merge(d1, d2)->Ok | _ => Error(impossibleError) @@ -74,7 +74,7 @@ let library = [ FnDefinition.make( ~name="mergeMany", ~inputs=[FRTypeArray(FRTypeDict(FRTypeAny))], - ~run=(_, inputs, _) => + ~run=(_, inputs, _, _) => inputs ->Prepare.ToTypedArray.dicts ->E.R2.fmap(E.Dict.concatMany) @@ -96,7 +96,7 @@ let library = [ FnDefinition.make( ~name="keys", ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _, _) => + ~run=(inputs, _, _, _) => switch inputs { | [IEvRecord(d1)] => Internals.keys(d1)->Ok | _ => Error(impossibleError) @@ -116,7 +116,7 @@ let library = [ FnDefinition.make( ~name="values", ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _, _) => + ~run=(inputs, _, _, _) => switch inputs { | [IEvRecord(d1)] => Internals.values(d1)->Ok | _ => Error(impossibleError) @@ -136,7 +136,7 @@ let library = [ FnDefinition.make( ~name="toList", ~inputs=[FRTypeDict(FRTypeAny)], - ~run=(inputs, _, _) => + ~run=(inputs, _, _, _) => switch inputs { | [IEvRecord(dict)] => dict->Internals.toList->Ok | _ => Error(impossibleError) @@ -156,7 +156,7 @@ let library = [ FnDefinition.make( ~name="fromList", ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], - ~run=(inputs, _, _) => + ~run=(inputs, _, _, _) => switch inputs { | [IEvArray(items)] => Internals.fromList(items) | _ => Error(impossibleError) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res index 424983d8..9e10577b 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dist.res @@ -21,7 +21,8 @@ module DistributionCreation = { FnDefinition.make( ~name, ~inputs=[FRTypeDistOrNumber, FRTypeDistOrNumber], - ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env), + ~run=(_, inputs, env, _) => + inputs->Prepare.ToValueTuple.twoDistOrNumber->process(~fn, ~env), (), ) } @@ -30,7 +31,7 @@ module DistributionCreation = { FnDefinition.make( ~name, ~inputs=[FRTypeRecord([("p5", FRTypeDistOrNumber), ("p95", FRTypeDistOrNumber)])], - ~run=(_, inputs, env) => + ~run=(_, inputs, env, _) => inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), (), ) @@ -40,7 +41,7 @@ module DistributionCreation = { FnDefinition.make( ~name, ~inputs=[FRTypeRecord([("mean", FRTypeDistOrNumber), ("stdev", FRTypeDistOrNumber)])], - ~run=(_, inputs, env) => + ~run=(_, inputs, env, _) => inputs->Prepare.ToValueTuple.Record.twoDistOrNumber->process(~fn, ~env), (), ) @@ -57,7 +58,8 @@ module DistributionCreation = { FnDefinition.make( ~name, ~inputs=[FRTypeDistOrNumber], - ~run=(_, inputs, env) => inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env), + ~run=(_, inputs, env, _) => + inputs->Prepare.ToValueTuple.oneDistOrNumber->process(~fn, ~env), (), ) } diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res index 512d564a..ee2ef343 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Fn.res @@ -51,7 +51,7 @@ let library = [ FnDefinition.make( ~name="declare", ~inputs=[Declaration.frType], - ~run=(_, inputs, _) => { + ~run=(_, inputs, _, _) => { inputs->getOrError(0)->E.R.bind(Declaration.fromExpressionValue) }, (), diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res index 25924232..a181fb33 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res @@ -37,7 +37,7 @@ let library = [ FnDefinition.make( ~name="make", ~inputs=[FRTypeNumber, FRTypeAny], - ~run=(inputs, _, _) => { + ~run=(inputs, _, _, _) => { switch inputs { | [IEvNumber(number), value] => Internals.makeFromNumber(number, value)->Ok | _ => Error(impossibleError) @@ -58,7 +58,7 @@ let library = [ FnDefinition.make( ~name="upTo", ~inputs=[FRTypeNumber, FRTypeNumber], - ~run=(_, inputs, _) => + ~run=(_, inputs, _, _) => inputs ->Prepare.ToValueTuple.twoNumbers ->E.R2.fmap(((low, high)) => Internals.upTo(low, high)), @@ -76,7 +76,7 @@ let library = [ FnDefinition.make( ~name="first", ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _, _) => + ~run=(inputs, _, _, _) => switch inputs { | [IEvArray(array)] => Internals.first(array) | _ => Error(impossibleError) @@ -95,7 +95,7 @@ let library = [ FnDefinition.make( ~name="last", ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _, _) => + ~run=(inputs, _, _, _) => switch inputs { | [IEvArray(array)] => Internals.last(array) | _ => Error(impossibleError) @@ -115,7 +115,7 @@ let library = [ FnDefinition.make( ~name="reverse", ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(inputs, _, _) => + ~run=(inputs, _, _, _) => switch inputs { | [IEvArray(array)] => Internals.reverse(array)->Ok | _ => Error(impossibleError) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res index c7027f06..472ae60b 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res @@ -9,7 +9,7 @@ module NumberToNumber = { FnDefinition.make( ~name, ~inputs=[FRTypeNumber], - ~run=(_, inputs, _) => { + ~run=(_, inputs, _, _) => { inputs ->getOrError(0) ->E.R.bind(Prepare.oneNumber) @@ -25,7 +25,7 @@ module ArrayNumberDist = { FnDefinition.make( ~name, ~inputs=[FRTypeArray(FRTypeNumber)], - ~run=(_, inputs, _) => + ~run=(_, inputs, _, _) => Prepare.ToTypedArray.numbers(inputs) ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) ->E.R.bind(fn), @@ -36,7 +36,7 @@ module ArrayNumberDist = { FnDefinition.make( ~name, ~inputs=[FRTypeArray(FRTypeAny)], - ~run=(_, inputs, _) => + ~run=(_, inputs, _, _) => Prepare.ToTypedArray.numbers(inputs) ->E.R.bind(r => E.A.length(r) === 0 ? Error("List is empty") : Ok(r)) ->E.R.bind(fn), 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 dc4daead..2c41a475 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -41,7 +41,7 @@ let library = [ FnDefinition.make( ~name="makeContinuous", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(_, inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + ~run=(_, inputs, _, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), (), ), ], @@ -64,7 +64,7 @@ let library = [ FnDefinition.make( ~name="makeDiscrete", ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(_, inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + ~run=(_, inputs, _, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), (), ), ], diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res index d8d5ddd0..972501e9 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Scoring.res @@ -30,7 +30,7 @@ let library = [ ("prior", FRTypeDist), ]), ], - ~run=(_, inputs, env) => { + ~run=(_, inputs, env, _) => { switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.threeArgs(inputs) { | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueDist(d)), FRValueDist(prior)]) => runScoring(estimate, Score_Dist(d), Some(prior), env) @@ -49,7 +49,7 @@ let library = [ FnDefinition.make( ~name="logScore", ~inputs=[FRTypeRecord([("estimate", FRTypeDist), ("answer", FRTypeDistOrNumber)])], - ~run=(_, inputs, env) => { + ~run=(_, inputs, env, _) => { switch FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs(inputs) { | Ok([FRValueDist(estimate), FRValueDistOrNumber(FRValueDist(d))]) => runScoring(estimate, Score_Dist(d), None, env) @@ -74,7 +74,7 @@ let library = [ FnDefinition.make( ~name="klDivergence", ~inputs=[FRTypeDist, FRTypeDist], - ~run=(_, inputs, env) => { + ~run=(_, inputs, env, _) => { switch inputs { | [FRValueDist(estimate), FRValueDist(d)] => runScoring(estimate, Score_Dist(d), None, env) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res index d6a14dea..fc0a2821 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res @@ -4,16 +4,18 @@ type internalExpressionValue = InternalExpressionValue.t /* Map external calls of Reducer */ -let dispatch = (call: InternalExpressionValue.functionCall, environment, reducer, chain): result< - internalExpressionValue, - 'e, -> => { +let dispatch = ( + call: InternalExpressionValue.functionCall, + environment, + reducer: Reducer_Expression_T.reducerFn, + chain, +): result => { E.A.O.firstSomeFn([ () => ReducerInterface_GenericDistribution.dispatch(call, environment), () => ReducerInterface_Date.dispatch(call, environment), () => ReducerInterface_Duration.dispatch(call, environment), () => ReducerInterface_Number.dispatch(call, environment), - () => FunctionRegistry_Library.dispatch(call, environment), + () => FunctionRegistry_Library.dispatch(call, environment, reducer), ])->E.O2.default(chain(call, environment, reducer)) } From f8d6db61c530660e36a5a24b88ecb84cf756db47 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 19 Jul 2022 10:35:31 -0700 Subject: [PATCH 048/203] Moved list functions into FunctionRegistry --- .../Reducer/Reducer_mapReduce_test.res | 9 -- ...leLibrary_FunctionRegistryLibrary_test.res | 6 + .../FunctionRegistry/Library/FR_List.res | 145 +++++++++++++++++- .../Reducer_Dispatch_BuiltIn.res | 50 ------ .../squiggle-lang/src/rescript/Utility/E.res | 1 + 5 files changed, 148 insertions(+), 63 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res index f3df0962..f89173d5 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res @@ -1,15 +1,6 @@ open Jest open Reducer_TestHelpers -describe("map reduce", () => { - testEvalToBe("double(x)=2*x; arr=[1,2,3]; map(arr, double)", "Ok([2,4,6])") - testEvalToBe("myadd(acc,x)=acc+x; arr=[1,2,3]; reduce(arr, 0, myadd)", "Ok(6)") - testEvalToBe("change(acc,x)=acc*x+x; arr=[1,2,3]; reduce(arr, 0, change)", "Ok(15)") - testEvalToBe("change(acc,x)=acc*x+x; arr=[1,2,3]; reduceReverse(arr, 0, change)", "Ok(9)") - testEvalToBe("arr=[1,2,3]; reverse(arr)", "Ok([3,2,1])") - testEvalToBe("check(x)=(x==2);arr=[1,2,3]; filter(arr,check)", "Ok([2])") -}) - Skip.describe("map reduce (sam)", () => { testEvalToBe("addone(x)=x+1; map(2, addone)", "Error???") testEvalToBe("addone(x)=x+1; map(2, {x: addone})", "Error???") diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res index d4f52e5c..b7c7b8d0 100644 --- a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -16,6 +16,12 @@ describe("FunctionRegistry Library", () => { testEvalToBe("List.first([3,5,8])", "Ok(3)") testEvalToBe("List.last([3,5,8])", "Ok(8)") testEvalToBe("List.reverse([3,5,8])", "Ok([8,5,3])") + testEvalToBe("double(x)=2*x; arr=[1,2,3]; List.map(arr, double)", "Ok([2,4,6])") + testEvalToBe("myadd(acc,x)=acc+x; arr=[1,2,3]; List.reduce(arr, 0, myadd)", "Ok(6)") + testEvalToBe("change(acc,x)=acc*x+x; arr=[1,2,3]; List.reduce(arr, 0, change)", "Ok(15)") + testEvalToBe("change(acc,x)=acc*x+x; arr=[1,2,3]; List.reduceReverse(arr, 0, change)", "Ok(9)") + testEvalToBe("check(x)=(x==2);arr=[1,2,3]; List.filter(arr,check)", "Ok([2])") + testEvalToBe("arr=[1,2,3]; List.reverse(arr)", "Ok([3,2,1])") testEvalToBe("Dist.normal(5,2)", "Ok(Normal(5,2))") testEvalToBe("normal(5,2)", "Ok(Normal(5,2))") testEvalToBe("normal({mean:5,stdev:2})", "Ok(Normal(5,2))") diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res index a181fb33..ba9918da 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res @@ -23,13 +23,67 @@ module Internals = { let reverse = (array: array): internalExpressionValue => IEvArray( Belt.Array.reverse(array), ) + + let map = (array: array, environment, eLambdaValue, reducer): result< + ReducerInterface_InternalExpressionValue.t, + Reducer_ErrorValue.errorValue, + > => { + let rMappedList = array->E.A.reduceReverse(Ok(list{}), (rAcc, elem) => + rAcc->E.R.bind(_, acc => { + let rNewElem = Reducer_Expression_Lambda.doLambdaCall( + eLambdaValue, + list{elem}, + environment, + reducer, + ) + rNewElem->E.R2.fmap(newElem => list{newElem, ...acc}) + }) + ) + rMappedList->E.R2.fmap(mappedList => mappedList->Belt.List.toArray->Wrappers.evArray) + } + + let reduce = (aValueArray, initialValue, aLambdaValue, environment, reducer) => { + aValueArray->E.A.reduce(Ok(initialValue), (rAcc, elem) => + rAcc->E.R.bind(_, acc => + Reducer_Expression_Lambda.doLambdaCall(aLambdaValue, list{acc, elem}, environment, reducer) + ) + ) + } + + let reduceReverse = (aValueArray, initialValue, aLambdaValue, environment, reducer) => { + aValueArray->Belt.Array.reduceReverse(Ok(initialValue), (rAcc, elem) => + rAcc->Belt.Result.flatMap(acc => + Reducer_Expression_Lambda.doLambdaCall(aLambdaValue, list{acc, elem}, environment, reducer) + ) + ) + } + + let filter = (aValueArray, aLambdaValue, environment, reducer) => { + let rMappedList = aValueArray->Belt.Array.reduceReverse(Ok(list{}), (rAcc, elem) => + rAcc->E.R.bind(_, acc => { + let rNewElem = Reducer_Expression_Lambda.doLambdaCall( + aLambdaValue, + list{elem}, + environment, + reducer, + ) + rNewElem->E.R2.fmap(newElem => + switch newElem { + | IEvBool(true) => list{elem, ...acc} + | _ => acc + } + ) + }) + ) + rMappedList->E.R2.fmap(mappedList => mappedList->Belt.List.toArray->Wrappers.evArray) + } } let library = [ Function.make( ~name="make", ~nameSpace, - ~requiresNamespace, + ~requiresNamespace=true, ~output=EvtArray, ~examples=[`List.make(2, "testValue")`], ~definitions=[ @@ -51,7 +105,7 @@ let library = [ Function.make( ~name="upTo", ~nameSpace, - ~requiresNamespace, + ~requiresNamespace=true, ~output=EvtArray, ~examples=[`List.upTo(1,4)`], ~definitions=[ @@ -70,7 +124,7 @@ let library = [ Function.make( ~name="first", ~nameSpace, - ~requiresNamespace, + ~requiresNamespace=true, ~examples=[`List.first([1,4,5])`], ~definitions=[ FnDefinition.make( @@ -89,7 +143,7 @@ let library = [ Function.make( ~name="last", ~nameSpace, - ~requiresNamespace, + ~requiresNamespace=true, ~examples=[`List.last([1,4,5])`], ~definitions=[ FnDefinition.make( @@ -125,4 +179,87 @@ let library = [ ], (), ), + Function.make( + ~name="map", + ~nameSpace, + ~output=EvtArray, + ~requiresNamespace=false, + ~examples=[`List.map([1,4,5], {|x| x+1})`], + ~definitions=[ + FnDefinition.make( + ~name="map", + ~inputs=[FRTypeArray(FRTypeAny), FRTypeLambda], + ~run=(inputs, _, env, reducer) => + switch inputs { + | [IEvArray(array), IEvLambda(lambda)] => + Internals.map(array, env, lambda, reducer)->E.R2.errMap(_ => "Error!") + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="reduce", + ~nameSpace, + ~requiresNamespace=false, + ~examples=[`List.reduce([1,4,5], 2, {|acc, el| acc+el})`], + ~definitions=[ + FnDefinition.make( + ~name="reduce", + ~inputs=[FRTypeArray(FRTypeAny), FRTypeAny, FRTypeLambda], + ~run=(inputs, _, env, reducer) => + switch inputs { + | [IEvArray(array), initialValue, IEvLambda(lambda)] => + Internals.reduce(array, initialValue, lambda, env, reducer)->E.R2.errMap(_ => "Error!") + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="reduceReverse", + ~nameSpace, + ~requiresNamespace=false, + ~examples=[`List.reduceReverse([1,4,5], 2, {|acc, el| acc-el})`], + ~definitions=[ + FnDefinition.make( + ~name="reduceReverse", + ~inputs=[FRTypeArray(FRTypeAny), FRTypeAny, FRTypeLambda], + ~run=(inputs, _, env, reducer) => + switch inputs { + | [IEvArray(array), initialValue, IEvLambda(lambda)] => + Internals.reduceReverse(array, initialValue, lambda, env, reducer)->E.R2.errMap(_ => + "Error!" + ) + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="filter", + ~nameSpace, + ~requiresNamespace=false, + ~examples=[`List.filter([1,4,5], {|x| x>3})`], + ~definitions=[ + FnDefinition.make( + ~name="filter", + ~inputs=[FRTypeArray(FRTypeAny), FRTypeLambda], + ~run=(inputs, _, env, reducer) => + switch inputs { + | [IEvArray(array), IEvLambda(lambda)] => + Internals.filter(array, lambda, env, reducer)->E.R2.errMap(_ => "Error!") + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), ] diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index 0cefe5ee..0f3e1e4b 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -95,31 +95,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce let doExportBindings = (bindings: nameSpace) => bindings->Bindings.toExpressionValue->Ok - let doKeepArray = (aValueArray, aLambdaValue) => { - let rMappedList = aValueArray->Belt.Array.reduceReverse(Ok(list{}), (rAcc, elem) => - rAcc->Result.flatMap(acc => { - let rNewElem = Lambda.doLambdaCall(aLambdaValue, list{elem}, environment, reducer) - rNewElem->Result.map(newElem => - switch newElem { - | IEvBool(true) => list{elem, ...acc} - | _ => acc - } - ) - }) - ) - rMappedList->Result.map(mappedList => mappedList->Belt.List.toArray->IEvArray) - } - - let doMapArray = (aValueArray, aLambdaValue) => { - let rMappedList = aValueArray->Belt.Array.reduceReverse(Ok(list{}), (rAcc, elem) => - rAcc->Result.flatMap(acc => { - let rNewElem = Lambda.doLambdaCall(aLambdaValue, list{elem}, environment, reducer) - rNewElem->Result.map(newElem => list{newElem, ...acc}) - }) - ) - rMappedList->Result.map(mappedList => mappedList->Belt.List.toArray->IEvArray) - } - module SampleMap = { type t = SampleSetDist.t let doLambdaCall = (aLambdaValue, list) => @@ -172,22 +147,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce } } - let doReduceArray = (aValueArray, initialValue, aLambdaValue) => { - aValueArray->Belt.Array.reduce(Ok(initialValue), (rAcc, elem) => - rAcc->Result.flatMap(acc => - Lambda.doLambdaCall(aLambdaValue, list{acc, elem}, environment, reducer) - ) - ) - } - - let doReduceReverseArray = (aValueArray, initialValue, aLambdaValue) => { - aValueArray->Belt.Array.reduceReverse(Ok(initialValue), (rAcc, elem) => - rAcc->Result.flatMap(acc => - Lambda.doLambdaCall(aLambdaValue, list{acc, elem}, environment, reducer) - ) - ) - } - switch call { | ("$_atIndex_$", [IEvArray(aValueArray), IEvNumber(fIndex)]) => arrayAtIndex(aValueArray, fIndex) | ("$_atIndex_$", [IEvBindings(dict), IEvString(sIndex)]) => moduleAtIndex(dict, sIndex) @@ -226,10 +185,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce doAddString(aValueString, bValueString) | ("inspect", [value, IEvString(label)]) => inspectLabel(value, label) | ("inspect", [value]) => inspect(value) - | ("filter", [IEvArray(aValueArray), IEvLambda(aLambdaValue)]) => - doKeepArray(aValueArray, aLambdaValue) - | ("map", [IEvArray(aValueArray), IEvLambda(aLambdaValue)]) => - doMapArray(aValueArray, aLambdaValue) | ("mapSamples", [IEvDistribution(SampleSet(dist)), IEvLambda(aLambdaValue)]) => SampleMap.map1(dist, aLambdaValue) | ( @@ -253,11 +208,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce SampleMap.map3(dist1, dist2, dist3, aLambdaValue) | ("mapSamplesN", [IEvArray(aValueArray), IEvLambda(aLambdaValue)]) => SampleMap.mapN(aValueArray, aLambdaValue) - | ("reduce", [IEvArray(aValueArray), initialValue, IEvLambda(aLambdaValue)]) => - doReduceArray(aValueArray, initialValue, aLambdaValue) - | ("reduceReverse", [IEvArray(aValueArray), initialValue, IEvLambda(aLambdaValue)]) => - doReduceReverseArray(aValueArray, initialValue, aLambdaValue) - | ("reverse", [IEvArray(aValueArray)]) => aValueArray->Belt.Array.reverse->IEvArray->Ok | (_, [IEvBool(_)]) | (_, [IEvNumber(_)]) | (_, [IEvString(_)]) diff --git a/packages/squiggle-lang/src/rescript/Utility/E.res b/packages/squiggle-lang/src/rescript/Utility/E.res index a3af26e9..50a28382 100644 --- a/packages/squiggle-lang/src/rescript/Utility/E.res +++ b/packages/squiggle-lang/src/rescript/Utility/E.res @@ -546,6 +546,7 @@ module A = { let slice = Belt.Array.slice let init = Array.init let reduce = Belt.Array.reduce + let reduceReverse = Belt.Array.reduceReverse let reducei = Belt.Array.reduceWithIndex let some = Belt.Array.some let isEmpty = r => length(r) < 1 From 7316d27b54ff3152be0b3699a730625e57f12b43 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 19 Jul 2022 15:52:28 -0700 Subject: [PATCH 049/203] Added SampleSet fns to FunctionRegistry --- .../FunctionRegistry_Helpers.res | 2 + .../FunctionRegistry_Library.res | 1 + .../FunctionRegistry/Library/FR_List.res | 4 +- .../FunctionRegistry/Library/FR_Pointset.res | 29 +++ .../FunctionRegistry/Library/FR_Sampleset.res | 193 ++++++++++++++++++ .../Reducer_Dispatch_BuiltIn.res | 39 ---- 6 files changed, 227 insertions(+), 41 deletions(-) create mode 100644 packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res index 115d5307..1c06d3c0 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Helpers.res @@ -4,6 +4,8 @@ let impossibleError = "Wrong inputs / Logically impossible" module Wrappers = { let symbolic = r => DistributionTypes.Symbolic(r) + let pointSet = r => DistributionTypes.PointSet(r) + let sampleSet = r => DistributionTypes.SampleSet(r) let evDistribution = r => ReducerInterface_InternalExpressionValue.IEvDistribution(r) let evNumber = r => ReducerInterface_InternalExpressionValue.IEvNumber(r) let evArray = r => ReducerInterface_InternalExpressionValue.IEvArray(r) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 9b0f6737..9236ab84 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -5,6 +5,7 @@ let fnList = Belt.Array.concatMany([ FR_List.library, FR_Number.library, FR_Pointset.library, + FR_Sampleset.library, FR_Scoring.library, ]) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res index ba9918da..762fe31b 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_List.res @@ -67,12 +67,12 @@ module Internals = { environment, reducer, ) - rNewElem->E.R2.fmap(newElem => + rNewElem->E.R2.fmap(newElem => { switch newElem { | IEvBool(true) => list{elem, ...acc} | _ => acc } - ) + }) }) ) rMappedList->E.R2.fmap(mappedList => mappedList->Belt.List.toArray->Wrappers.evArray) 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 2c41a475..b90bc96c 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -70,4 +70,33 @@ let library = [ ], (), ), + Function.make( + ~name="maked", + ~nameSpace, + ~requiresNamespace, + ~examples=[`Pointset.maked(normal(5,2))`], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="maked", + ~inputs=[FRTypeDist], + ~run=(_, inputs, env, _) => + switch inputs { + | [FRValueDist(dist)] => + GenericDist.toPointSet( + dist, + ~xyPointLength=env.xyPointLength, + ~sampleCount=env.sampleCount, + (), + ) + ->E.R2.fmap(Wrappers.pointSet) + ->E.R2.fmap(Wrappers.evDistribution) + ->E.R2.errMap(_ => "") + | _ => 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 new file mode 100644 index 00000000..e92551da --- /dev/null +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -0,0 +1,193 @@ +open FunctionRegistry_Core +open FunctionRegistry_Helpers + +let nameSpace = "Sampleset" +let requiresNamespace = true + +module Internal = { + type t = SampleSetDist.t + let doLambdaCall = (aLambdaValue, list, environment, reducer) => + switch Reducer_Expression_Lambda.doLambdaCall(aLambdaValue, list, environment, reducer) { + | Ok(IEvNumber(f)) => Ok(f) + | _ => Error(Operation.SampleMapNeedsNtoNFunction) + } + + let toType = (r): result< + ReducerInterface_InternalExpressionValue.t, + Reducer_ErrorValue.errorValue, + > => + switch r { + | Ok(r) => Ok(Wrappers.evDistribution(SampleSet(r))) + | Error(r) => Error(REDistributionError(SampleSetError(r))) + } + + let map1 = (sampleSetDist: t, aLambdaValue, env, reducer) => { + let fn = r => doLambdaCall(aLambdaValue, list{IEvNumber(r)}, env, reducer) + SampleSetDist.samplesMap(~fn, sampleSetDist)->toType + } + + let map2 = (t1: t, t2: t, aLambdaValue, env, reducer) => { + let fn = (a, b) => doLambdaCall(aLambdaValue, list{IEvNumber(a), IEvNumber(b)}, env, reducer) + SampleSetDist.map2(~fn, ~t1, ~t2)->toType + } + + let map3 = (t1: t, t2: t, t3: t, aLambdaValue, env, reducer) => { + let fn = (a, b, c) => + doLambdaCall(aLambdaValue, list{IEvNumber(a), IEvNumber(b), IEvNumber(c)}, env, reducer) + SampleSetDist.map3(~fn, ~t1, ~t2, ~t3)->toType + } + + let parseSampleSetArray = (arr: array): option< + array, + > => { + let parseSampleSet = (value: internalExpressionValue): option => + switch value { + | IEvDistribution(SampleSet(dist)) => Some(dist) + | _ => None + } + E.A.O.openIfAllSome(E.A.fmap(parseSampleSet, arr)) + } + + let mapN = (aValueArray: array, aLambdaValue, env, reducer) => { + switch parseSampleSetArray(aValueArray) { + | Some(t1) => + let fn = a => + doLambdaCall( + aLambdaValue, + list{IEvArray(E.A.fmap(x => Wrappers.evNumber(x), a))}, + env, + reducer, + ) + SampleSetDist.mapN(~fn, ~t1)->toType + | None => Error(REFunctionNotFound("")) + } + } +} + +let library = [ + Function.make( + ~name="maker", + ~nameSpace, + ~requiresNamespace, + ~examples=[`Sampleset.maker(normal(5,2))`], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="maker", + ~inputs=[FRTypeDist], + ~run=(_, inputs, env, _) => + switch inputs { + | [FRValueDist(dist)] => + GenericDist.toSampleSetDist(dist, env.sampleCount) + ->E.R2.fmap(Wrappers.sampleSet) + ->E.R2.fmap(Wrappers.evDistribution) + ->E.R2.errMap(_ => "") + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="map", + ~nameSpace, + ~requiresNamespace, + ~examples=[`Sampleset.map(Sampleset.maker(normal(5,2)), {|x| x + 1})`], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="map", + ~inputs=[FRTypeDist, FRTypeLambda], + ~run=(inputs, _, env, reducer) => + switch inputs { + | [IEvDistribution(SampleSet(dist)), IEvLambda(lambda)] => + Internal.map1(dist, lambda, env, reducer)->E.R2.errMap(_ => "") + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="map2", + ~nameSpace, + ~requiresNamespace, + ~examples=[ + `Sampleset.map2(Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2)), {|x, y| x + y})`, + ], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="map2", + ~inputs=[FRTypeDist, FRTypeDist, FRTypeLambda], + ~run=(inputs, _, env, reducer) => { + Js.log2("WHY DIDNT IT MATCH", inputs) + switch inputs { + | [ + IEvDistribution(SampleSet(dist1)), + IEvDistribution(SampleSet(dist2)), + IEvLambda(lambda), + ] => + Internal.map2(dist1, dist2, lambda, env, reducer)->E.R2.errMap(_ => "") + | _ => Error(impossibleError) + } + }, + (), + ), + ], + (), + ), + Function.make( + ~name="map3", + ~nameSpace, + ~requiresNamespace, + ~examples=[ + `Sampleset.map3(Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2)), {|x, y, z| max([x,y,z]))`, + ], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="map3", + ~inputs=[FRTypeDist, FRTypeDist, FRTypeDist, FRTypeLambda], + ~run=(inputs, _, env, reducer) => + switch inputs { + | [ + IEvDistribution(SampleSet(dist1)), + IEvDistribution(SampleSet(dist2)), + IEvDistribution(SampleSet(dist3)), + IEvLambda(lambda), + ] => + Internal.map3(dist1, dist2, dist3, lambda, env, reducer)->E.R2.errMap(_ => "") + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="mapN", + ~nameSpace, + ~requiresNamespace, + ~examples=[ + `Sampleset.mapN([Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2))], {|x| max(x)`, + ], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="mapN", + ~inputs=[FRTypeArray(FRTypeDist), FRTypeLambda], + ~run=(inputs, _, env, reducer) => + switch inputs { + | [IEvArray(dists), IEvLambda(lambda)] => + Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(_ => "") + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), +] diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index 0f3e1e4b..a2e66298 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -109,22 +109,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce | Error(r) => Error(REDistributionError(SampleSetError(r))) } - let map1 = (sampleSetDist: t, aLambdaValue) => { - let fn = r => doLambdaCall(aLambdaValue, list{IEvNumber(r)}) - toType(SampleSetDist.samplesMap(~fn, sampleSetDist)) - } - - let map2 = (t1: t, t2: t, aLambdaValue) => { - let fn = (a, b) => doLambdaCall(aLambdaValue, list{IEvNumber(a), IEvNumber(b)}) - SampleSetDist.map2(~fn, ~t1, ~t2)->toType - } - - let map3 = (t1: t, t2: t, t3: t, aLambdaValue) => { - let fn = (a, b, c) => - doLambdaCall(aLambdaValue, list{IEvNumber(a), IEvNumber(b), IEvNumber(c)}) - SampleSetDist.map3(~fn, ~t1, ~t2, ~t3)->toType - } - let parseSampleSetArray = (arr: array): option< array, > => { @@ -185,29 +169,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce doAddString(aValueString, bValueString) | ("inspect", [value, IEvString(label)]) => inspectLabel(value, label) | ("inspect", [value]) => inspect(value) - | ("mapSamples", [IEvDistribution(SampleSet(dist)), IEvLambda(aLambdaValue)]) => - SampleMap.map1(dist, aLambdaValue) - | ( - "mapSamples2", - [ - IEvDistribution(SampleSet(dist1)), - IEvDistribution(SampleSet(dist2)), - IEvLambda(aLambdaValue), - ], - ) => - SampleMap.map2(dist1, dist2, aLambdaValue) - | ( - "mapSamples3", - [ - IEvDistribution(SampleSet(dist1)), - IEvDistribution(SampleSet(dist2)), - IEvDistribution(SampleSet(dist3)), - IEvLambda(aLambdaValue), - ], - ) => - SampleMap.map3(dist1, dist2, dist3, aLambdaValue) - | ("mapSamplesN", [IEvArray(aValueArray), IEvLambda(aLambdaValue)]) => - SampleMap.mapN(aValueArray, aLambdaValue) | (_, [IEvBool(_)]) | (_, [IEvNumber(_)]) | (_, [IEvString(_)]) From 100ec2c1a8b3c023d4cdbc991d66fb3d41e20b26 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 19 Jul 2022 16:18:28 -0700 Subject: [PATCH 050/203] Adjusting documentation to reflect new functions --- .../FunctionRegistry/Library/FR_Sampleset.res | 2 +- packages/website/docs/Api/Date.md | 14 +++++----- packages/website/docs/Api/DistGeneric.mdx | 26 +----------------- packages/website/docs/Api/DistPointSet.md | 8 ------ packages/website/docs/Api/Function.md | 27 +++++++++++++++++++ packages/website/docs/Api/List.md | 6 +---- 6 files changed, 36 insertions(+), 47 deletions(-) create mode 100644 packages/website/docs/Api/Function.md 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 e92551da..b5064352 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -172,7 +172,7 @@ let library = [ ~nameSpace, ~requiresNamespace, ~examples=[ - `Sampleset.mapN([Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2))], {|x| max(x)`, + `Sampleset.mapN([Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2))], {|x| max(x)})`, ], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ diff --git a/packages/website/docs/Api/Date.md b/packages/website/docs/Api/Date.md index 9f9b9f09..eef71ea0 100644 --- a/packages/website/docs/Api/Date.md +++ b/packages/website/docs/Api/Date.md @@ -5,16 +5,14 @@ title: Date Squiggle date types are a very simple implementation on [Javascript's Date type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date). It's mainly here for early experimentation. There are more relevant functions for the [Duration](/docs/Api/Duration) type. -### makeFromYear - -(Now `makeDateFromYear`) +### fromYear ``` -Date.makeFromYear: (number) => date +Date.fromYear: (number) => date ``` ```js -makeFromYear(2022.32); +Date.fromYear(2022.32); ``` ### toString @@ -30,7 +28,7 @@ add: (date, duration) => date ``` ```js -makeFromYear(2022.32) + years(5); +Date.fromYear(2022.32) + years(5); ``` ### subtract @@ -41,6 +39,6 @@ subtract: (date, duration) => date ``` ```js -makeFromYear(2040) - makeFromYear(2020); // 20 years -makeFromYear(2040) - years(20); // 2020 +Date.fromYear(2040) - Date.fromYear(2020); // 20 years +Date.fromYear(2040) - years(20); // 2020 ``` diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx index 42f464df..a96a6a1e 100644 --- a/packages/website/docs/Api/DistGeneric.mdx +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -653,28 +653,4 @@ scaleLog: (distributionLike, number) => distribution ``` scaleLog10: (distributionLike, number) => distribution -``` - -## Special - -### Declaration (Continuous Functions) - -Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making formal predictions. It allows you to limit the domain that your prediction will be used and scored within. - -Declarations are currently experimental and will likely be removed or changed in the future. - -``` -declareFn: (dict<{fn: lambda, inputs: array>}>) => declaration -``` - -**Examples** - -```javascript -declareFn({ - fn: {|a,b| a }, - inputs: [ - {min: 0, max: 100}, - {min: 30, max: 50} - ] -}) -``` +``` \ No newline at end of file diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md index b4c4ba81..f9117eb9 100644 --- a/packages/website/docs/Api/DistPointSet.md +++ b/packages/website/docs/Api/DistPointSet.md @@ -3,10 +3,6 @@ sidebar_position: 4 title: Point Set Distribution --- -:::danger -These functions aren't yet implemented with these specific names. This should be changed soon -::: - Point set distributions are one of the three distribution formats. They are stored as a list of x-y coordinates representing both discrete and continuous distributions. One complication is that it's possible to represent invalid probability distributions in the point set format. For example, you can represent shapes with negative values, or shapes that are not normalized. @@ -21,8 +17,6 @@ PointSet.make: (distribution) => pointSetDist ### makeContinuous -**TODO: Now called "toContinuousPointSet"** - Converts a set of x-y coordinates directly into a continuous distribution. ``` @@ -40,8 +34,6 @@ PointSet.makeContinuous([ ### makeDiscrete -**TODO: Now called "toDiscretePointSet"** - Converts a set of x-y coordinates directly into a discrete distribution. ``` diff --git a/packages/website/docs/Api/Function.md b/packages/website/docs/Api/Function.md new file mode 100644 index 00000000..b1c53ea3 --- /dev/null +++ b/packages/website/docs/Api/Function.md @@ -0,0 +1,27 @@ +--- +sidebar_position: 6 +title: Function +--- + +## declare (experimental) + +Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making formal predictions. It allows you to limit the domain that your prediction will be used and scored within. + +The one function that declarations currently have is that they impact plotting. If you ``declare`` a single-variable function within a specific range, this specific range will be plotted. + +Declarations are currently experimental and will likely be removed or changed in the future. + +``` +Function.declare: (dict<{fn: lambda, inputs: array>}>) => declaration +``` + +**Examples** + +```javascript +Function.declare({ + fn: {|a| a+10 }, + inputs: [ + {min: 30, max: 100} + ] +}) +``` \ No newline at end of file diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md index 47d5f450..1a8ef7a8 100644 --- a/packages/website/docs/Api/List.md +++ b/packages/website/docs/Api/List.md @@ -11,8 +11,6 @@ myList = [3, normal(5, 2), "random"]; ### make -**Note: currently just called `makeList`, without the preix** - ``` List.make: (number, 'a) => list<'a> ``` @@ -37,9 +35,7 @@ toString: (list<'a>) => string length: (list<'a>) => number ``` -### up to - -**Note: currently just called `upTo`, without the preix** +### upTo ``` List.upTo: (low:number, high:number) => list From 35cd9f37d11166fecabfcd4b7200cab7444bf7c9 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 19 Jul 2022 20:52:08 -0700 Subject: [PATCH 051/203] Basic changes to API --- .../FunctionRegistry/Library/FR_Pointset.res | 8 +-- .../FunctionRegistry/Library/FR_Sampleset.res | 8 +-- packages/website/docs/Api/DistGeneric.mdx | 66 +++++-------------- packages/website/docs/Api/DistPointSet.md | 4 +- packages/website/docs/Api/DistSampleSet.md | 43 +++++++----- packages/website/docs/Api/Number.mdx | 12 ++++ 6 files changed, 65 insertions(+), 76 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 b90bc96c..8634912f 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -71,14 +71,14 @@ let library = [ (), ), Function.make( - ~name="maked", + ~name="fromDist", ~nameSpace, - ~requiresNamespace, - ~examples=[`Pointset.maked(normal(5,2))`], + ~requiresNamespace=true, + ~examples=[`PointSet.fromDist(normal(5,2))`], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( - ~name="maked", + ~name="fromDist", ~inputs=[FRTypeDist], ~run=(_, inputs, env, _) => switch inputs { 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 b5064352..a19f740e 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -66,14 +66,14 @@ module Internal = { let library = [ Function.make( - ~name="maker", + ~name="fromDist", ~nameSpace, - ~requiresNamespace, - ~examples=[`Sampleset.maker(normal(5,2))`], + ~requiresNamespace=true, + ~examples=[`Sampleset.fromDist(normal(5,2))`], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( - ~name="maker", + ~name="fromDist", ~inputs=[FRTypeDist], ~run=(_, inputs, env, _) => switch inputs { diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx index a96a6a1e..e15f3477 100644 --- a/packages/website/docs/Api/DistGeneric.mdx +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -364,6 +364,22 @@ klDivergence: (distribution, distribution) => number klDivergence(normal(5, 2), normal(5, 4)); // returns 0.57 ``` +### logScore + +A log loss score. Often that often acts as a [scoring rule](https://en.wikipedia.org/wiki/Scoring_rule). Useful when evaluating the accuracy of a forecast. + +Note that it is fairly slow. + +``` +logScore: ({estimate: distribution, ?prior: distribution, answer: distribution|number}) => number +``` + +**Examples** + +```javascript +Dist.logScore({estimate: normal(5, 2), answer: normal(4.5, 1.2), prior: normal(6,4)}); // returns -0.597.57 +``` + ## Display ### toString @@ -414,7 +430,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. +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: (distribution) => distribution @@ -605,52 +621,4 @@ dotPow: (distributionLike, distributionLike) => distribution ``` dotExp: (distributionLike, distributionLike) => distribution -``` - -## Scale Arithmetic Operations - - -

- We're planning on removing scale operations in favor of more general - functions soon. -

-
- -Scale operations are similar to pointwise operations, but operate on a constant y-value instead of y-values coming from a distribution. You can think about this as scaling a distribution vertically by a constant. - -The following items would be equivalent. - -```js -scalePow(normal(5,2), 2) -mapY(normal(5,2), {|y| y ^ 2}) // Not yet available -``` - -### scaleMultiply - -``` -scaleMultiply: (distributionLike, number) => distribution -``` - -### scalePow - -``` -scalePow: (distributionLike, number) => distribution -``` - -### scaleExp - -``` -scaleExp: (distributionLike, number) => distribution -``` - -### scaleLog - -``` -scaleLog: (distributionLike, number) => distribution -``` - -### scaleLog10 - -``` -scaleLog10: (distributionLike, number) => distribution ``` \ No newline at end of file diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md index f9117eb9..f3840055 100644 --- a/packages/website/docs/Api/DistPointSet.md +++ b/packages/website/docs/Api/DistPointSet.md @@ -7,12 +7,12 @@ Point set distributions are one of the three distribution formats. They are stor One complication is that it's possible to represent invalid probability distributions in the point set format. For example, you can represent shapes with negative values, or shapes that are not normalized. -### make +### fromDist Converts the distribution in question into a point set distribution. If the distribution is symbolic, then it does this by taking the quantiles. If the distribution is a sample set, then it uses a version of kernel density estimation to approximate the point set format. One complication of this latter process is that if there is a high proportion of overlapping samples (samples that are exactly the same as each other), it will convert these samples into discrete point masses. Eventually we'd like to add further methods to help adjust this process. ``` -PointSet.make: (distribution) => pointSetDist +PointSet.fromDist: (distribution) => pointSetDist ``` ### makeContinuous diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md index 18005627..2796a778 100644 --- a/packages/website/docs/Api/DistSampleSet.md +++ b/packages/website/docs/Api/DistSampleSet.md @@ -13,36 +13,27 @@ Monte Carlo calculations typically result in sample set distributions. All regular distribution function work on sample set distributions. In addition, there are several functions that only work on sample set distributions. -### make - +### fromDist ``` -SampleSet.make: (distribution) => sampleSet -SampleSet.make: (list) => sampleSet -SampleSet.make: (() => number) => sampleSet // not yet implemented +Sampleset.fromDist: (list) => sampleSet ``` -### map - +### fromList ``` -SampleSet.map: (sampleSet, (number => number)) => sampleSet +Sampleset.fromList: (list) => sampleSet ``` -### map2 +### fromFn +(Not yet implemented) ``` -SampleSet.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet -``` - -### map3 - -``` -SampleSet.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet +Sampleset.fromFn: (() => number) => sampleSet ``` ### toList ``` -SampleSet.toList: (sampleSet) => list +Sampleset.toList: (sampleSet) => list ``` Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toList() maintains order and length. @@ -52,3 +43,21 @@ Gets the internal samples of a sampleSet distribution. This is separate from the ``` toList(toSampleSet(normal(5,2))) ``` + +### map + +``` +Sampleset.map: (sampleSet, (number => number)) => sampleSet +``` + +### map2 + +``` +Sampleset.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet +``` + +### map3 + +``` +Sampleset.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet +``` diff --git a/packages/website/docs/Api/Number.mdx b/packages/website/docs/Api/Number.mdx index dda79f64..e77432a0 100644 --- a/packages/website/docs/Api/Number.mdx +++ b/packages/website/docs/Api/Number.mdx @@ -55,6 +55,12 @@ min: (list) => number mean: (list) => number ``` +### geometric mean + +``` +geomean: (list) => number +``` + ### stdev ``` @@ -117,6 +123,12 @@ product: (list) => number cumprod: (list) => list ``` +### diff + +``` +diff: (list) => list +``` + ### subtract ``` From 90d3f89c0ac3ce061b340b5f9e685362924d2218 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 19 Jul 2022 21:32:11 -0700 Subject: [PATCH 052/203] Trying to fix things, but breaking a lot of tests. --- .../Reducer_Dispatch_BuiltIn_test.res | 2 +- .../ReducerInterface_Distribution_test.res | 6 --- .../FunctionRegistry/Library/FR_Sampleset.res | 54 ++++++++++++++++--- packages/website/docs/Api/DistPointSet.md | 2 - 4 files changed, 49 insertions(+), 15 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res index 65048ebb..a4cc15b3 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res @@ -18,7 +18,7 @@ describe("builtin", () => { testEval("2>1", "Ok(true)") testEval("concat('a','b')", "Ok('ab')") testEval( - "addOne(t)=t+1; toList(mapSamples(fromSamples([1,2,3,4,5,6]), addOne))", + "addOne(t)=t+1; toList(Sampleset.map(fromSamples([1,2,3,4,5,6]), addOne))", "Ok([2,3,4,5,6,7])", ) testEval( diff --git a/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res b/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res index ecc07bfa..3083b71b 100644 --- a/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res +++ b/packages/squiggle-lang/__tests__/ReducerInterface/ReducerInterface_Distribution_test.res @@ -41,12 +41,6 @@ describe("eval on distribution functions", () => { describe("normalize", () => { testEval("normalize(normal(5,2))", "Ok(Normal(5,2))") }) - describe("toPointSet", () => { - testEval("toPointSet(normal(5,2))", "Ok(Point Set Distribution)") - }) - describe("toSampleSet", () => { - testEval("toSampleSet(normal(5,2), 100)", "Ok(Sample Set Distribution)") - }) describe("add", () => { testEval("add(normal(5,2), normal(10,2))", "Ok(Normal(15,2.8284271247461903))") testEval("add(normal(5,2), lognormal(10,2))", "Ok(Sample Set Distribution)") 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 a19f740e..fd27c5f7 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -90,14 +90,57 @@ let library = [ (), ), Function.make( - ~name="map", + ~name="fromLlist", ~nameSpace, - ~requiresNamespace, - ~examples=[`Sampleset.map(Sampleset.maker(normal(5,2)), {|x| x + 1})`], + ~requiresNamespace=true, + ~examples=[`Sampleset.fromLlist([3,5,2,3,5,2,3,5,2,3,3,5,3,2,3,1,1,3])`], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( - ~name="map", + ~name="fromLlist", + ~inputs=[FRTypeArray(FRTypeNumber)], + ~run=(_, inputs, _, _) => { + let sampleSet = + Prepare.ToTypedArray.numbers(inputs) |> E.R2.bind(r => + SampleSetDist.make(r)->E.R2.errMap(_ => "") + ) + sampleSet->E.R2.fmap(Wrappers.sampleSet)->E.R2.fmap(Wrappers.evDistribution) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="toLlist", + ~nameSpace, + ~requiresNamespace=false, + ~examples=[`Sampleset.toLlist(Sampleset.maker(normal(5,2))`], + ~output=ReducerInterface_InternalExpressionValue.EvtArray, + ~definitions=[ + FnDefinition.make( + ~name="toLlist", + ~inputs=[FRTypeDist], + ~run=(inputs, _, _, _) => + switch inputs { + | [IEvDistribution(SampleSet(dist))] => + dist->E.A2.fmap(Wrappers.evNumber)->Wrappers.evArray->Ok + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), + Function.make( + ~name="mapp", + ~nameSpace, + ~requiresNamespace, + ~examples=[`Sampleset.mapp(Sampleset.maker(normal(5,2)), {|x| x + 1})`], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="mapp", ~inputs=[FRTypeDist, FRTypeLambda], ~run=(inputs, _, env, reducer) => switch inputs { @@ -123,7 +166,6 @@ let library = [ ~name="map2", ~inputs=[FRTypeDist, FRTypeDist, FRTypeLambda], ~run=(inputs, _, env, reducer) => { - Js.log2("WHY DIDNT IT MATCH", inputs) switch inputs { | [ IEvDistribution(SampleSet(dist1)), @@ -182,7 +224,7 @@ let library = [ ~run=(inputs, _, env, reducer) => switch inputs { | [IEvArray(dists), IEvLambda(lambda)] => - Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(_ => "") + Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(e => {Js.log2("HI", e); "AHHH doesn't work"}) | _ => Error(impossibleError) }, (), diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md index f3840055..9c9c3d0d 100644 --- a/packages/website/docs/Api/DistPointSet.md +++ b/packages/website/docs/Api/DistPointSet.md @@ -34,8 +34,6 @@ PointSet.makeContinuous([ ### makeDiscrete -Converts a set of x-y coordinates directly into a discrete distribution. - ``` PointSet.makeDiscrete: (list<{x: number, y: number}>) => pointSetDist ``` From 9173b103f5b94867b0520fe339bde9f423ba7279 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 19 Jul 2022 23:06:10 -0700 Subject: [PATCH 053/203] Fixed major bug for module functions --- ...leLibrary_FunctionRegistryLibrary_test.res | 1 + packages/squiggle-lang/package.json | 1 + .../FunctionRegistry_Core.res | 103 ++++++++++++------ .../FunctionRegistry_Library.res | 2 +- .../FunctionRegistry/Library/FR_Dict.res | 5 +- .../FunctionRegistry/Library/FR_Pointset.res | 2 +- .../FunctionRegistry/Library/FR_Sampleset.res | 30 ++--- 7 files changed, 94 insertions(+), 50 deletions(-) diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res index b7c7b8d0..1dcf0471 100644 --- a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -59,6 +59,7 @@ describe("FunctionRegistry Library", () => { ) testEvalToBe("Dist.logScore({estimate: normal(5,2), answer: 4.5})", "Ok(1.6433360626394853)") testEvalToBe("Dist.klDivergence(normal(5,2), normal(5,1.5))", "Ok(0.06874342818671068)") + testEvalToBe("Sampleset.fromList([3,5,2,3,5,2,3,5,2,3,3,5])", "Ok(Sample Set Distribution)") }) describe("Fn auto-testing", () => { diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 75531a28..6adaa595 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -15,6 +15,7 @@ "start": "rescript build -w -with-deps", "clean": "rescript clean && rm -rf dist", "test:reducer": "jest __tests__/Reducer*/", + "test:current": "jest __tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.bs.js", "benchmark": "ts-node benchmark/conversion_tests.ts", "test": "jest", "test:ts": "jest __tests__/TS/", diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index ea43561e..f1dde98b 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -170,6 +170,7 @@ module FRType = { inputs: array, args: array, ): option> => { + // Js.log3("Matching", inputs, args) let isSameLength = E.A.length(inputs) == E.A.length(args) if !isSameLength { None @@ -240,53 +241,82 @@ module Matcher = { type definitionId = int type match = Match.t, definitionId> - let match = (f: function, fnName: string, args: array): match => { - let matchedDefinition = () => - E.A.getIndexBy(f.definitions, r => - MatchSimple.isFullMatch(FnDefinition.match(r, fnName, args)) - ) |> E.O.fmap(r => Match.FullMatch(r)) - let getMatchedNameOnlyDefinition = () => { - let nameMatchIndexes = - f.definitions - ->E.A2.fmapi((index, r) => - MatchSimple.isNameMatchOnly(FnDefinition.match(r, fnName, args)) ? Some(index) : None + let match = ( + f: function, + namespace: option, + fnName: string, + args: array, + ): match => { + switch namespace { + | Some(ns) if ns !== f.nameSpace => Match.DifferentName + | _ => { + let matchedDefinition = () => + E.A.getIndexBy(f.definitions, r => + MatchSimple.isFullMatch(FnDefinition.match(r, fnName, args)) + ) |> E.O.fmap(r => Match.FullMatch(r)) + let getMatchedNameOnlyDefinition = () => { + let nameMatchIndexes = + f.definitions + ->E.A2.fmapi((index, r) => + MatchSimple.isNameMatchOnly(FnDefinition.match(r, fnName, args)) + ? Some(index) + : None + ) + ->E.A.O.concatSomes + switch nameMatchIndexes { + | [] => None + | elements => Some(Match.SameNameDifferentArguments(elements)) + } + } + + E.A.O.firstSomeFnWithDefault( + [matchedDefinition, getMatchedNameOnlyDefinition], + Match.DifferentName, ) - ->E.A.O.concatSomes - switch nameMatchIndexes { - | [] => None - | elements => Some(Match.SameNameDifferentArguments(elements)) } } - - E.A.O.firstSomeFnWithDefault( - [matchedDefinition, getMatchedNameOnlyDefinition], - Match.DifferentName, - ) } } module RegistryMatch = { type match = { + namespace: option, fnName: string, inputIndex: int, } - let makeMatch = (fnName: string, inputIndex: int) => {fnName: fnName, inputIndex: inputIndex} + let makeMatch = (namespace: option, fnName: string, inputIndex: int) => { + namespace: namespace, + fnName: fnName, + inputIndex: inputIndex, + } } module Registry = { - let _findExactMatches = (r: registry, fnName: string, args: array) => { - let functionMatchPairs = r.functions->E.A2.fmap(l => (l, Function.match(l, fnName, args))) + let _findExactMatches = ( + r: registry, + namespace: option, + fnName: string, + args: array, + ) => { + let functionMatchPairs = + r.functions->E.A2.fmap(l => (l, Function.match(l, namespace, fnName, args))) let fullMatch = functionMatchPairs->E.A.getBy(((_, match)) => Match.isFullMatch(match)) fullMatch->E.O.bind(((fn, match)) => switch match { - | FullMatch(index) => Some(RegistryMatch.makeMatch(fn.name, index)) + | FullMatch(index) => Some(RegistryMatch.makeMatch(namespace, fn.name, index)) | _ => None } ) } - let _findNameMatches = (r: registry, fnName: string, args: array) => { - let functionMatchPairs = r.functions->E.A2.fmap(l => (l, Function.match(l, fnName, args))) + let _findNameMatches = ( + r: registry, + namespace: option, + fnName: string, + args: array, + ) => { + let functionMatchPairs = + r.functions->E.A2.fmap(l => (l, Function.match(l, namespace, fnName, args))) let getNameMatches = functionMatchPairs ->E.A2.fmap(((fn, match)) => Match.isNameMatchOnly(match) ? Some((fn, match)) : None) @@ -296,7 +326,7 @@ module Matcher = { ->E.A2.fmap(((fn, match)) => switch match { | SameNameDifferentArguments(indexes) => - indexes->E.A2.fmap(index => RegistryMatch.makeMatch(fn.name, index)) + indexes->E.A2.fmap(index => RegistryMatch.makeMatch(namespace, fn.name, index)) | _ => [] } ) @@ -307,22 +337,29 @@ module Matcher = { let findMatches = (r: registry, fnName: string, args: array) => { let fnNameInParts = Js.String.split(".", fnName) let fnToSearch = E.A.get(fnNameInParts, 1) |> E.O.default(fnNameInParts[0]) + let nameSpace = E.A.length(fnNameInParts) > 1 ? Some(fnNameInParts[0]) : None - switch _findExactMatches(r, fnToSearch, args) { + switch _findExactMatches(r, nameSpace, fnToSearch, args) { | Some(r) => Match.FullMatch(r) | None => - switch _findNameMatches(r, fnToSearch, args) { + switch _findNameMatches(r, nameSpace, fnToSearch, args) { | Some(r) => Match.SameNameDifferentArguments(r) | None => Match.DifferentName } } } - let matchToDef = (registry: registry, {fnName, inputIndex}: RegistryMatch.match): option< - fnDefinition, - > => + let matchToDef = ( + registry: registry, + {namespace, fnName, inputIndex}: RegistryMatch.match, + ): option => registry.functions - ->E.A.getBy(fn => fn.name === fnName) + ->E.A.getBy(fn => { + switch namespace { + | Some(ns) => ns === fn.nameSpace && fnName === fn.name + | _ => fnName === fn.name + } + }) ->E.O.bind(fn => E.A.get(fn.definitions, inputIndex)) } } @@ -474,6 +511,8 @@ module Registry = { `There are function matches for ${fnName}(), but with different arguments: ${defs}` } + let match = Matcher.Registry.findMatches(modified, fnName, args) + switch Matcher.Registry.findMatches(modified, fnName, args) { | Matcher.Match.FullMatch(match) => match->matchToDef->E.O2.fmap(FnDefinition.run(_, args, env, reducer)) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 9236ab84..a12c4a36 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -2,10 +2,10 @@ let fnList = Belt.Array.concatMany([ FR_Dict.library, FR_Dist.library, FR_Fn.library, + FR_Sampleset.library, FR_List.library, FR_Number.library, FR_Pointset.library, - FR_Sampleset.library, FR_Scoring.library, ]) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res index 69ceb9c6..10e84f92 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res @@ -156,11 +156,12 @@ let library = [ FnDefinition.make( ~name="fromList", ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], - ~run=(inputs, _, _, _) => + ~run=(inputs, _, _, _) =>{ switch inputs { | [IEvArray(items)] => Internals.fromList(items) | _ => Error(impossibleError) - }, + } + }, (), ), ], 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 8634912f..1a4569f4 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -74,7 +74,7 @@ let library = [ ~name="fromDist", ~nameSpace, ~requiresNamespace=true, - ~examples=[`PointSet.fromDist(normal(5,2))`], + ~examples=[`Pointset.fromDist(normal(5,2))`], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( 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 fd27c5f7..85497f8d 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -90,19 +90,19 @@ let library = [ (), ), Function.make( - ~name="fromLlist", + ~name="fromList", ~nameSpace, ~requiresNamespace=true, - ~examples=[`Sampleset.fromLlist([3,5,2,3,5,2,3,5,2,3,3,5,3,2,3,1,1,3])`], + ~examples=[`Sampleset.fromList([3,5,2,3,5,2,3,5,2,3,3,5,3,2,3,1,1,3])`], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( - ~name="fromLlist", + ~name="fromList", ~inputs=[FRTypeArray(FRTypeNumber)], ~run=(_, inputs, _, _) => { let sampleSet = Prepare.ToTypedArray.numbers(inputs) |> E.R2.bind(r => - SampleSetDist.make(r)->E.R2.errMap(_ => "") + SampleSetDist.make(r)->E.R2.errMap(_ => "AM I HERE? WHYERE AMI??") ) sampleSet->E.R2.fmap(Wrappers.sampleSet)->E.R2.fmap(Wrappers.evDistribution) }, @@ -112,14 +112,14 @@ let library = [ (), ), Function.make( - ~name="toLlist", + ~name="toList", ~nameSpace, ~requiresNamespace=false, - ~examples=[`Sampleset.toLlist(Sampleset.maker(normal(5,2))`], + ~examples=[`Sampleset.toList(Sampleset.fromDist(normal(5,2)))`], ~output=ReducerInterface_InternalExpressionValue.EvtArray, ~definitions=[ FnDefinition.make( - ~name="toLlist", + ~name="toList", ~inputs=[FRTypeDist], ~run=(inputs, _, _, _) => switch inputs { @@ -133,14 +133,14 @@ let library = [ (), ), Function.make( - ~name="mapp", + ~name="map", ~nameSpace, ~requiresNamespace, - ~examples=[`Sampleset.mapp(Sampleset.maker(normal(5,2)), {|x| x + 1})`], + ~examples=[`Sampleset.map(Sampleset.fromDist(normal(5,2)), {|x| x + 1})`], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( - ~name="mapp", + ~name="map", ~inputs=[FRTypeDist, FRTypeLambda], ~run=(inputs, _, env, reducer) => switch inputs { @@ -158,7 +158,7 @@ let library = [ ~nameSpace, ~requiresNamespace, ~examples=[ - `Sampleset.map2(Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2)), {|x, y| x + y})`, + `Sampleset.map2(Sampleset.fromDist(normal(5,2)), Sampleset.fromDist(normal(5,2)), {|x, y| x + y})`, ], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ @@ -186,7 +186,7 @@ let library = [ ~nameSpace, ~requiresNamespace, ~examples=[ - `Sampleset.map3(Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2)), {|x, y, z| max([x,y,z]))`, + `Sampleset.map3(Sampleset.fromDist(normal(5,2)), Sampleset.fromDist(normal(5,2)), Sampleset.fromDist(normal(5,2)), {|x, y, z| max([x,y,z])})`, ], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ @@ -214,7 +214,7 @@ let library = [ ~nameSpace, ~requiresNamespace, ~examples=[ - `Sampleset.mapN([Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2)), Sampleset.maker(normal(5,2))], {|x| max(x)})`, + `Sampleset.mapN([Sampleset.fromDist(normal(5,2)), Sampleset.fromDist(normal(5,2)), Sampleset.fromDist(normal(5,2))], {|x| max(x)})`, ], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ @@ -224,7 +224,9 @@ let library = [ ~run=(inputs, _, env, reducer) => switch inputs { | [IEvArray(dists), IEvLambda(lambda)] => - Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(e => {Js.log2("HI", e); "AHHH doesn't work"}) + Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(e => { + "AHHH doesn't work" + }) | _ => Error(impossibleError) }, (), From 1c4557b638d3094db4946427f4e4c3b9a3daf303 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Tue, 19 Jul 2022 15:28:06 +0200 Subject: [PATCH 054/203] Introduce void type yarn all:rescript EvVoid parsing void void --- .../Reducer_Peggy_ToExpression_void_test.res | 20 ++++++++ packages/squiggle-lang/package.json | 1 + .../Reducer_Expression_ExpressionBuilder.res | 2 + .../Reducer_Peggy_GeneratedParser.peggy | 51 ++++++++++++------- .../Reducer_Peggy/Reducer_Peggy_Parse.res | 5 ++ .../Reducer_Peggy_ToExpression.res | 1 + .../rescript/Reducer/Reducer_Peggy/helpers.ts | 4 ++ ...ducerInterface_ExternalExpressionValue.res | 2 + ...ducerInterface_InternalExpressionValue.res | 8 +++ 9 files changed, 75 insertions(+), 19 deletions(-) create mode 100644 packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_void_test.res diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_void_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_void_test.res new file mode 100644 index 00000000..a106a188 --- /dev/null +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_void_test.res @@ -0,0 +1,20 @@ +open Jest +open Reducer_Peggy_TestHelpers + +describe("Peggy void", () => { + //literal + testToExpression("()", "{()}", ~v="()", ()) + testToExpression( + "fn()=1", + "{(:$_let_$ :fn (:$$_lambda_$$ [_] {1}))}", + ~v="@{fn: lambda(_=>internal code)}", + (), + ) + testToExpression("fn()=1; fn()", "{(:$_let_$ :fn (:$$_lambda_$$ [_] {1})); (:fn ())}", ~v="1", ()) + testToExpression( + "fn(a)=(); call fn(1)", + "{(:$_let_$ :fn (:$$_lambda_$$ [a] {()})); (:$_let_$ :_ {(:fn 1)})}", + ~v="@{_: (),fn: lambda(a=>internal code)}", + (), + ) +}) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 75531a28..1c4ba3ac 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -31,6 +31,7 @@ "format:prettier": "prettier --write .", "format": "yarn format:rescript && yarn format:prettier", "prepack": "yarn build && yarn test && yarn bundle", + "all:rescript": "yarn build:rescript && yarn test:rescript && yarn format:rescript", "all": "yarn build && yarn bundle && yarn test" }, "keywords": [ diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_ExpressionBuilder.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_ExpressionBuilder.res index 14ffe685..9cc25725 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_ExpressionBuilder.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_ExpressionBuilder.res @@ -82,3 +82,5 @@ let eIdentifier = (name: string): expression => let eTypeIdentifier = (name: string): expression => name->BInternalExpressionValue.IEvTypeIdentifier->BExpressionT.EValue + +let eVoid: expression = BInternalExpressionValue.IEvVoid->BExpressionT.EValue 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 f4acd4a3..befda109 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 @@ -5,13 +5,12 @@ }} start - // = _nl start:typeExpression _nl finalComment? {return start} = _nl start:outerBlock _nl finalComment? {return start} zeroOMoreArgumentsBlockOrExpression = innerBlockOrExpression / lambda outerBlock - = statements:array_statements finalExpression: (statementSeparator @expression)? + = statements:array_statements finalExpression: (statementSeparator @expression)? { if (finalExpression != null) { statements.push(finalExpression) } return h.nodeBlock(statements) } / finalExpression: expression @@ -24,25 +23,31 @@ innerBlockOrExpression quotedInnerBlock = '{' _nl statements:array_statements finalExpression: (statementSeparator @expression) _nl '}' - { statements.push(finalExpression) - return h.nodeBlock(statements) } + { statements.push(finalExpression) + return h.nodeBlock(statements) } / '{' _nl finalExpression: expression _nl '}' - { return h.nodeBlock([finalExpression]) } + { return h.nodeBlock([finalExpression]) } array_statements = head:statement tail:(statementSeparator @array_statements ) { return [head, ...tail] } / head:statement - { return [head] } + { return [head] } statement = letStatement / defunStatement / typeStatement + / voidStatement + +voidStatement + = "call" _nl value:zeroOMoreArgumentsBlockOrExpression + { var variable = h.nodeIdentifier("_", location()); + return h.nodeLetStatement(variable, value); } letStatement = variable:identifier _ assignmentOp _nl value:zeroOMoreArgumentsBlockOrExpression - { return h.nodeLetStatement(variable, value) } + { return h.nodeLetStatement(variable, value) } defunStatement = variable:identifier '(' _nl args:array_parameters _nl ')' _ assignmentOp _nl body:innerBlockOrExpression @@ -53,13 +58,15 @@ defunStatement array_parameters = head:dollarIdentifier tail:(_ ',' _nl @dollarIdentifier)* - { return [head, ...tail]; } + { return [head, ...tail]; } + / "" + { return [h.nodeIdentifier("_", location())]; } expression = ifthenelse / ternary / logicalAdditive ifthenelse = 'if' __nl condition:logicalAdditive - __nl 'then' __nl trueExpression:innerBlockOrExpression + __nl 'then' __nl trueExpression:innerBlockOrExpression __nl 'else' __nl falseExpression:(ifthenelse/innerBlockOrExpression) { return h.nodeTernary(condition, trueExpression, falseExpression) } @@ -88,8 +95,8 @@ equality = left:relational _ operator:equalityOp _nl right:relational { return h.makeFunctionCall(h.toFunction[operator], [left, right])} / relational - - equalityOp "operator" = '=='/'!=' + + equalityOp "operator" = '=='/'!=' relational = left:additive _ operator:relationalOp _nl right:additive @@ -172,19 +179,25 @@ collectionElement array_functionArguments = head:expression tail:(_ ',' _nl @expression)* { return [head, ...tail]; } + / "" + {return [h.nodeVoid()];} atom = '(' _nl expression:expression _nl ')' {return expression} / basicValue basicValue = valueConstructor / basicLiteral - + basicLiteral = string / number / boolean / dollarIdentifierWithModule / dollarIdentifier + / voidLiteral + +voidLiteral 'void' + = "()" {return h.nodeVoid();} dollarIdentifierWithModule 'identifier' = head:$moduleIdentifier @@ -195,7 +208,7 @@ dollarIdentifierWithModule 'identifier' modifiers.unshift(head) modifiers.push(final) let modifiedIdentifier = modifiers.join('.') - return h.nodeIdentifier(modifiedIdentifier) + return h.nodeIdentifier(modifiedIdentifier, location()) } identifier 'identifier' @@ -232,8 +245,8 @@ float 'float' = $(((d+ "\." d*) / ("\." d+)) floatExponent? / d+ floatExponent) { return h.nodeFloat(parseFloat(text()))} - floatExponent = [e]i '-'? d+ - d = [0-9] + floatExponent = [e]i '-'? d+ + d = [0-9] boolean 'boolean' = ('true'/'false') @@ -247,10 +260,10 @@ valueConstructor lambda = '{' _nl '|' _nl args:array_parameters _nl '|' _nl statements:array_statements finalExpression: (statementSeparator @expression) _nl '}' - { statements.push(finalExpression) - return h.nodeLambda(args, h.nodeBlock(statements)) } + { statements.push(finalExpression) + return h.nodeLambda(args, h.nodeBlock(statements)) } / '{' _nl '|' _nl args:array_parameters _nl '|' _nl finalExpression: expression _nl '}' - { return h.nodeLambda(args, h.nodeBlock([finalExpression])) } + { return h.nodeLambda(args, h.nodeBlock([finalExpression])) } arrayConstructor 'array' = '[' _nl ']' @@ -289,7 +302,7 @@ __nl 'whitespace or newline' = (whiteSpaceCharactersOrComment / commentOrNewLine )+ statementSeparator 'statement separator' - = _ (';'/ commentOrNewLine)+ _nl + = _ (';'/ commentOrNewLine)+ _nl commentOrNewLine = finalComment? newLine diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_Parse.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_Parse.res index a38c66e9..193cb893 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_Parse.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_Parse.res @@ -34,6 +34,7 @@ type nodeModuleIdentifier = {...node, "value": string} type nodeString = {...node, "value": string} type nodeTernary = {...node, "condition": node, "trueExpression": node, "falseExpression": node} type nodeTypeIdentifier = {...node, "value": string} +type nodeVoid = node type peggyNode = | PgNodeBlock(nodeBlock) @@ -50,6 +51,7 @@ type peggyNode = | PgNodeString(nodeString) | PgNodeTernary(nodeTernary) | PgNodeTypeIdentifier(nodeTypeIdentifier) + | PgNodeVoid(nodeVoid) external castNodeBlock: node => nodeBlock = "%identity" external castNodeBoolean: node => nodeBoolean = "%identity" @@ -65,6 +67,7 @@ external castNodeModuleIdentifier: node => nodeModuleIdentifier = "%identity" external castNodeString: node => nodeString = "%identity" external castNodeTernary: node => nodeTernary = "%identity" external castNodeTypeIdentifier: node => nodeTypeIdentifier = "%identity" +external castNodeVoid: node => nodeVoid = "%identity" exception UnsupportedPeggyNodeType(string) // This should never happen; programming error let castNodeType = (node: node) => @@ -83,6 +86,7 @@ let castNodeType = (node: node) => | "String" => node->castNodeString->PgNodeString | "Ternary" => node->castNodeTernary->PgNodeTernary | "TypeIdentifier" => node->castNodeTypeIdentifier->PgNodeTypeIdentifier + | "Void" => node->castNodeVoid->PgNodeVoid | _ => raise(UnsupportedPeggyNodeType(node["type"])) } @@ -116,6 +120,7 @@ let rec pgToString = (peggyNode: peggyNode): string => { " " ++ toString(node["falseExpression"]) ++ ")" | PgNodeTypeIdentifier(node) => `#${node["value"]}` + | PgNodeVoid(_node) => "()" } } and toString = (node: node): string => node->castNodeType->pgToString diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression.res index 6e04a55d..73247a8e 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression.res @@ -48,5 +48,6 @@ let rec fromNode = (node: Parse.node): expression => { ) | PgNodeTypeIdentifier(nodeTypeIdentifier) => ExpressionBuilder.eTypeIdentifier(nodeTypeIdentifier["value"]) + | PgNodeVoid(_) => ExpressionBuilder.eVoid } } diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/helpers.ts b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/helpers.ts index 57b85f9e..94975233 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/helpers.ts +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/helpers.ts @@ -213,3 +213,7 @@ export function nodeTernary( export function nodeTypeIdentifier(typeValue: string) { return { type: "TypeIdentifier", value: typeValue }; } + +export function nodeVoid() { + return { type: "Void" }; +} diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res index b21ba3c6..a4d6e713 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res @@ -25,6 +25,7 @@ type rec externalExpressionValue = | EvTypeIdentifier(string) | EvModule(record) | EvType(record) + | EvVoid and record = Js.Dict.t and externalBindings = record and lambdaValue = { @@ -63,6 +64,7 @@ let rec toString = aValue => | EvTimeDuration(t) => DateTime.Duration.toString(t) | EvType(t) => `type${t->toStringRecord}` | EvTypeIdentifier(id) => `#${id}` + | EvVoid => `()` } and toStringRecord = aRecord => { let pairs = diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res index 4523b02a..39019fba 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res @@ -23,6 +23,7 @@ type rec t = | IEvTimeDuration(float) | IEvType(map) | IEvTypeIdentifier(string) + | IEvVoid and map = Belt.Map.String.t and nameSpace = NameSpace(Belt.Map.String.t) and lambdaValue = { @@ -60,6 +61,7 @@ let rec toString = aValue => | IEvType(aMap) => aMap->toStringMap | IEvTimeDuration(t) => DateTime.Duration.toString(t) | IEvTypeIdentifier(id) => `#${id}` + | IEvVoid => `()` } and toStringMap = aMap => { let pairs = @@ -92,6 +94,7 @@ let toStringWithType = aValue => | IEvTimeDuration(_) => `Date::${toString(aValue)}` | IEvType(_) => `Type::${toString(aValue)}` | IEvTypeIdentifier(_) => `TypeIdentifier::${toString(aValue)}` + | IEvVoid => `Void` } let argsToString = (args: array): string => { @@ -135,6 +138,7 @@ type internalExpressionValueType = | EvtTimeDuration | EvtType | EvtTypeIdentifier + | EvtVoid type functionCallSignature = CallSignature(string, array) type functionDefinitionSignature = @@ -158,6 +162,7 @@ let valueToValueType = value => | IEvTimeDuration(_) => EvtTimeDuration | IEvType(_) => EvtType | IEvTypeIdentifier(_) => EvtTypeIdentifier + | IEvVoid => EvtVoid } let functionCallToCallSignature = (functionCall: functionCall): functionCallSignature => { @@ -183,6 +188,7 @@ let valueTypeToString = (valueType: internalExpressionValueType): string => | EvtTimeDuration => `Duration` | EvtType => `Type` | EvtTypeIdentifier => `TypeIdentifier` + | EvtVoid => `Void` } let functionCallSignatureToString = (functionCallSignature: functionCallSignature): string => { @@ -212,6 +218,7 @@ let rec toExternal = (iev: t): ExternalExpressionValue.t => { | IEvType(v) => v->mapToExternal->EvType | IEvTypeIdentifier(v) => EvTypeIdentifier(v) | IEvBindings(v) => v->nameSpaceToTypeScriptBindings->EvModule + | IEvVoid => EvVoid } } and mapToExternal = v => @@ -251,6 +258,7 @@ let rec toInternal = (ev: ExternalExpressionValue.t): t => { | EvTimeDuration(v) => IEvTimeDuration(v) | EvType(v) => v->recordToInternal->IEvType | EvTypeIdentifier(v) => IEvTypeIdentifier(v) + | EvVoid => IEvVoid } } and recordToInternal = v => From 078534f7c849b6bbf002a41b1648c1b2b6429cf1 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Wed, 20 Jul 2022 08:27:57 -0700 Subject: [PATCH 055/203] Fixed typescript build --- packages/squiggle-lang/src/js/index.ts | 151 ++++++++++-------- .../squiggle-lang/src/js/rescript_interop.ts | 3 +- 2 files changed, 82 insertions(+), 72 deletions(-) diff --git a/packages/squiggle-lang/src/js/index.ts b/packages/squiggle-lang/src/js/index.ts index 5e4cf2c1..acee005c 100644 --- a/packages/squiggle-lang/src/js/index.ts +++ b/packages/squiggle-lang/src/js/index.ts @@ -120,77 +120,86 @@ function createTsExport( x: expressionValue, environment: environment ): squiggleExpression { - switch (x.tag) { - case "EvArray": - // genType doesn't convert anything more than 2 layers down into {tag: x, value: x} - // format, leaving it as the raw values. This converts the raw values - // directly into typescript values. - // - // The casting here is because genType is about the types of the returned - // values, claiming they are fully recursive when that's not actually the - // case - return tag( - "array", - x.value.map( - (arrayItem): squiggleExpression => - convertRawToTypescript( - arrayItem as unknown as rescriptExport, - environment + switch (x) { + case "EvVoid": + return tag("void", ""); + default: { + switch (x.tag) { + case "EvArray": + // genType doesn't convert anything more than 2 layers down into {tag: x, value: x} + // format, leaving it as the raw values. This converts the raw values + // directly into typescript values. + // + // The casting here is because genType is about the types of the returned + // values, claiming they are fully recursive when that's not actually the + // case + return tag( + "array", + x.value.map( + (arrayItem): squiggleExpression => + convertRawToTypescript( + arrayItem as unknown as rescriptExport, + environment + ) ) - ) - ); - case "EvArrayString": - return tag("arraystring", x.value); - case "EvBool": - return tag("boolean", x.value); - case "EvCall": - return tag("call", x.value); - case "EvLambda": - return tag("lambda", x.value); - case "EvDistribution": - return tag("distribution", new Distribution(x.value, environment)); - case "EvNumber": - return tag("number", x.value); - case "EvRecord": - // genType doesn't support records, so we have to do the raw conversion ourself - let result: tagged<"record", { [key: string]: squiggleExpression }> = tag( - "record", - _.mapValues(x.value, (x: unknown) => - convertRawToTypescript(x as rescriptExport, environment) - ) - ); - return result; - case "EvString": - return tag("string", x.value); - case "EvSymbol": - return tag("symbol", x.value); - case "EvDate": - return tag("date", x.value); - case "EvTimeDuration": - return tag("timeDuration", x.value); - case "EvDeclaration": - return tag("lambdaDeclaration", x.value); - case "EvTypeIdentifier": - return tag("typeIdentifier", x.value); - case "EvType": - let typeResult: tagged<"type", { [key: string]: squiggleExpression }> = - tag( - "type", - _.mapValues(x.value, (x: unknown) => - convertRawToTypescript(x as rescriptExport, environment) - ) - ); - return typeResult; - case "EvModule": - let moduleResult: tagged< - "module", - { [key: string]: squiggleExpression } - > = tag( - "module", - _.mapValues(x.value, (x: unknown) => - convertRawToTypescript(x as rescriptExport, environment) - ) - ); - return moduleResult; + ); + case "EvArrayString": + return tag("arraystring", x.value); + case "EvBool": + return tag("boolean", x.value); + case "EvCall": + return tag("call", x.value); + case "EvLambda": + return tag("lambda", x.value); + case "EvDistribution": + return tag("distribution", new Distribution(x.value, environment)); + case "EvNumber": + return tag("number", x.value); + case "EvRecord": + // genType doesn't support records, so we have to do the raw conversion ourself + let result: tagged<"record", { [key: string]: squiggleExpression }> = + tag( + "record", + _.mapValues(x.value, (x: unknown) => + convertRawToTypescript(x as rescriptExport, environment) + ) + ); + return result; + case "EvString": + return tag("string", x.value); + case "EvSymbol": + return tag("symbol", x.value); + case "EvDate": + return tag("date", x.value); + case "EvTimeDuration": + return tag("timeDuration", x.value); + case "EvDeclaration": + return tag("lambdaDeclaration", x.value); + case "EvTypeIdentifier": + return tag("typeIdentifier", x.value); + case "EvType": + let typeResult: tagged< + "type", + { [key: string]: squiggleExpression } + > = tag( + "type", + _.mapValues(x.value, (x: unknown) => + convertRawToTypescript(x as rescriptExport, environment) + ) + ); + return typeResult; + case "EvModule": + let moduleResult: tagged< + "module", + { [key: string]: squiggleExpression } + > = tag( + "module", + _.mapValues(x.value, (x: unknown) => + convertRawToTypescript(x as rescriptExport, environment) + ) + ); + return moduleResult; + } + } } } diff --git a/packages/squiggle-lang/src/js/rescript_interop.ts b/packages/squiggle-lang/src/js/rescript_interop.ts index dcba24e6..80548a7f 100644 --- a/packages/squiggle-lang/src/js/rescript_interop.ts +++ b/packages/squiggle-lang/src/js/rescript_interop.ts @@ -131,7 +131,8 @@ export type squiggleExpression = | tagged<"record", { [key: string]: squiggleExpression }> | tagged<"type", { [key: string]: squiggleExpression }> | tagged<"typeIdentifier", string> - | tagged<"module", { [key: string]: squiggleExpression }>; + | tagged<"module", { [key: string]: squiggleExpression }> + | tagged<"void", string>; export { lambdaValue }; From 590ffac5528ae00dba2dc6592350f9459a4bb72f Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Wed, 20 Jul 2022 09:28:32 -0700 Subject: [PATCH 056/203] Minor component fix to show Void statements --- packages/components/src/components/SquiggleItem.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/components/src/components/SquiggleItem.tsx b/packages/components/src/components/SquiggleItem.tsx index 48a8a0fb..52330e8b 100644 --- a/packages/components/src/components/SquiggleItem.tsx +++ b/packages/components/src/components/SquiggleItem.tsx @@ -200,6 +200,12 @@ export const SquiggleItem: React.FC = ({ {expression.value.toDateString()}
); + case "void": + return ( + + {"Void"} + + ); case "timeDuration": { return ( From 8d390c4433c7d1f827ae04317f88e1bb70b8882f Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Wed, 20 Jul 2022 23:16:34 +0400 Subject: [PATCH 057/203] local chart settings via dropdown menu --- .../src/components/SquiggleChart.tsx | 1 - .../SquiggleViewer/ExpressionViewer.tsx | 170 ++++++++++-------- .../SquiggleViewer/ItemSettingsMenu.tsx | 73 ++++++++ .../components/SquiggleViewer/VariableBox.tsx | 90 ++++++---- .../SquiggleViewer/ViewerContext.ts | 24 ++- .../src/components/SquiggleViewer/index.tsx | 44 +++-- .../src/components/SquiggleViewer/utils.ts | 16 +- .../src/components/ui/DropdownMenu.tsx | 75 ++++++++ .../components/src/components/ui/Tooltip.tsx | 8 +- 9 files changed, 369 insertions(+), 132 deletions(-) create mode 100644 packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx create mode 100644 packages/components/src/components/ui/DropdownMenu.tsx diff --git a/packages/components/src/components/SquiggleChart.tsx b/packages/components/src/components/SquiggleChart.tsx index f0adb496..7397cb7e 100644 --- a/packages/components/src/components/SquiggleChart.tsx +++ b/packages/components/src/components/SquiggleChart.tsx @@ -9,7 +9,6 @@ import { defaultEnvironment, } from "@quri/squiggle-lang"; import { useSquiggle } from "../lib/hooks"; -import { SquiggleErrorAlert } from "./SquiggleErrorAlert"; import { SquiggleViewer } from "./SquiggleViewer"; export interface SquiggleChartProps { diff --git a/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx b/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx index 54e35777..dae4a824 100644 --- a/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx +++ b/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx @@ -1,17 +1,11 @@ import React from "react"; -import { - squiggleExpression, - environment, - declaration, -} from "@quri/squiggle-lang"; +import { squiggleExpression, declaration } from "@quri/squiggle-lang"; import { NumberShower } from "../NumberShower"; -import { - DistributionChart, - DistributionPlottingSettings, -} from "../DistributionChart"; +import { DistributionChart } from "../DistributionChart"; import { FunctionChart, FunctionChartSettings } from "../FunctionChart"; import clsx from "clsx"; import { VariableBox } from "./VariableBox"; +import { ItemSettingsMenu } from "./ItemSettingsMenu"; function getRange
(x: declaration) { const first = x.args[0]; @@ -42,9 +36,11 @@ const VariableList: React.FC<{ children: React.ReactNode; }> = ({ path, heading, children }) => ( -
- {children} -
+ {() => ( +
+ {children} +
+ )}
); @@ -55,11 +51,6 @@ export interface Props { path: string[]; width?: number; height: number; - distributionPlotSettings: DistributionPlottingSettings; - /** Settings for displaying functions */ - chartSettings: FunctionChartSettings; - /** Environment for further function executions */ - environment: environment; } export const ExpressionViewer: React.FC = ({ @@ -67,17 +58,16 @@ export const ExpressionViewer: React.FC = ({ expression, width, height, - distributionPlotSettings, - chartSettings, - environment, }) => { switch (expression.tag) { case "number": return ( -
- -
+ {() => ( +
+ +
+ )}
); case "distribution": { @@ -88,95 +78,134 @@ export const ExpressionViewer: React.FC = ({ heading={`Distribution (${distType})\n${ distType === "Symbolic" ? expression.value.toString() : "" }`} + dropdownMenu={({ settings, setSettings }) => { + return ( + + ); + }} > - + {(settings) => { + return ( + + ); + }} ); } case "string": return ( - " - - {expression.value} - - " + {() => ( + <> + " + + {expression.value} + + " + + )} ); case "boolean": return ( - {expression.value.toString()} + {() => expression.value.toString()} ); case "symbol": return ( - Undefined Symbol: - {expression.value} + {() => ( + <> + Undefined Symbol: + {expression.value} + + )} ); case "call": return ( - {expression.value} + {() => expression.value} ); case "arraystring": return ( - {expression.value.map((r) => `"${r}"`).join(", ")} + {() => expression.value.map((r) => `"${r}"`).join(", ")} ); case "date": return ( - {expression.value.toDateString()} + {() => expression.value.toDateString()} ); case "timeDuration": { return ( - + {() => } ); } case "lambda": return ( - -
{`function(${expression.value.parameters.join( - "," - )})`}
- + { + return ( + + ); + }} + > + {(settings) => ( + <> +
{`function(${expression.value.parameters.join( + "," + )})`}
+ + + )}
); case "lambdaDeclaration": { return ( - - + { + return ( + + ); + }} + > + {(settings) => ( + + )} ); } @@ -192,9 +221,6 @@ export const ExpressionViewer: React.FC = ({ expression={r} width={width !== undefined ? width - 20 : width} height={height / 3} - distributionPlotSettings={distributionPlotSettings} - chartSettings={chartSettings} - environment={environment} /> ))} @@ -210,9 +236,6 @@ export const ExpressionViewer: React.FC = ({ expression={r} width={width !== undefined ? width - 20 : width} height={height / 3} - distributionPlotSettings={distributionPlotSettings} - chartSettings={chartSettings} - environment={environment} /> ))} @@ -227,9 +250,6 @@ export const ExpressionViewer: React.FC = ({ expression={r} width={width !== undefined ? width - 20 : width} height={50} - distributionPlotSettings={distributionPlotSettings} - chartSettings={chartSettings} - environment={environment} /> ))} diff --git a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx new file mode 100644 index 00000000..898d5fc1 --- /dev/null +++ b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx @@ -0,0 +1,73 @@ +import React from "react"; +import { DropdownMenu } from "../ui/DropdownMenu"; +import { LocalItemSettings } from "./utils"; + +type Props = { + settings: LocalItemSettings; + setSettings: (value: LocalItemSettings) => void; +}; + +export const ItemSettingsMenu: React.FC = ({ + settings, + setSettings, +}) => { + return ( +
+ + + setSettings({ + ...settings, + distributionPlotSettings: { + ...settings.distributionPlotSettings, + logX: !settings.distributionPlotSettings?.logX, + }, + }) + } + /> + + setSettings({ + ...settings, + distributionPlotSettings: { + ...settings.distributionPlotSettings, + expY: !settings.distributionPlotSettings?.expY, + }, + }) + } + /> + + setSettings({ + ...settings, + distributionPlotSettings: { + ...settings.distributionPlotSettings, + showSummary: !settings.distributionPlotSettings?.showSummary, + }, + }) + } + /> + + {settings.distributionPlotSettings || settings.chartSettings ? ( + + ) : null} +
+ ); +}; diff --git a/packages/components/src/components/SquiggleViewer/VariableBox.tsx b/packages/components/src/components/SquiggleViewer/VariableBox.tsx index eb362db0..84acb30d 100644 --- a/packages/components/src/components/SquiggleViewer/VariableBox.tsx +++ b/packages/components/src/components/SquiggleViewer/VariableBox.tsx @@ -1,61 +1,77 @@ -import React, { useContext, useState } from "react"; +import React, { useContext, useReducer } from "react"; import { Tooltip } from "../ui/Tooltip"; +import { LocalItemSettings, MergedItemSettings } from "./utils"; import { ViewerContext } from "./ViewerContext"; -interface VariableBoxProps { +type DropdownMenuParams = { + settings: LocalItemSettings; + setSettings: (value: LocalItemSettings) => void; +}; + +type VariableBoxProps = { path: string[]; heading: string; - children: React.ReactNode; -} + dropdownMenu?: (params: DropdownMenuParams) => React.ReactNode; + children: (settings: MergedItemSettings) => React.ReactNode; +}; export const VariableBox: React.FC = ({ path, heading = "Error", + dropdownMenu, children, }) => { - const { setSettings, getSettings } = useContext(ViewerContext); - const [isCollapsed, setIsCollapsed] = useState( - () => getSettings(path).collapsed - ); + const { setSettings, getSettings, getMergedSettings } = + useContext(ViewerContext); + const [_, forceUpdate] = useReducer((x) => x + 1, 0); + + const settings = getSettings(path); + + const setSettingsAndUpdate = (newSettings: LocalItemSettings) => { + setSettings(path, newSettings); + forceUpdate(); + }; const toggleCollapsed = () => { - setSettings(path, { - collapsed: !isCollapsed, - }); - setIsCollapsed(!isCollapsed); + setSettingsAndUpdate({ ...settings, collapsed: !settings.collapsed }); }; const isTopLevel = path.length === 0; - const name = isTopLevel ? "" : path[path.length - 1]; + const name = isTopLevel ? "Result" : path[path.length - 1]; return (
-
- {isTopLevel ? null : ( -
+ + - - {name}: - - {isCollapsed ? ( - ... - ) : null} -
- )} - {isCollapsed ? null : ( -
- {path.length ? ( -
- ) : null} -
{children}
-
- )} -
+ {name}: + + + {settings.collapsed ? ( + + ... + + ) : dropdownMenu ? ( + dropdownMenu({ settings, setSettings: setSettingsAndUpdate }) + ) : null} + + {settings.collapsed ? null : ( +
+ {path.length ? ( +
+ ) : null} +
{children(getMergedSettings(path))}
+
+ )}
); }; diff --git a/packages/components/src/components/SquiggleViewer/ViewerContext.ts b/packages/components/src/components/SquiggleViewer/ViewerContext.ts index 153383e7..c8b78b69 100644 --- a/packages/components/src/components/SquiggleViewer/ViewerContext.ts +++ b/packages/components/src/components/SquiggleViewer/ViewerContext.ts @@ -1,15 +1,33 @@ +import { defaultEnvironment } from "@quri/squiggle-lang"; import React from "react"; -import { ItemSettings, Path } from "./utils"; +import { LocalItemSettings, MergedItemSettings, Path } from "./utils"; type ViewerContextShape = { // Note that we don't store settings themselves in the context (that would cause rerenders of the entire tree on each settings update). // Instead, we keep settings in local state and notify the global context via setSettings to pass them down the component tree again if it got rebuilt from scratch. // See ./SquiggleViewer.tsx and ./VariableBox.tsx for other implementation details on this. - getSettings(path: Path): ItemSettings; - setSettings(path: Path, value: ItemSettings): void; + getSettings(path: Path): LocalItemSettings; + getMergedSettings(path: Path): MergedItemSettings; + setSettings(path: Path, value: LocalItemSettings): void; }; export const ViewerContext = React.createContext({ getSettings: () => ({ collapsed: false }), + getMergedSettings: () => ({ + collapsed: false, + // copy-pasted from SquiggleChart + chartSettings: { + start: 0, + stop: 10, + count: 100, + }, + distributionPlotSettings: { + showSummary: false, + showControls: false, + logX: false, + expY: false, + }, + environment: defaultEnvironment, + }), setSettings() {}, }); diff --git a/packages/components/src/components/SquiggleViewer/index.tsx b/packages/components/src/components/SquiggleViewer/index.tsx index 5969c9df..be4dcaab 100644 --- a/packages/components/src/components/SquiggleViewer/index.tsx +++ b/packages/components/src/components/SquiggleViewer/index.tsx @@ -4,7 +4,12 @@ import { DistributionPlottingSettings } from "../DistributionChart"; import { FunctionChartSettings } from "../FunctionChart"; import { ExpressionViewer } from "./ExpressionViewer"; import { ViewerContext } from "./ViewerContext"; -import { Path, pathAsString } from "./utils"; +import { + LocalItemSettings, + MergedItemSettings, + Path, + pathAsString, +} from "./utils"; import { useSquiggle } from "../../lib/hooks"; import { SquiggleErrorAlert } from "../SquiggleErrorAlert"; @@ -20,15 +25,11 @@ type Props = { environment: environment; }; -type ItemSettings = { - collapsed: boolean; -}; - type Settings = { - [k: string]: ItemSettings; + [k: string]: LocalItemSettings; }; -const defaultSettings: ItemSettings = { collapsed: false }; +const defaultSettings: LocalItemSettings = { collapsed: false }; export const SquiggleViewer: React.FC = ({ result, @@ -38,6 +39,7 @@ export const SquiggleViewer: React.FC = ({ chartSettings, environment, }) => { + // can't store settings in the state because we don't want to rerender the entire tree on every change const settingsRef = useRef({}); const getSettings = useCallback( @@ -48,17 +50,40 @@ export const SquiggleViewer: React.FC = ({ ); const setSettings = useCallback( - (path: Path, value: ItemSettings) => { + (path: Path, value: LocalItemSettings) => { settingsRef.current[pathAsString(path)] = value; }, [settingsRef] ); + const getMergedSettings = useCallback( + (path: Path) => { + const localSettings = getSettings(path); + const result: MergedItemSettings = { + distributionPlotSettings: { + ...distributionPlotSettings, + ...(localSettings.distributionPlotSettings || {}), + }, + chartSettings: { + ...chartSettings, + ...(localSettings.chartSettings || {}), + }, + environment: { + ...environment, + ...(localSettings.environment || {}), + }, + }; + return result; + }, + [distributionPlotSettings, chartSettings, environment, getSettings] + ); + return ( {result.tag === "Ok" ? ( @@ -67,9 +92,6 @@ export const SquiggleViewer: React.FC = ({ expression={result.value} width={width} height={height} - distributionPlotSettings={distributionPlotSettings} - chartSettings={chartSettings} - environment={environment} /> ) : ( diff --git a/packages/components/src/components/SquiggleViewer/utils.ts b/packages/components/src/components/SquiggleViewer/utils.ts index 29648079..979d0cec 100644 --- a/packages/components/src/components/SquiggleViewer/utils.ts +++ b/packages/components/src/components/SquiggleViewer/utils.ts @@ -1,6 +1,20 @@ -export type ItemSettings = { +import { DistributionPlottingSettings } from "../DistributionChart"; +import { FunctionChartSettings } from "../FunctionChart"; +import { environment } from "@quri/squiggle-lang"; + +export type LocalItemSettings = { collapsed: boolean; + distributionPlotSettings?: Partial; + chartSettings?: Partial; + environment?: Partial; }; + +export type MergedItemSettings = { + distributionPlotSettings: DistributionPlottingSettings; + chartSettings: FunctionChartSettings; + environment: environment; +}; + export type Path = string[]; export const pathAsString = (path: Path) => path.join("."); diff --git a/packages/components/src/components/ui/DropdownMenu.tsx b/packages/components/src/components/ui/DropdownMenu.tsx new file mode 100644 index 00000000..798741c3 --- /dev/null +++ b/packages/components/src/components/ui/DropdownMenu.tsx @@ -0,0 +1,75 @@ +import { CheckIcon, CogIcon } from "@heroicons/react/solid"; +import React, { useState } from "react"; +import { + shift, + useClick, + useDismiss, + useFloating, + useInteractions, + useRole, +} from "@floating-ui/react-dom-interactions"; + +type Props = { + children: React.ReactNode; +}; + +type DropdownMenuType = React.FC & { + CheckboxItem: React.FC<{ label: string; value: boolean; toggle: () => void }>; +}; + +export const DropdownMenu: DropdownMenuType = ({ children }) => { + const [isOpen, setIsOpen] = useState(false); + const { x, y, reference, floating, strategy, context } = useFloating({ + placement: "bottom-start", + open: isOpen, + onOpenChange: setIsOpen, + middleware: [shift()], + }); + + const { getReferenceProps, getFloatingProps } = useInteractions([ + useClick(context), + useRole(context, { role: "menu" }), + useDismiss(context), + ]); + + return ( +
+ setIsOpen(!isOpen)} + {...getReferenceProps({ ref: reference })} + /> + {isOpen ? ( +
+ {children} +
+ ) : null} +
+ ); +}; + +DropdownMenu.CheckboxItem = ({ label, value, toggle }) => { + return ( +
+ {value ? ( + + ) : ( +
+ )} + {label} +
+ ); +}; diff --git a/packages/components/src/components/ui/Tooltip.tsx b/packages/components/src/components/ui/Tooltip.tsx index 714f8861..60a4ef12 100644 --- a/packages/components/src/components/ui/Tooltip.tsx +++ b/packages/components/src/components/ui/Tooltip.tsx @@ -15,12 +15,12 @@ interface Props { } export const Tooltip: React.FC = ({ text, children }) => { - const [open, setOpen] = useState(false); + const [isOpen, setIsOpen] = useState(false); const { x, y, reference, floating, strategy, context } = useFloating({ placement: "top", - open, - onOpenChange: setOpen, + open: isOpen, + onOpenChange: setIsOpen, middleware: [shift()], }); @@ -37,7 +37,7 @@ export const Tooltip: React.FC = ({ text, children }) => { getReferenceProps({ ref: reference, ...children.props }) )} - {open && ( + {isOpen && ( Date: Wed, 20 Jul 2022 23:47:59 +0000 Subject: [PATCH 058/203] :arrow_up: Bump terser from 4.8.0 to 4.8.1 Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/commits) --- updated-dependencies: - dependency-name: terser dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index fd243efb..a61e16f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17115,9 +17115,9 @@ terser-webpack-plugin@^5.0.3, terser-webpack-plugin@^5.1.3, terser-webpack-plugi terser "^5.7.2" terser@^4.1.2, terser@^4.6.3: - version "4.8.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" - integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== + version "4.8.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" + integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== dependencies: commander "^2.20.0" source-map "~0.6.1" From d3a12eb4e996f745f42fe6efe948bc6b9fddaafc Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 08:31:46 -0700 Subject: [PATCH 059/203] Fixed bug with namespaces --- .../Reducer_Dispatch_BuiltIn_test.res | 8 -------- ...uiggleLibrary_FunctionRegistryLibrary_test.res | 10 ++++++++++ packages/squiggle-lang/package.json | 2 +- .../FunctionRegistry/FunctionRegistry_Core.res | 15 ++++++--------- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res index a4cc15b3..f3c92f78 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res @@ -17,14 +17,6 @@ describe("builtin", () => { testEval("1-1", "Ok(0)") testEval("2>1", "Ok(true)") testEval("concat('a','b')", "Ok('ab')") - testEval( - "addOne(t)=t+1; toList(Sampleset.map(fromSamples([1,2,3,4,5,6]), addOne))", - "Ok([2,3,4,5,6,7])", - ) - testEval( - "toList(mapSamplesN([fromSamples([1,2,3,4,5,6]), fromSamples([6, 5, 4, 3, 2, 1])], {|x| x[0] > x[1] ? x[0] : x[1]}))", - "Ok([6,5,4,4,5,6])", - ) }) describe("builtin exception", () => { diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res index 1dcf0471..7a1564f7 100644 --- a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -17,6 +17,7 @@ describe("FunctionRegistry Library", () => { testEvalToBe("List.last([3,5,8])", "Ok(8)") testEvalToBe("List.reverse([3,5,8])", "Ok([8,5,3])") testEvalToBe("double(x)=2*x; arr=[1,2,3]; List.map(arr, double)", "Ok([2,4,6])") + testEvalToBe("double(x)=2*x; arr=[1,2,3]; map(arr, double)", "Ok([2,4,6])") testEvalToBe("myadd(acc,x)=acc+x; arr=[1,2,3]; List.reduce(arr, 0, myadd)", "Ok(6)") testEvalToBe("change(acc,x)=acc*x+x; arr=[1,2,3]; List.reduce(arr, 0, change)", "Ok(15)") testEvalToBe("change(acc,x)=acc*x+x; arr=[1,2,3]; List.reduceReverse(arr, 0, change)", "Ok(9)") @@ -60,6 +61,15 @@ describe("FunctionRegistry Library", () => { testEvalToBe("Dist.logScore({estimate: normal(5,2), answer: 4.5})", "Ok(1.6433360626394853)") testEvalToBe("Dist.klDivergence(normal(5,2), normal(5,1.5))", "Ok(0.06874342818671068)") 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( + "addOne(t)=t+1; Sampleset.toList(Sampleset.map(Sampleset.fromList([1,2,3,4,5,6]), addOne))", + "Ok([2,3,4,5,6,7])", + ) + testEvalToBe( + "toList(Sampleset.mapN([Sampleset.fromList([1,2,3,4,5,6]), Sampleset.fromList([6, 5, 4, 3, 2, 1])], {|x| x[0] > x[1] ? x[0] : x[1]}))", + "Ok([6,5,4,4,5,6])", + ) }) describe("Fn auto-testing", () => { diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 3dd90839..52c9f07c 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -15,9 +15,9 @@ "start": "rescript build -w -with-deps", "clean": "rescript clean && rm -rf dist", "test:reducer": "jest __tests__/Reducer*/", - "test:current": "jest __tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.bs.js", "benchmark": "ts-node benchmark/conversion_tests.ts", "test": "jest", + "test:lib": "jest __tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.bs.js", "test:ts": "jest __tests__/TS/", "test:rescript": "jest --modulePathIgnorePatterns=__tests__/TS/*", "test:watch": "jest --watchAll", diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index f1dde98b..f4864531 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -280,11 +280,11 @@ module Matcher = { module RegistryMatch = { type match = { - namespace: option, + namespace: string, fnName: string, inputIndex: int, } - let makeMatch = (namespace: option, fnName: string, inputIndex: int) => { + let makeMatch = (namespace: string, fnName: string, inputIndex: int) => { namespace: namespace, fnName: fnName, inputIndex: inputIndex, @@ -303,7 +303,7 @@ module Matcher = { let fullMatch = functionMatchPairs->E.A.getBy(((_, match)) => Match.isFullMatch(match)) fullMatch->E.O.bind(((fn, match)) => switch match { - | FullMatch(index) => Some(RegistryMatch.makeMatch(namespace, fn.name, index)) + | FullMatch(index) => Some(RegistryMatch.makeMatch(fn.nameSpace, fn.name, index)) | _ => None } ) @@ -326,7 +326,7 @@ module Matcher = { ->E.A2.fmap(((fn, match)) => switch match { | SameNameDifferentArguments(indexes) => - indexes->E.A2.fmap(index => RegistryMatch.makeMatch(namespace, fn.name, index)) + indexes->E.A2.fmap(index => RegistryMatch.makeMatch(fn.nameSpace, fn.name, index)) | _ => [] } ) @@ -355,10 +355,7 @@ module Matcher = { ): option => registry.functions ->E.A.getBy(fn => { - switch namespace { - | Some(ns) => ns === fn.nameSpace && fnName === fn.name - | _ => fnName === fn.name - } + namespace === fn.nameSpace && fnName === fn.name }) ->E.O.bind(fn => E.A.get(fn.definitions, inputIndex)) } @@ -511,7 +508,7 @@ module Registry = { `There are function matches for ${fnName}(), but with different arguments: ${defs}` } - let match = Matcher.Registry.findMatches(modified, fnName, args) + // let match = Matcher.Registry.findMatches(modified, fnName, args); Js.log2("Match", match) switch Matcher.Registry.findMatches(modified, fnName, args) { | Matcher.Match.FullMatch(match) => From 223ddf6a3e7f9518a9b9102ef7808eb6823507f8 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 08:54:41 -0700 Subject: [PATCH 060/203] Fixed bug with namespaces --- ...leLibrary_FunctionRegistryLibrary_test.res | 8 +- .../FunctionRegistry/Library/FR_Pointset.res | 96 +++++++++---------- .../FunctionRegistry/Library/FR_Sampleset.res | 16 ++-- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res index 7a1564f7..da357653 100644 --- a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -60,14 +60,14 @@ describe("FunctionRegistry Library", () => { ) testEvalToBe("Dist.logScore({estimate: normal(5,2), answer: 4.5})", "Ok(1.6433360626394853)") testEvalToBe("Dist.klDivergence(normal(5,2), normal(5,1.5))", "Ok(0.06874342818671068)") - 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.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( - "addOne(t)=t+1; Sampleset.toList(Sampleset.map(Sampleset.fromList([1,2,3,4,5,6]), addOne))", + "addOne(t)=t+1; SampleSet.toList(SampleSet.map(SampleSet.fromList([1,2,3,4,5,6]), addOne))", "Ok([2,3,4,5,6,7])", ) testEvalToBe( - "toList(Sampleset.mapN([Sampleset.fromList([1,2,3,4,5,6]), Sampleset.fromList([6, 5, 4, 3, 2, 1])], {|x| x[0] > x[1] ? x[0] : x[1]}))", + "toList(SampleSet.mapN([SampleSet.fromList([1,2,3,4,5,6]), SampleSet.fromList([6, 5, 4, 3, 2, 1])], {|x| x[0] > x[1] ? x[0] : x[1]}))", "Ok([6,5,4,4,5,6])", ) }) 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 1a4569f4..4f4e1731 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -1,7 +1,7 @@ open FunctionRegistry_Core open FunctionRegistry_Helpers -let nameSpace = "Pointset" +let nameSpace = "PointSet" let requiresNamespace = true let inputsTodist = (inputs: array, makeDist) => { @@ -24,57 +24,11 @@ let inputsTodist = (inputs: array, makeDist) => { } let library = [ - Function.make( - ~name="makeContinuous", - ~nameSpace, - ~requiresNamespace, - ~examples=[ - `Pointset.makeContinuous([ - {x: 0, y: 0.2}, - {x: 1, y: 0.7}, - {x: 2, y: 0.8}, - {x: 3, y: 0.2} - ])`, - ], - ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, - ~definitions=[ - FnDefinition.make( - ~name="makeContinuous", - ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(_, inputs, _, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), - (), - ), - ], - (), - ), - Function.make( - ~name="makeDiscrete", - ~nameSpace, - ~requiresNamespace, - ~examples=[ - `Pointset.makeDiscrete([ - {x: 0, y: 0.2}, - {x: 1, y: 0.7}, - {x: 2, y: 0.8}, - {x: 3, y: 0.2} - ])`, - ], - ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, - ~definitions=[ - FnDefinition.make( - ~name="makeDiscrete", - ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(_, inputs, _, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), - (), - ), - ], - (), - ), Function.make( ~name="fromDist", ~nameSpace, ~requiresNamespace=true, - ~examples=[`Pointset.fromDist(normal(5,2))`], + ~examples=[`PointSet.fromDist(normal(5,2))`], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( @@ -99,4 +53,50 @@ let library = [ ], (), ), + Function.make( + ~name="makeContinuous", + ~nameSpace, + ~requiresNamespace, + ~examples=[ + `PointSet.makeContinuous([ + {x: 0, y: 0.2}, + {x: 1, y: 0.7}, + {x: 2, y: 0.8}, + {x: 3, y: 0.2} + ])`, + ], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="makeContinuous", + ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], + ~run=(_, inputs, _, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + (), + ), + ], + (), + ), + Function.make( + ~name="makeDiscrete", + ~nameSpace, + ~requiresNamespace, + ~examples=[ + `PointSet.makeDiscrete([ + {x: 0, y: 0.2}, + {x: 1, y: 0.7}, + {x: 2, y: 0.8}, + {x: 3, y: 0.2} + ])`, + ], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="makeDiscrete", + ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], + ~run=(_, inputs, _, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + (), + ), + ], + (), + ), ] 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 85497f8d..a13ff46c 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -1,7 +1,7 @@ open FunctionRegistry_Core open FunctionRegistry_Helpers -let nameSpace = "Sampleset" +let nameSpace = "SampleSet" let requiresNamespace = true module Internal = { @@ -69,7 +69,7 @@ let library = [ ~name="fromDist", ~nameSpace, ~requiresNamespace=true, - ~examples=[`Sampleset.fromDist(normal(5,2))`], + ~examples=[`SampleSet.fromDist(normal(5,2))`], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( @@ -93,7 +93,7 @@ let library = [ ~name="fromList", ~nameSpace, ~requiresNamespace=true, - ~examples=[`Sampleset.fromList([3,5,2,3,5,2,3,5,2,3,3,5,3,2,3,1,1,3])`], + ~examples=[`SampleSet.fromList([3,5,2,3,5,2,3,5,2,3,3,5,3,2,3,1,1,3])`], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( @@ -115,7 +115,7 @@ let library = [ ~name="toList", ~nameSpace, ~requiresNamespace=false, - ~examples=[`Sampleset.toList(Sampleset.fromDist(normal(5,2)))`], + ~examples=[`SampleSet.toList(SampleSet.fromDist(normal(5,2)))`], ~output=ReducerInterface_InternalExpressionValue.EvtArray, ~definitions=[ FnDefinition.make( @@ -136,7 +136,7 @@ let library = [ ~name="map", ~nameSpace, ~requiresNamespace, - ~examples=[`Sampleset.map(Sampleset.fromDist(normal(5,2)), {|x| x + 1})`], + ~examples=[`SampleSet.map(SampleSet.fromDist(normal(5,2)), {|x| x + 1})`], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( @@ -158,7 +158,7 @@ let library = [ ~nameSpace, ~requiresNamespace, ~examples=[ - `Sampleset.map2(Sampleset.fromDist(normal(5,2)), Sampleset.fromDist(normal(5,2)), {|x, y| x + y})`, + `SampleSet.map2(SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(5,2)), {|x, y| x + y})`, ], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ @@ -186,7 +186,7 @@ let library = [ ~nameSpace, ~requiresNamespace, ~examples=[ - `Sampleset.map3(Sampleset.fromDist(normal(5,2)), Sampleset.fromDist(normal(5,2)), Sampleset.fromDist(normal(5,2)), {|x, y, z| max([x,y,z])})`, + `SampleSet.map3(SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(5,2)), {|x, y, z| max([x,y,z])})`, ], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ @@ -214,7 +214,7 @@ let library = [ ~nameSpace, ~requiresNamespace, ~examples=[ - `Sampleset.mapN([Sampleset.fromDist(normal(5,2)), Sampleset.fromDist(normal(5,2)), Sampleset.fromDist(normal(5,2))], {|x| max(x)})`, + `SampleSet.mapN([SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(5,2)), SampleSet.fromDist(normal(5,2))], {|x| max(x)})`, ], ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ From acebaa517b5aed232040b092ef37708b3563199d Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 10:31:53 -0700 Subject: [PATCH 061/203] Simple SampleSet.fromDist function --- ...leLibrary_FunctionRegistryLibrary_test.res | 1 + .../FunctionRegistry/Library/FR_Sampleset.res | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res index da357653..a7e98163 100644 --- a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -62,6 +62,7 @@ describe("FunctionRegistry Library", () => { testEvalToBe("Dist.klDivergence(normal(5,2), normal(5,1.5))", "Ok(0.06874342818671068)") 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( "addOne(t)=t+1; SampleSet.toList(SampleSet.map(SampleSet.fromList([1,2,3,4,5,6]), addOne))", "Ok([2,3,4,5,6,7])", 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 a13ff46c..b2927b82 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -21,6 +21,17 @@ module Internal = { | Error(r) => Error(REDistributionError(SampleSetError(r))) } + //TODO: I don't know why this seems to need at least one input + let fromFn = ( + aLambdaValue, + env: ReducerInterface_InternalExpressionValue.environment, + reducer, + ) => { + let sampleCount = env.sampleCount + let fn = (r) => doLambdaCall(aLambdaValue, list{IEvNumber(r)}, env, reducer) + Belt_Array.makeBy(sampleCount, (r) => fn(r->Js.Int.toFloat))->E.A.R.firstErrorOrOpen + } + let map1 = (sampleSetDist: t, aLambdaValue, env, reducer) => { let fn = r => doLambdaCall(aLambdaValue, list{IEvNumber(r)}, env, reducer) SampleSetDist.samplesMap(~fn, sampleSetDist)->toType @@ -132,6 +143,30 @@ let library = [ ], (), ), + Function.make( + ~name="fromFn", + ~nameSpace, + ~requiresNamespace=false, + ~examples=[`SampleSet.fromFn(sample(normal(5,2)))`], + ~output=ReducerInterface_InternalExpressionValue.EvtArray, + ~definitions=[ + FnDefinition.make( + ~name="fromFn", + ~inputs=[FRTypeLambda], + ~run=(inputs, _, env, reducer) => + switch inputs { + | [IEvLambda(lambda)] => + switch Internal.fromFn(lambda, env, reducer) { + | Ok(r) => Ok(r->Wrappers.sampleSet->Wrappers.evDistribution) + | Error(_) => Error("issue") + } + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), Function.make( ~name="map", ~nameSpace, From 47f1be07020312b6e0db28e002feec7e31df38b9 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 11:29:59 -0700 Subject: [PATCH 062/203] Story cleanup --- ...leLibrary_FunctionRegistryLibrary_test.res | 2 +- packages/squiggle-lang/package.json | 2 +- .../FunctionRegistry_Core.res | 28 +++++++++---------- .../FunctionRegistry/Library/FR_Dict.res | 2 +- .../FunctionRegistry/Library/FR_Sampleset.res | 12 ++++---- .../Reducer_Dispatch_BuiltIn.res | 1 - .../ReducerInterface_GenericDistribution.res | 13 --------- packages/website/docs/Api/DistSampleSet.md | 13 +++++---- 8 files changed, 30 insertions(+), 43 deletions(-) diff --git a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res index a7e98163..2418b4d8 100644 --- a/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res +++ b/packages/squiggle-lang/__tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.res @@ -68,7 +68,7 @@ describe("FunctionRegistry Library", () => { "Ok([2,3,4,5,6,7])", ) testEvalToBe( - "toList(SampleSet.mapN([SampleSet.fromList([1,2,3,4,5,6]), SampleSet.fromList([6, 5, 4, 3, 2, 1])], {|x| x[0] > x[1] ? x[0] : x[1]}))", + "SampleSet.toList(SampleSet.mapN([SampleSet.fromList([1,2,3,4,5,6]), SampleSet.fromList([6, 5, 4, 3, 2, 1])], {|x| x[0] > x[1] ? x[0] : x[1]}))", "Ok([6,5,4,4,5,6])", ) }) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 52c9f07c..e12b363c 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -17,10 +17,10 @@ "test:reducer": "jest __tests__/Reducer*/", "benchmark": "ts-node benchmark/conversion_tests.ts", "test": "jest", - "test:lib": "jest __tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.bs.js", "test:ts": "jest __tests__/TS/", "test:rescript": "jest --modulePathIgnorePatterns=__tests__/TS/*", "test:watch": "jest --watchAll", + "test:fnRegistry": "jest __tests__/SquiggleLibrary/SquiggleLibrary_FunctionRegistryLibrary_test.bs.js", "coverage:rescript": "rm -f *.coverage && yarn clean && BISECT_ENABLE=yes yarn build && yarn test:rescript && bisect-ppx-report html", "coverage:ts": "yarn clean && yarn build && nyc --reporter=lcov yarn test:ts", "coverage:rescript:ci": "yarn clean && BISECT_ENABLE=yes yarn build:rescript && yarn test:rescript && bisect-ppx-report send-to Codecov", diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index f4864531..4b27c221 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -170,7 +170,6 @@ module FRType = { inputs: array, args: array, ): option> => { - // Js.log3("Matching", inputs, args) let isSameLength = E.A.length(inputs) == E.A.length(args) if !isSameLength { None @@ -186,6 +185,9 @@ module FRType = { This module, Matcher, is fairly lengthy. However, only two functions from it are meant to be used outside of it. These are findMatches and matchToDef in Matches.Registry. The rest of it is just called from those two functions. + + Update: This really should be completely re-done sometime, and tested. It works, but it's pretty messy. I'm sure + there are internal bugs, but the end functionality works, so I'm not too worried. */ module Matcher = { module MatchSimple = { @@ -243,11 +245,11 @@ module Matcher = { let match = ( f: function, - namespace: option, + nameSpace: option, fnName: string, args: array, ): match => { - switch namespace { + switch nameSpace { | Some(ns) if ns !== f.nameSpace => Match.DifferentName | _ => { let matchedDefinition = () => @@ -280,12 +282,12 @@ module Matcher = { module RegistryMatch = { type match = { - namespace: string, + nameSpace: string, fnName: string, inputIndex: int, } - let makeMatch = (namespace: string, fnName: string, inputIndex: int) => { - namespace: namespace, + let makeMatch = (nameSpace: string, fnName: string, inputIndex: int) => { + nameSpace: nameSpace, fnName: fnName, inputIndex: inputIndex, } @@ -294,12 +296,12 @@ module Matcher = { module Registry = { let _findExactMatches = ( r: registry, - namespace: option, + nameSpace: option, fnName: string, args: array, ) => { let functionMatchPairs = - r.functions->E.A2.fmap(l => (l, Function.match(l, namespace, fnName, args))) + r.functions->E.A2.fmap(l => (l, Function.match(l, nameSpace, fnName, args))) let fullMatch = functionMatchPairs->E.A.getBy(((_, match)) => Match.isFullMatch(match)) fullMatch->E.O.bind(((fn, match)) => switch match { @@ -311,12 +313,12 @@ module Matcher = { let _findNameMatches = ( r: registry, - namespace: option, + nameSpace: option, fnName: string, args: array, ) => { let functionMatchPairs = - r.functions->E.A2.fmap(l => (l, Function.match(l, namespace, fnName, args))) + r.functions->E.A2.fmap(l => (l, Function.match(l, nameSpace, fnName, args))) let getNameMatches = functionMatchPairs ->E.A2.fmap(((fn, match)) => Match.isNameMatchOnly(match) ? Some((fn, match)) : None) @@ -351,11 +353,11 @@ module Matcher = { let matchToDef = ( registry: registry, - {namespace, fnName, inputIndex}: RegistryMatch.match, + {nameSpace, fnName, inputIndex}: RegistryMatch.match, ): option => registry.functions ->E.A.getBy(fn => { - namespace === fn.nameSpace && fnName === fn.name + nameSpace === fn.nameSpace && fnName === fn.name }) ->E.O.bind(fn => E.A.get(fn.definitions, inputIndex)) } @@ -508,8 +510,6 @@ module Registry = { `There are function matches for ${fnName}(), but with different arguments: ${defs}` } - // let match = Matcher.Registry.findMatches(modified, fnName, args); Js.log2("Match", match) - switch Matcher.Registry.findMatches(modified, fnName, args) { | Matcher.Match.FullMatch(match) => match->matchToDef->E.O2.fmap(FnDefinition.run(_, args, env, reducer)) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res index 10e84f92..0c85bbe1 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Dict.res @@ -156,7 +156,7 @@ let library = [ FnDefinition.make( ~name="fromList", ~inputs=[FRTypeArray(FRTypeArray(FRTypeAny))], - ~run=(inputs, _, _, _) =>{ + ~run=(inputs, _, _, _) => { switch inputs { | [IEvArray(items)] => Internals.fromList(items) | _ => 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 b2927b82..9995c3ef 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -28,8 +28,8 @@ module Internal = { reducer, ) => { let sampleCount = env.sampleCount - let fn = (r) => doLambdaCall(aLambdaValue, list{IEvNumber(r)}, env, reducer) - Belt_Array.makeBy(sampleCount, (r) => fn(r->Js.Int.toFloat))->E.A.R.firstErrorOrOpen + let fn = r => doLambdaCall(aLambdaValue, list{IEvNumber(r)}, env, reducer) + Belt_Array.makeBy(sampleCount, r => fn(r->Js.Int.toFloat))->E.A.R.firstErrorOrOpen } let map1 = (sampleSetDist: t, aLambdaValue, env, reducer) => { @@ -125,7 +125,7 @@ let library = [ Function.make( ~name="toList", ~nameSpace, - ~requiresNamespace=false, + ~requiresNamespace=true, ~examples=[`SampleSet.toList(SampleSet.fromDist(normal(5,2)))`], ~output=ReducerInterface_InternalExpressionValue.EvtArray, ~definitions=[ @@ -146,9 +146,9 @@ let library = [ Function.make( ~name="fromFn", ~nameSpace, - ~requiresNamespace=false, - ~examples=[`SampleSet.fromFn(sample(normal(5,2)))`], - ~output=ReducerInterface_InternalExpressionValue.EvtArray, + ~requiresNamespace=true, + ~examples=[`SampleSet.fromFn({|| sample(normal(5,2))})`], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, ~definitions=[ FnDefinition.make( ~name="fromFn", diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index a2e66298..dbec93c1 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -96,7 +96,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce let doExportBindings = (bindings: nameSpace) => bindings->Bindings.toExpressionValue->Ok module SampleMap = { - type t = SampleSetDist.t let doLambdaCall = (aLambdaValue, list) => switch Lambda.doLambdaCall(aLambdaValue, list, environment, reducer) { | Ok(IEvNumber(f)) => Ok(f) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res index a65edf2f..addd4388 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res @@ -233,19 +233,6 @@ let dispatchToGenericOutput = (call: IEV.functionCall, env: GenericDist.env): op | ("inv", [IEvDistribution(dist), IEvNumber(float)]) => Helpers.toFloatFn(#Inv(float), dist, ~env) | ("quantile", [IEvDistribution(dist), IEvNumber(float)]) => Helpers.toFloatFn(#Inv(float), dist, ~env) - | ("toSampleSet", [IEvDistribution(dist), IEvNumber(float)]) => - Helpers.toDistFn(ToSampleSet(Belt.Int.fromFloat(float)), dist, ~env) - | ("toSampleSet", [IEvDistribution(dist)]) => - Helpers.toDistFn(ToSampleSet(env.sampleCount), dist, ~env) - | ("toList", [IEvDistribution(SampleSet(dist))]) => Some(FloatArray(SampleSetDist.T.get(dist))) - | ("fromSamples", [IEvArray(inputArray)]) => { - let _wrapInputErrors = x => SampleSetDist.NonNumericInput(x) - let parsedArray = Helpers.parseNumberArray(inputArray)->E.R2.errMap(_wrapInputErrors) - switch parsedArray { - | Ok(array) => DistributionOperation.run(FromSamples(array), ~env) - | Error(e) => GenDistError(SampleSetError(e)) - }->Some - } | ("inspect", [IEvDistribution(dist)]) => Helpers.toDistFn(Inspect, dist, ~env) | ("truncateLeft", [IEvDistribution(dist), IEvNumber(float)]) => Helpers.toDistFn(Truncate(Some(float), None), dist, ~env) diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md index 2796a778..68e2e7a8 100644 --- a/packages/website/docs/Api/DistSampleSet.md +++ b/packages/website/docs/Api/DistSampleSet.md @@ -3,10 +3,6 @@ sidebar_position: 5 title: Sample Set Distribution --- -:::danger -These functions aren't yet implemented with these specific names. This should be added soon. -::: - Sample set distributions are one of the three distribution formats. Internally, they are stored as a list of numbers. It's useful to distinguish point set distributions from arbitrary lists of numbers to make it clear which functions are applicable. Monte Carlo calculations typically result in sample set distributions. @@ -25,9 +21,8 @@ Sampleset.fromList: (list) => sampleSet ### fromFn -(Not yet implemented) ``` -Sampleset.fromFn: (() => number) => sampleSet +Sampleset.fromFn: ((float) => number) => sampleSet ``` ### toList @@ -61,3 +56,9 @@ Sampleset.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSe ``` Sampleset.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet ``` + +### mapN + +``` +Sampleset.mapN: (list, (list => number)) => sampleSet +``` \ No newline at end of file From 0a806b4fe216ee1caff413397c9f395a1a6a2cef Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 11:41:32 -0700 Subject: [PATCH 063/203] Website lint --- packages/website/docs/Api/DistGeneric.mdx | 8 ++++++-- packages/website/docs/Api/DistSampleSet.md | 6 ++++-- packages/website/docs/Api/Function.md | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx index e15f3477..247bb4b8 100644 --- a/packages/website/docs/Api/DistGeneric.mdx +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -377,7 +377,11 @@ logScore: ({estimate: distribution, ?prior: distribution, answer: distribution|n **Examples** ```javascript -Dist.logScore({estimate: normal(5, 2), answer: normal(4.5, 1.2), prior: normal(6,4)}); // returns -0.597.57 +Dist.logScore({ + estimate: normal(5, 2), + answer: normal(4.5, 1.2), + prior: normal(6, 4), +}); // returns -0.597.57 ``` ## Display @@ -621,4 +625,4 @@ dotPow: (distributionLike, distributionLike) => distribution ``` dotExp: (distributionLike, distributionLike) => distribution -``` \ No newline at end of file +``` diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md index 68e2e7a8..4da7fee5 100644 --- a/packages/website/docs/Api/DistSampleSet.md +++ b/packages/website/docs/Api/DistSampleSet.md @@ -10,16 +10,18 @@ Monte Carlo calculations typically result in sample set distributions. All regular distribution function work on sample set distributions. In addition, there are several functions that only work on sample set distributions. ### fromDist + ``` Sampleset.fromDist: (list) => sampleSet ``` ### fromList + ``` Sampleset.fromList: (list) => sampleSet ``` -### fromFn +### fromFn ``` Sampleset.fromFn: ((float) => number) => sampleSet @@ -61,4 +63,4 @@ Sampleset.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => n ``` Sampleset.mapN: (list, (list => number)) => sampleSet -``` \ No newline at end of file +``` diff --git a/packages/website/docs/Api/Function.md b/packages/website/docs/Api/Function.md index b1c53ea3..1c08bb8f 100644 --- a/packages/website/docs/Api/Function.md +++ b/packages/website/docs/Api/Function.md @@ -7,7 +7,7 @@ title: Function Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making formal predictions. It allows you to limit the domain that your prediction will be used and scored within. -The one function that declarations currently have is that they impact plotting. If you ``declare`` a single-variable function within a specific range, this specific range will be plotted. +The one function that declarations currently have is that they impact plotting. If you `declare` a single-variable function within a specific range, this specific range will be plotted. Declarations are currently experimental and will likely be removed or changed in the future. @@ -24,4 +24,4 @@ Function.declare({ {min: 30, max: 100} ] }) -``` \ No newline at end of file +``` From 8dd7aff77fc8405fb1cda511115c18206a48daf7 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 13:48:51 -0700 Subject: [PATCH 064/203] Simple version number --- .../src/rescript/SquiggleLibrary/Versions.res | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 packages/squiggle-lang/src/rescript/SquiggleLibrary/Versions.res diff --git a/packages/squiggle-lang/src/rescript/SquiggleLibrary/Versions.res b/packages/squiggle-lang/src/rescript/SquiggleLibrary/Versions.res new file mode 100644 index 00000000..6554ca4d --- /dev/null +++ b/packages/squiggle-lang/src/rescript/SquiggleLibrary/Versions.res @@ -0,0 +1,9 @@ +module Bindings = Reducer_Bindings + +let bindings: Bindings.t = + [ + ("System.version", ReducerInterface_InternalExpressionValue.IEvString("0.2.11")), + ]->Bindings.fromArray + +let makeBindings = (previousBindings: Bindings.t): Bindings.t => + previousBindings->Bindings.merge(bindings) From 0d4141a899fd4ba87435d53f80acf85089316917 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 13:51:14 -0700 Subject: [PATCH 065/203] Simple refactors to versioning --- .../src/rescript/ReducerInterface/ReducerInterface_StdLib.res | 2 +- .../{Versions.res => SquiggleLibrary_Versions.res} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/squiggle-lang/src/rescript/SquiggleLibrary/{Versions.res => SquiggleLibrary_Versions.res} (100%) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res index 5c1a9c30..6c133332 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res @@ -1,6 +1,6 @@ module Bindings = Reducer_Bindings -let internalStdLib = Bindings.emptyBindings->SquiggleLibrary_Math.makeBindings +let internalStdLib = Bindings.emptyBindings->SquiggleLibrary_Math.makeBindings->SquiggleLibrary_Versions.makeBindings @genType let externalStdLib = internalStdLib->Bindings.toTypeScriptBindings diff --git a/packages/squiggle-lang/src/rescript/SquiggleLibrary/Versions.res b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res similarity index 100% rename from packages/squiggle-lang/src/rescript/SquiggleLibrary/Versions.res rename to packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res From 3165e1e499bfbcfbd59d1bcfc12a5e75f69c90cd Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 13:57:11 -0700 Subject: [PATCH 066/203] Updated version --- .../src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res index 6554ca4d..55d1e5b7 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.2.11")), + ("System.version", ReducerInterface_InternalExpressionValue.IEvString("0.2.12")), ]->Bindings.fromArray let makeBindings = (previousBindings: Bindings.t): Bindings.t => From 57782aa2a623412e450dfd1596221be13ffb19e2 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 14:59:36 -0700 Subject: [PATCH 067/203] Update DistSampleSet.md --- packages/website/docs/Api/DistSampleSet.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md index 4da7fee5..cfde2be9 100644 --- a/packages/website/docs/Api/DistSampleSet.md +++ b/packages/website/docs/Api/DistSampleSet.md @@ -12,25 +12,25 @@ All regular distribution function work on sample set distributions. In addition, ### fromDist ``` -Sampleset.fromDist: (list) => sampleSet +SampleSet.fromDist: (list) => sampleSet ``` ### fromList ``` -Sampleset.fromList: (list) => sampleSet +SampleSet.fromList: (list) => sampleSet ``` ### fromFn ``` -Sampleset.fromFn: ((float) => number) => sampleSet +SampleSet.fromFn: ((float) => number) => sampleSet ``` ### toList ``` -Sampleset.toList: (sampleSet) => list +SampleSet.toList: (sampleSet) => list ``` Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toList() maintains order and length. @@ -44,19 +44,19 @@ toList(toSampleSet(normal(5,2))) ### map ``` -Sampleset.map: (sampleSet, (number => number)) => sampleSet +SampleSet.map: (sampleSet, (number => number)) => sampleSet ``` ### map2 ``` -Sampleset.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet +SampleSet.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet ``` ### map3 ``` -Sampleset.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet +SampleSet.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet ``` ### mapN From 5c78ad1fc4af1d5740032082b5fd4b23ee009561 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 15:36:56 -0700 Subject: [PATCH 068/203] Update DistSampleSet.md --- packages/website/docs/Api/DistSampleSet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md index cfde2be9..cadc1496 100644 --- a/packages/website/docs/Api/DistSampleSet.md +++ b/packages/website/docs/Api/DistSampleSet.md @@ -62,5 +62,5 @@ SampleSet.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => n ### mapN ``` -Sampleset.mapN: (list, (list => number)) => sampleSet +SampleSet.mapN: (list, (list => number)) => sampleSet ``` From 0ef01da963ecf11c0138085ceac05ef1eea9e5cb Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 21 Jul 2022 15:44:46 -0700 Subject: [PATCH 069/203] Update DistGeneric.mdx --- packages/website/docs/Api/DistGeneric.mdx | 46 ----------------------- 1 file changed, 46 deletions(-) diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx index 247bb4b8..982af57c 100644 --- a/packages/website/docs/Api/DistGeneric.mdx +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -290,38 +290,6 @@ quantile: (distribution, number) => number quantile(normal(5, 2), 0.5); ``` -### toPointSet - -**TODO: Will soon be called "PointSet.make"** - -Converts a distribution to the pointSet format. - -``` -toPointSet: (distribution) => pointSetDistribution -``` - -**Examples** - -```javascript -toPointSet(normal(5, 2)); -``` - -### toSampleSet - -**TODO: Will soon be called "SampleSet.make"** - -Converts a distribution to the sampleSet format, with n samples. - -``` -toSampleSet: (distribution, number) => sampleSetDistribution -``` - -**Examples** - -```javascript -toSampleSet(normal(5, 2), 1000); -``` - ### truncateLeft Truncates the left side of a distribution. Returns either a pointSet distribution or a symbolic distribution. @@ -412,20 +380,6 @@ sparkline: (distribution, n = 20) => string toSparkline(truncateLeft(normal(5, 2), 3), 20); // produces ▁▇█████▇▅▄▃▂▂▁▁▁▁▁▁▁ ``` -### inspect - -Prints the value of the distribution to the Javascript console, then returns the distribution. Useful for debugging. - -``` -inspect: (distribution) => distribution -``` - -**Examples** - -```javascript -inspect(normal(5, 2)); // logs "normal(5, 2)" to the javascript console and returns the distribution. -``` - ## Normalization There are some situations where computation will return unnormalized distributions. This means that their cumulative sums are not equal to 1.0. Unnormalized distributions are not valid for many relevant functions; for example, klDivergence and scoring. From 4a98cc210aef75bbc684f431cd065044bc7a09d0 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Fri, 22 Jul 2022 17:49:53 +0200 Subject: [PATCH 070/203] fix compiler warnings --- .../src/rescript/FunctionRegistry/Library/FR_Sampleset.res | 2 +- .../Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res | 2 +- .../ReducerInterface_InternalExpressionValue.res | 1 + 3 files changed, 3 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 9995c3ef..27b870ee 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -259,7 +259,7 @@ let library = [ ~run=(inputs, _, env, reducer) => switch inputs { | [IEvArray(dists), IEvLambda(lambda)] => - Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(e => { + Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(_e => { "AHHH doesn't work" }) | _ => Error(impossibleError) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index dbec93c1..a2ca204a 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -119,7 +119,7 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce E.A.O.openIfAllSome(E.A.fmap(parseSampleSet, arr)) } - let mapN = (aValueArray: array, aLambdaValue) => { + let _mapN = (aValueArray: array, aLambdaValue) => { switch parseSampleSetArray(aValueArray) { | Some(t1) => let fn = a => doLambdaCall(aLambdaValue, list{IEvArray(E.A.fmap(x => IEvNumber(x), a))}) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res index af951d83..3805d790 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res @@ -183,6 +183,7 @@ let externalValueToValueType = (value: ExternalExpressionValue.t) => | EvTimeDuration(_) => EvtTimeDuration | EvType(_) => EvtType | EvTypeIdentifier(_) => EvtTypeIdentifier + | EvVoid => EvtVoid } let functionCallToCallSignature = (functionCall: functionCall): functionCallSignature => { From 3250d6009a6788e2b9f7123b52d154b6b0c17ae3 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 22 Jul 2022 11:50:56 -0700 Subject: [PATCH 071/203] Updated colors and light styles of homepage --- .../src/stories/SquiggleChart.stories.mdx | 4 +- packages/website/docs/Api/DistSampleSet.md | 2 +- packages/website/docs/Discussions/Bugs.mdx | 2 +- packages/website/docs/Guides/Functions.mdx | 14 +--- packages/website/docs/Guides/Language.mdx | 2 +- packages/website/docusaurus.config.js | 7 +- .../components/HomepageFeatures.module.css | 5 ++ packages/website/src/css/custom.css | 81 +++++++++++++++---- packages/website/src/pages/index.js | 5 +- packages/website/src/pages/index.module.css | 5 +- 10 files changed, 92 insertions(+), 35 deletions(-) diff --git a/packages/components/src/stories/SquiggleChart.stories.mdx b/packages/components/src/stories/SquiggleChart.stories.mdx index 2febfb6f..bc289c36 100644 --- a/packages/components/src/stories/SquiggleChart.stories.mdx +++ b/packages/components/src/stories/SquiggleChart.stories.mdx @@ -43,7 +43,7 @@ could be continuous, discrete or mixed. @@ -57,7 +57,7 @@ could be continuous, discrete or mixed. diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md index cadc1496..eaed6942 100644 --- a/packages/website/docs/Api/DistSampleSet.md +++ b/packages/website/docs/Api/DistSampleSet.md @@ -38,7 +38,7 @@ Gets the internal samples of a sampleSet distribution. This is separate from the **Examples** ``` -toList(toSampleSet(normal(5,2))) +toList(SampleSet.fromDist(normal(5,2))) ``` ### map diff --git a/packages/website/docs/Discussions/Bugs.mdx b/packages/website/docs/Discussions/Bugs.mdx index db53a6f6..49bf347b 100644 --- a/packages/website/docs/Discussions/Bugs.mdx +++ b/packages/website/docs/Discussions/Bugs.mdx @@ -31,6 +31,6 @@ The means of sample set distributions can vary dramatically, especially as the n diff --git a/packages/website/docs/Guides/Functions.mdx b/packages/website/docs/Guides/Functions.mdx index a428ac7c..56a4929c 100644 --- a/packages/website/docs/Guides/Functions.mdx +++ b/packages/website/docs/Guides/Functions.mdx @@ -208,21 +208,15 @@ The `sample(distribution)` samples a given distribution. Recall the [three formats of distributions](https://develop--squiggle-documentation.netlify.app/docs/Discussions/Three-Types-Of-Distributions). We can force any distribution into `SampleSet` format - + Or `PointSet` format - - -### `toSampleSet` has two signatures - -Above, we saw the unary `toSampleSet`, which uses an internal hardcoded number of samples. If you'd like to provide the number of samples, it has a binary signature as well (floored) - - + #### Validity -- Second argument to `toSampleSet` must be a number. +- Second argument to `SampleSet.fromDist` must be a number. ## Normalization @@ -246,7 +240,7 @@ We provide a predicate `isNormalized`, for when we have simple control flow You may like to debug by right clicking your browser and using the _inspect_ functionality on the webpage, and viewing the _console_ tab. Then, wrap your squiggle output with `inspect` to log an internal representation. - + Save for a logging side effect, `inspect` does nothing to input and returns it. diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index 2f26cdd6..3a195c1f 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -18,7 +18,7 @@ import { SquiggleEditor } from "../../src/components/SquiggleEditor"; ### Arrays ### Records diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index 68baf7c8..f811da95 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -10,7 +10,7 @@ const path = require("path"); /** @type {import('@docusaurus/types').Config} */ const config = { title: "Squiggle", - tagline: "An estimation language for forecasters", + tagline: "A simple programming language for intuitive probabilistic estimation", url: "https://squiggle-language.com", baseUrl: "/", onBrokenLinks: "throw", @@ -72,6 +72,11 @@ const config = { }, { to: "/blog", label: "Blog", position: "left" }, { to: "/playground", label: "Playground", position: "left" }, + { + href: "https://github.com/quantified-uncertainty/squiggle/discussions", + label: "Issues & Discussion", + position: "right", + }, { href: "https://github.com/quantified-uncertainty/squiggle", label: "GitHub", diff --git a/packages/website/src/components/HomepageFeatures.module.css b/packages/website/src/components/HomepageFeatures.module.css index b248eb2e..9a1b2eba 100644 --- a/packages/website/src/components/HomepageFeatures.module.css +++ b/packages/website/src/components/HomepageFeatures.module.css @@ -5,6 +5,11 @@ width: 100%; } +.features h3 { + font-family: "Lora", serif; + font-size: 1.5em; +} + .featureSvg { height: 200px; width: 200px; diff --git a/packages/website/src/css/custom.css b/packages/website/src/css/custom.css index 02c5ff6b..b9126b2d 100644 --- a/packages/website/src/css/custom.css +++ b/packages/website/src/css/custom.css @@ -4,27 +4,29 @@ * work well for content-centric websites. */ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Lato:wght@100;400;700;900&family=Lora:wght@400;500;600&display=swap'); + /* You can override the default Infima variables here. */ :root { - --ifm-color-primary: #2488df; - --ifm-color-primary-dark: #176fcd; - --ifm-color-primary-darker: #1f58cb; - --ifm-color-primary-darkest: #1e2672; - --ifm-color-primary-light: #49acd3; - --ifm-color-primary-lighter: #4fb1c7; - --ifm-color-primary-lightest: #3dbfd3; + --ifm-color-primary: #e74c0f; + --ifm-color-primary-dark: #bb4b05; + --ifm-color-primary-darker: #9d0c02; + --ifm-color-primary-darkest: #5d2200; + --ifm-color-primary-light: #e6a036; + --ifm-color-primary-lighter: #e79d1d; + --ifm-color-primary-lightest: #f5e191; --ifm-code-font-size: 95%; } /* For readability concerns, you should choose a lighter palette in dark mode. */ html[data-theme="dark"] { - --ifm-color-primary: #25c2a0; - --ifm-color-primary-dark: #21af90; - --ifm-color-primary-darker: #1fa588; - --ifm-color-primary-darkest: #1a8870; - --ifm-color-primary-light: #29d5b0; - --ifm-color-primary-lighter: #32d8b4; - --ifm-color-primary-lightest: #4fddbf; + --ifm-color-primary: #df774d; + --ifm-color-primary-dark: #db8651; + --ifm-color-primary-darker: #d7584f; + --ifm-color-primary-darkest: #b3693e; + --ifm-color-primary-light: #edb25a; + --ifm-color-primary-lighter: #ebd489; + --ifm-color-primary-lightest: #faf2d4; } .docusaurus-highlight-code-line { @@ -37,3 +39,54 @@ html[data-theme="dark"] { html[data-theme="dark"] .docusaurus-highlight-code-line { background-color: rgba(0, 0, 0, 0.3); } + +.hero h1{ + font-size: 4em; + font-weight: 900; + margin-bottom: 0.5rem; + color: rgb(230, 72, 79); + font-family: "Lato", sans-serif; +} + +.navbar__title { + font-family: "Lato", sans-serif; + font-weight: 900; + color: rgb(205, 88, 53); +} + +.hero__subtitle { + color: #888; + font-size:1.25em; +} + +.hero__subtitle2 { + color: #ba3e3e; + font-size: 1.5em; + font-family: "Lora"; + font-weight: 500; + margin-top: 1em; + margin-left: auto; + margin-right: auto; + max-width: 500px; +} + +h1 { + font-family: "Lora", serif; + font-size: 2.5em; +} + +h2 { + font-weight: 600; +} + +.menu__link, .navbar__item { + font-family: "Lora", serif; +} + +.navbar__item { + font-weight: 700; +} + +:root { + /* --ifm-font-family-base: 'Lora'; */ +} \ No newline at end of file diff --git a/packages/website/src/pages/index.js b/packages/website/src/pages/index.js index c156bec0..616093d5 100644 --- a/packages/website/src/pages/index.js +++ b/packages/website/src/pages/index.js @@ -13,10 +13,9 @@ function HomepageHeader() {

{siteConfig.title}

- Early access + Early Access

-

{siteConfig.tagline}

-
+

{siteConfig.tagline}

); diff --git a/packages/website/src/pages/index.module.css b/packages/website/src/pages/index.module.css index 666feb6a..f4518419 100644 --- a/packages/website/src/pages/index.module.css +++ b/packages/website/src/pages/index.module.css @@ -4,10 +4,11 @@ */ .heroBanner { - padding: 4rem 0; + padding: 2rem 0; text-align: center; position: relative; overflow: hidden; + background: rgb(255, 246, 237) } @media screen and (max-width: 966px) { @@ -20,4 +21,4 @@ display: flex; align-items: center; justify-content: center; -} +} \ No newline at end of file From eefdfbb2fe25c78972ceaca03df10b95f98f64a6 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 22 Jul 2022 23:24:49 +0400 Subject: [PATCH 072/203] modal window for local settings --- .../src/components/DistributionChart.tsx | 74 +----- .../src/components/SquiggleChart.tsx | 4 - .../src/components/SquigglePlayground.tsx | 246 +++--------------- .../SquiggleViewer/ExpressionViewer.tsx | 105 +++++--- .../SquiggleViewer/ItemSettingsMenu.tsx | 160 ++++++++---- .../components/SquiggleViewer/VariableBox.tsx | 13 +- .../SquiggleViewer/ViewerContext.ts | 2 +- .../src/components/SquiggleViewer/index.tsx | 10 +- .../src/components/SquiggleViewer/utils.ts | 2 + .../src/components/ViewSettings.tsx | 155 +++++++++++ .../src/components/ui/HeadedSection.tsx | 13 + .../src/components/ui/InputItem.tsx | 25 ++ .../components/src/components/ui/Modal.tsx | 84 ++++++ .../components/src/components/ui/Text.tsx | 5 + .../src/lib/distributionSpecBuilder.ts | 7 +- .../components/src/lib/distributionUtils.ts | 5 + 16 files changed, 519 insertions(+), 391 deletions(-) create mode 100644 packages/components/src/components/ViewSettings.tsx create mode 100644 packages/components/src/components/ui/HeadedSection.tsx create mode 100644 packages/components/src/components/ui/InputItem.tsx create mode 100644 packages/components/src/components/ui/Modal.tsx create mode 100644 packages/components/src/components/ui/Text.tsx create mode 100644 packages/components/src/lib/distributionUtils.ts diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index af644d29..1e1c3822 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -8,26 +8,24 @@ import { import { Vega } from "react-vega"; import { ErrorAlert } from "./Alert"; import { useSize } from "react-use"; -import clsx from "clsx"; import { buildVegaSpec, DistributionChartSpecOptions, } from "../lib/distributionSpecBuilder"; import { NumberShower } from "./NumberShower"; +import { hasMassBelowZero } from "../lib/distributionUtils"; export type DistributionPlottingSettings = { /** Whether to show a summary of means, stdev, percentiles etc */ showSummary: boolean; - /** Whether to show the user graph controls (scale etc) */ - showControls: boolean; + actions?: boolean; } & DistributionChartSpecOptions; export type DistributionChartProps = { distribution: Distribution; width?: number; height: number; - actions?: boolean; } & DistributionPlottingSettings; export const DistributionChart: React.FC = (props) => { @@ -36,17 +34,9 @@ export const DistributionChart: React.FC = (props) => { height, showSummary, width, - showControls, logX, - expY, actions = false, } = props; - const [isLogX, setLogX] = React.useState(logX); - const [isExpY, setExpY] = React.useState(expY); - - React.useEffect(() => setLogX(logX), [logX]); - React.useEffect(() => setExpY(expY), [expY]); - const shape = distribution.pointSet(); const [sized] = useSize((size) => { if (shape.tag === "Error") { @@ -57,9 +47,6 @@ export const DistributionChart: React.FC = (props) => { ); } - const massBelow0 = - shape.value.continuous.some((x) => x.x <= 0) || - shape.value.discrete.some((x) => x.x <= 0); const spec = buildVegaSpec(props); let widthProp = width ? width : size.width; @@ -72,7 +59,11 @@ export const DistributionChart: React.FC = (props) => { return (
- {!(isLogX && massBelow0) ? ( + {logX && hasMassBelowZero(shape.value) ? ( + + Cannot graph distribution with negative values on logarithmic scale. + + ) : ( = (props) => { height={height} actions={actions} /> - ) : ( - - Cannot graph distribution with negative values on logarithmic scale. - )}
{showSummary && }
- {showControls && ( -
- - -
- )}
); }); return sized; }; -interface CheckBoxProps { - label: string; - onChange: (x: boolean) => void; - value: boolean; - disabled?: boolean; - tooltip?: string; -} - -export const CheckBox: React.FC = ({ - label, - onChange, - value, - disabled = false, - tooltip, -}) => { - return ( - - onChange(!value)} - disabled={disabled} - className="form-checkbox" - /> - - - ); -}; - const TableHeadCell: React.FC<{ children: React.ReactNode }> = ({ children, }) => ( diff --git a/packages/components/src/components/SquiggleChart.tsx b/packages/components/src/components/SquiggleChart.tsx index a3bb5e4c..9367e63e 100644 --- a/packages/components/src/components/SquiggleChart.tsx +++ b/packages/components/src/components/SquiggleChart.tsx @@ -35,8 +35,6 @@ export interface SquiggleChartProps { jsImports?: jsImports; /** Whether to show a summary of the distribution */ showSummary?: boolean; - /** Whether to show graph controls (scale etc)*/ - showControls?: boolean; /** Set the x scale to be logarithmic by deault */ logX?: boolean; /** Set the y scale to be exponential by deault */ @@ -67,7 +65,6 @@ export const SquiggleChart: React.FC = React.memo( jsImports = defaultImports, showSummary = false, width, - showControls = false, logX = false, expY = false, diagramStart = 0, @@ -89,7 +86,6 @@ export const SquiggleChart: React.FC = React.memo( }); const distributionPlotSettings = { - showControls, showSummary, logX, expY, diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index ae3da135..eb297e7c 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -1,5 +1,5 @@ import React, { FC, useState, useEffect, useMemo } from "react"; -import { Path, useForm, UseFormRegister, useWatch } from "react-hook-form"; +import { useForm, UseFormRegister, useWatch } from "react-hook-form"; import * as yup from "yup"; import { useMaybeControlledValue } from "../lib/hooks"; import { yupResolver } from "@hookform/resolvers/yup"; @@ -24,8 +24,15 @@ import { JsonEditor } from "./JsonEditor"; import { ErrorAlert, SuccessAlert } from "./Alert"; import { SquiggleContainer } from "./SquiggleContainer"; import { Toggle } from "./ui/Toggle"; -import { Checkbox } from "./ui/Checkbox"; import { StyledTab } from "./ui/StyledTab"; +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"; type PlaygroundProps = SquiggleChartProps & { /** The initial squiggle string to put in the playground */ @@ -37,90 +44,30 @@ type PlaygroundProps = SquiggleChartProps & { showEditor?: boolean; }; -const schema = yup.object({}).shape({ - sampleCount: yup - .number() - .required() - .positive() - .integer() - .default(1000) - .min(10) - .max(1000000), - xyPointLength: yup - .number() - .required() - .positive() - .integer() - .default(1000) - .min(10) - .max(10000), - chartHeight: yup.number().required().positive().integer().default(350), - leftSizePercent: yup - .number() - .required() - .positive() - .integer() - .min(10) - .max(100) - .default(50), - showControls: yup.boolean().required(), - showSummary: yup.boolean().required(), - showEditor: yup.boolean().required(), - logX: yup.boolean().required(), - expY: yup.boolean().required(), - tickFormat: yup.string().default(".9~s"), - title: yup.string(), - color: yup.string().default("#739ECC").required(), - minX: yup.number(), - maxX: yup.number(), - distributionChartActions: yup.boolean(), - showSettingsPage: yup.boolean().default(false), - diagramStart: yup.number().required().positive().integer().default(0).min(0), - diagramStop: yup.number().required().positive().integer().default(10).min(0), - diagramCount: yup.number().required().positive().integer().default(20).min(2), -}); +const schema = yup + .object({}) + .shape({ + sampleCount: yup + .number() + .required() + .positive() + .integer() + .default(1000) + .min(10) + .max(1000000), + xyPointLength: yup + .number() + .required() + .positive() + .integer() + .default(1000) + .min(10) + .max(10000), + }) + .concat(viewSettingsSchema); type FormFields = yup.InferType; -const HeadedSection: FC<{ title: string; children: React.ReactNode }> = ({ - title, - children, -}) => ( -
-
- {title} -
-
{children}
-
-); - -const Text: FC<{ children: React.ReactNode }> = ({ children }) => ( -

{children}

-); - -function InputItem({ - name, - label, - type, - register, -}: { - name: Path; - label: string; - type: "number" | "text" | "color"; - register: UseFormRegister; -}) { - return ( - - ); -} - const SamplingSettings: React.FC<{ register: UseFormRegister }> = ({ register, }) => ( @@ -156,123 +103,6 @@ const SamplingSettings: React.FC<{ register: UseFormRegister }> = ({
); -const ViewSettings: React.FC<{ register: UseFormRegister }> = ({ - register, -}) => ( -
- -
- - -
-
- -
- -
- - - - - - - - - - -
-
-
- -
- -
- - When displaying functions of single variables that return numbers or - distributions, we need to use defaults for the x-axis. We need to - select a minimum and maximum value of x to sample, and a number n of - the number of points to sample. - -
- - - -
-
-
-
-
-); - const InputVariablesSettings: React.FC<{ initialImports: any; // TODO - any json type setImports: (imports: any) => void; @@ -402,15 +232,14 @@ const useRunnerState = (code: string) => { export const SquigglePlayground: FC = ({ defaultCode = "", height = 500, - showControls = false, showSummary = false, logX = false, expY = false, title, minX, maxX, - color = "#739ECC", - tickFormat = ".9~s", + color = defaultColor, + tickFormat = defaultTickFormat, distributionChartActions, code: controlledCode, onCodeChange, @@ -431,7 +260,6 @@ export const SquigglePlayground: FC = ({ sampleCount: 1000, xyPointLength: 1000, chartHeight: 150, - showControls, logX, expY, title, @@ -442,8 +270,6 @@ export const SquigglePlayground: FC = ({ distributionChartActions, showSummary, showEditor, - leftSizePercent: 50, - showSettingsPage: false, diagramStart: 0, diagramStop: 10, diagramCount: 20, @@ -500,7 +326,13 @@ export const SquigglePlayground: FC = ({ - + + > + } + /> (x: declaration
) { const first = x.args[0]; @@ -33,12 +35,12 @@ function getChartSettings(x: declaration): FunctionChartSettings { const VariableList: React.FC<{ path: string[]; heading: string; - children: React.ReactNode; + children: (settings: MergedItemSettings) => React.ReactNode; }> = ({ path, heading, children }) => ( - {() => ( + {(settings) => (
- {children} + {children(settings)}
)}
@@ -50,14 +52,12 @@ export interface Props { /** Path to the current item, e.g. `['foo', 'bar', '3']` for `foo.bar[3]`; can be empty on the top-level item. */ path: string[]; width?: number; - height: number; } export const ExpressionViewer: React.FC = ({ path, expression, width, - height, }) => { switch (expression.tag) { case "number": @@ -78,9 +78,17 @@ export const ExpressionViewer: React.FC = ({ heading={`Distribution (${distType})\n${ distType === "Symbolic" ? expression.value.toString() : "" }`} - dropdownMenu={({ settings, setSettings }) => { + renderSettingsMenu={({ onChange }) => { + const shape = expression.value.pointSet(); return ( - + ); }} > @@ -89,7 +97,7 @@ export const ExpressionViewer: React.FC = ({ ); @@ -158,9 +166,13 @@ export const ExpressionViewer: React.FC = ({ { + renderSettingsMenu={({ onChange }) => { return ( - + ); }} > @@ -173,7 +185,7 @@ export const ExpressionViewer: React.FC = ({ fn={expression.value} chartSettings={settings.chartSettings} distributionPlotSettings={settings.distributionPlotSettings} - height={height} + height={settings.height} environment={{ sampleCount: settings.environment.sampleCount / 10, xyPointLength: settings.environment.xyPointLength / 10, @@ -188,9 +200,13 @@ export const ExpressionViewer: React.FC = ({ { + renderSettingsMenu={({ onChange }) => { return ( - + ); }} > @@ -199,7 +215,7 @@ export const ExpressionViewer: React.FC = ({ fn={expression.value.fn} chartSettings={getChartSettings(expression.value)} distributionPlotSettings={settings.distributionPlotSettings} - height={height} + height={settings.height} environment={{ sampleCount: settings.environment.sampleCount / 10, xyPointLength: settings.environment.xyPointLength / 10, @@ -212,46 +228,49 @@ export const ExpressionViewer: React.FC = ({ case "module": { return ( - {Object.entries(expression.value) - .filter(([key, r]) => key !== "Math") - .map(([key, r]) => ( - - ))} + {(settings) => + Object.entries(expression.value) + .filter(([key, r]) => key !== "Math") + .map(([key, r]) => ( + + )) + } ); } case "record": return ( - {Object.entries(expression.value).map(([key, r]) => ( - - ))} + {(settings) => + Object.entries(expression.value).map(([key, r]) => ( + + )) + } ); case "array": return ( - {expression.value.map((r, i) => ( - - ))} + {(settings) => + expression.value.map((r, i) => ( + + )) + } ); default: { diff --git a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx index 898d5fc1..94e18493 100644 --- a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx +++ b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx @@ -1,73 +1,127 @@ -import React from "react"; -import { DropdownMenu } from "../ui/DropdownMenu"; -import { LocalItemSettings } from "./utils"; +import { CogIcon } from "@heroicons/react/solid"; +import React, { useContext, useState } from "react"; +import { useForm } from "react-hook-form"; +import { yupResolver } from "@hookform/resolvers/yup"; +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"; type Props = { - settings: LocalItemSettings; - setSettings: (value: LocalItemSettings) => void; + path: Path; + onChange: () => void; + disableLogX?: boolean; + withFunctionSettings: boolean; }; -export const ItemSettingsMenu: React.FC = ({ - settings, - setSettings, +const ItemSettingsModal: React.FC void }> = ({ + path, + onChange, + disableLogX, + withFunctionSettings, + close, }) => { + const { setSettings, getSettings, getMergedSettings } = + useContext(ViewerContext); + + const mergedSettings = getMergedSettings(path); + + const { register, watch } = useForm({ + resolver: yupResolver(viewSettingsSchema), + defaultValues: { + showEditor: true, // doesn't matter + chartHeight: mergedSettings.height, + showSummary: mergedSettings.distributionPlotSettings.showSummary, + logX: mergedSettings.distributionPlotSettings.logX, + expY: mergedSettings.distributionPlotSettings.expY, + 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, + diagramStart: mergedSettings.chartSettings.start, + diagramStop: mergedSettings.chartSettings.stop, + diagramCount: mergedSettings.chartSettings.count, + }, + }); + React.useEffect(() => { + const subscription = watch((vars) => { + const settings = getSettings(path); // get the latest version + setSettings(path, { + ...settings, + distributionPlotSettings: { + showSummary: vars.showSummary, + logX: vars.logX, + expY: vars.expY, + format: vars.tickFormat, + title: vars.title, + color: vars.color, + minX: vars.minX, + maxX: vars.maxX, + actions: vars.distributionChartActions, + }, + chartSettings: { + start: vars.diagramStart, + stop: vars.diagramStop, + count: vars.diagramCount, + }, + }); + onChange(); + }); + return () => subscription.unsubscribe(); + }, [getSettings, setSettings, onChange, path, watch]); + return ( -
- - - setSettings({ - ...settings, - distributionPlotSettings: { - ...settings.distributionPlotSettings, - logX: !settings.distributionPlotSettings?.logX, - }, - }) - } + + + Chart settings{path.length ? " for " + pathAsString(path) : ""} + + + - - setSettings({ - ...settings, - distributionPlotSettings: { - ...settings.distributionPlotSettings, - expY: !settings.distributionPlotSettings?.expY, - }, - }) - } - /> - - setSettings({ - ...settings, - distributionPlotSettings: { - ...settings.distributionPlotSettings, - showSummary: !settings.distributionPlotSettings?.showSummary, - }, - }) - } - /> - + + + ); +}; + +export const ItemSettingsMenu: React.FC = (props) => { + const [isOpen, setIsOpen] = useState(false); + const { setSettings, getSettings } = useContext(ViewerContext); + const settings = getSettings(props.path); + + return ( +
+ setIsOpen(!isOpen)} + /> {settings.distributionPlotSettings || settings.chartSettings ? ( ) : null} + {isOpen ? ( + setIsOpen(false)} /> + ) : null}
); }; diff --git a/packages/components/src/components/SquiggleViewer/VariableBox.tsx b/packages/components/src/components/SquiggleViewer/VariableBox.tsx index 84acb30d..f05fbca3 100644 --- a/packages/components/src/components/SquiggleViewer/VariableBox.tsx +++ b/packages/components/src/components/SquiggleViewer/VariableBox.tsx @@ -3,22 +3,21 @@ import { Tooltip } from "../ui/Tooltip"; import { LocalItemSettings, MergedItemSettings } from "./utils"; import { ViewerContext } from "./ViewerContext"; -type DropdownMenuParams = { - settings: LocalItemSettings; - setSettings: (value: LocalItemSettings) => void; +type SettingsMenuParams = { + onChange: () => void; // used to notify VariableBox that settings have changed, so that VariableBox could re-render itself }; type VariableBoxProps = { path: string[]; heading: string; - dropdownMenu?: (params: DropdownMenuParams) => React.ReactNode; + renderSettingsMenu?: (params: SettingsMenuParams) => React.ReactNode; children: (settings: MergedItemSettings) => React.ReactNode; }; export const VariableBox: React.FC = ({ path, heading = "Error", - dropdownMenu, + renderSettingsMenu, children, }) => { const { setSettings, getSettings, getMergedSettings } = @@ -57,8 +56,8 @@ export const VariableBox: React.FC = ({ > ... - ) : dropdownMenu ? ( - dropdownMenu({ settings, setSettings: setSettingsAndUpdate }) + ) : renderSettingsMenu ? ( + renderSettingsMenu({ onChange: forceUpdate }) ) : null} {settings.collapsed ? null : ( diff --git a/packages/components/src/components/SquiggleViewer/ViewerContext.ts b/packages/components/src/components/SquiggleViewer/ViewerContext.ts index c8b78b69..58270a90 100644 --- a/packages/components/src/components/SquiggleViewer/ViewerContext.ts +++ b/packages/components/src/components/SquiggleViewer/ViewerContext.ts @@ -23,11 +23,11 @@ export const ViewerContext = React.createContext({ }, distributionPlotSettings: { showSummary: false, - showControls: false, logX: false, expY: false, }, environment: defaultEnvironment, + height: 150, }), setSettings() {}, }); diff --git a/packages/components/src/components/SquiggleViewer/index.tsx b/packages/components/src/components/SquiggleViewer/index.tsx index be4dcaab..0c6a20dd 100644 --- a/packages/components/src/components/SquiggleViewer/index.tsx +++ b/packages/components/src/components/SquiggleViewer/index.tsx @@ -72,10 +72,11 @@ export const SquiggleViewer: React.FC = ({ ...environment, ...(localSettings.environment || {}), }, + height: localSettings.height || height, }; return result; }, - [distributionPlotSettings, chartSettings, environment, getSettings] + [distributionPlotSettings, chartSettings, environment, height, getSettings] ); return ( @@ -87,12 +88,7 @@ export const SquiggleViewer: React.FC = ({ }} > {result.tag === "Ok" ? ( - + ) : ( )} diff --git a/packages/components/src/components/SquiggleViewer/utils.ts b/packages/components/src/components/SquiggleViewer/utils.ts index 979d0cec..3053966b 100644 --- a/packages/components/src/components/SquiggleViewer/utils.ts +++ b/packages/components/src/components/SquiggleViewer/utils.ts @@ -6,12 +6,14 @@ export type LocalItemSettings = { collapsed: boolean; distributionPlotSettings?: Partial; chartSettings?: Partial; + height?: number; environment?: Partial; }; export type MergedItemSettings = { distributionPlotSettings: DistributionPlottingSettings; chartSettings: FunctionChartSettings; + height: number; environment: environment; }; diff --git a/packages/components/src/components/ViewSettings.tsx b/packages/components/src/components/ViewSettings.tsx new file mode 100644 index 00000000..def18d8d --- /dev/null +++ b/packages/components/src/components/ViewSettings.tsx @@ -0,0 +1,155 @@ +import React from "react"; +import * as yup from "yup"; +import { UseFormRegister } from "react-hook-form"; +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"; + +export const viewSettingsSchema = yup.object({}).shape({ + chartHeight: yup.number().required().positive().integer().default(350), + showSummary: yup.boolean().required(), + showEditor: yup.boolean().required(), + logX: yup.boolean().required(), + 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(), + diagramStart: yup.number().required().positive().integer().default(0).min(0), + diagramStop: yup.number().required().positive().integer().default(10).min(0), + diagramCount: yup.number().required().positive().integer().default(20).min(2), +}); + +type FormFields = yup.InferType; + +// This component is used in two places: for global settings in SquigglePlayground, and for item-specific settings in modal dialogs. +export const ViewSettings: React.FC<{ + withShowEditorSetting?: boolean; + withFunctionSettings?: boolean; + register: UseFormRegister; +}> = ({ + withShowEditorSetting = true, + withFunctionSettings = true, + register, +}) => { + return ( +
+ +
+ {withShowEditorSetting ? ( + + ) : null} + +
+
+ +
+ +
+ + + + + + + + + +
+
+
+ + {withFunctionSettings ? ( +
+ +
+ + When displaying functions of single variables that return + numbers or distributions, we need to use defaults for the + x-axis. We need to select a minimum and maximum value of x to + sample, and a number n of the number of points to sample. + +
+ + + +
+
+
+
+ ) : null} +
+ ); +}; diff --git a/packages/components/src/components/ui/HeadedSection.tsx b/packages/components/src/components/ui/HeadedSection.tsx new file mode 100644 index 00000000..e4389814 --- /dev/null +++ b/packages/components/src/components/ui/HeadedSection.tsx @@ -0,0 +1,13 @@ +import React from "react"; + +export const HeadedSection: React.FC<{ + title: string; + children: React.ReactNode; +}> = ({ title, children }) => ( +
+
+ {title} +
+
{children}
+
+); diff --git a/packages/components/src/components/ui/InputItem.tsx b/packages/components/src/components/ui/InputItem.tsx new file mode 100644 index 00000000..5d0ca613 --- /dev/null +++ b/packages/components/src/components/ui/InputItem.tsx @@ -0,0 +1,25 @@ +import React from "react"; +import { Path, UseFormRegister } from "react-hook-form"; + +export function InputItem({ + name, + label, + type, + register, +}: { + name: Path; + label: string; + type: "number" | "text" | "color"; + register: UseFormRegister; +}) { + return ( + + ); +} diff --git a/packages/components/src/components/ui/Modal.tsx b/packages/components/src/components/ui/Modal.tsx new file mode 100644 index 00000000..d0565ddc --- /dev/null +++ b/packages/components/src/components/ui/Modal.tsx @@ -0,0 +1,84 @@ +import { motion } from "framer-motion"; +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import { XIcon } from "@heroicons/react/solid"; + +const Overlay: React.FC = () => ( + +); + +const ModalHeader: React.FC<{ + close: () => void; + children: React.ReactNode; +}> = ({ children, close }) => { + return ( +
+
{children}
+ +
+ ); +}; + +// TODO - get rid of forwardRef, support `focus` and `{...hotkeys}` via smart props +const ModalBody = React.forwardRef< + HTMLDivElement, + JSX.IntrinsicElements["div"] +>(function ModalBody(props, ref) { + return
; +}); + +const ModalFooter: React.FC<{ children: React.ReactNode }> = ({ children }) => ( +
{children}
+); + +const ModalWindow: React.FC<{ children: React.ReactNode }> = ({ children }) => ( +
+ {children} +
+); + +type ModalType = React.FC<{ children: React.ReactNode }> & { + Body: typeof ModalBody; + Footer: typeof ModalFooter; + Header: typeof ModalHeader; +}; + +export const Modal: ModalType = ({ children }) => { + const [el] = React.useState(() => document.createElement("div")); + + React.useEffect(() => { + document.body.appendChild(el); + + return () => { + document.body.removeChild(el); + }; + }, [el]); + + const modal = ( +
+
+ + {children} +
+
+ ); + + return ReactDOM.createPortal(modal, el); +}; + +Modal.Body = ModalBody; +Modal.Footer = ModalFooter; +Modal.Header = ModalHeader; diff --git a/packages/components/src/components/ui/Text.tsx b/packages/components/src/components/ui/Text.tsx new file mode 100644 index 00000000..edf9471f --- /dev/null +++ b/packages/components/src/components/ui/Text.tsx @@ -0,0 +1,5 @@ +import React from "react"; + +export const Text: React.FC<{ children: React.ReactNode }> = ({ children }) => ( +

{children}

+); diff --git a/packages/components/src/lib/distributionSpecBuilder.ts b/packages/components/src/lib/distributionSpecBuilder.ts index d04f0c44..4dc87baa 100644 --- a/packages/components/src/lib/distributionSpecBuilder.ts +++ b/packages/components/src/lib/distributionSpecBuilder.ts @@ -100,12 +100,15 @@ export let expYScale: PowScale = { }, }; +export const defaultTickFormat = ".9~s"; +export const defaultColor = "#739ECC"; + export function buildVegaSpec( specOptions: DistributionChartSpecOptions ): VisualizationSpec { let { - format = ".9~s", - color = "#739ECC", + format = defaultTickFormat, + color = defaultColor, title, minX, maxX, diff --git a/packages/components/src/lib/distributionUtils.ts b/packages/components/src/lib/distributionUtils.ts new file mode 100644 index 00000000..086aac42 --- /dev/null +++ b/packages/components/src/lib/distributionUtils.ts @@ -0,0 +1,5 @@ +import { shape } from "@quri/squiggle-lang"; + +export const hasMassBelowZero = (shape: shape) => + shape.continuous.some((x) => x.x <= 0) || + shape.discrete.some((x) => x.x <= 0); From d2fb973e1da783b8b84ad7950003fe51ee164453 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 22 Jul 2022 23:32:39 +0400 Subject: [PATCH 073/203] disableLogX flag in local settings --- .../SquiggleViewer/ItemSettingsMenu.tsx | 1 + .../components/src/components/ViewSettings.tsx | 8 ++++++++ .../components/src/components/ui/Checkbox.tsx | 17 +++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx index 94e18493..878fe1ab 100644 --- a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx +++ b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx @@ -87,6 +87,7 @@ const ItemSettingsModal: React.FC void }> = ({ register={register} withShowEditorSetting={false} withFunctionSettings={withFunctionSettings} + disableLogXSetting={disableLogX} /> diff --git a/packages/components/src/components/ViewSettings.tsx b/packages/components/src/components/ViewSettings.tsx index def18d8d..9a2ce562 100644 --- a/packages/components/src/components/ViewSettings.tsx +++ b/packages/components/src/components/ViewSettings.tsx @@ -33,10 +33,12 @@ type FormFields = yup.InferType; export const ViewSettings: React.FC<{ withShowEditorSetting?: boolean; withFunctionSettings?: boolean; + disableLogXSetting?: boolean; register: UseFormRegister; }> = ({ withShowEditorSetting = true, withFunctionSettings = true, + disableLogXSetting, register, }) => { return ( @@ -66,6 +68,12 @@ export const ViewSettings: React.FC<{ register={register} name="logX" label="Show x scale logarithmically" + disabled={disableLogXSetting} + tooltip={ + disableLogXSetting + ? "Your distribution has mass lower than or equal to 0. Log only works on strictly positive values." + : undefined + } /> ({ name, label, register, + disabled, + tooltip, }: { name: Path; label: string; register: UseFormRegister; + disabled?: boolean; + tooltip?: string; }) { return ( -
- {value ? ( - - ) : ( -
- )} - {label} -
- ); -}; From c7bf40e3e851cdb4a016b45190e2a10edc31c82d Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 23 Jul 2022 00:03:55 +0400 Subject: [PATCH 076/203] remove showControls from website code and vscode ext --- packages/vscode-ext/media/previewWebview.js | 1 - packages/vscode-ext/package.json | 5 ----- packages/website/src/pages/playground.js | 4 ++-- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/vscode-ext/media/previewWebview.js b/packages/vscode-ext/media/previewWebview.js index 13bdbe95..a2b1be95 100644 --- a/packages/vscode-ext/media/previewWebview.js +++ b/packages/vscode-ext/media/previewWebview.js @@ -9,7 +9,6 @@ React.createElement(squiggle_components.SquigglePlayground, { code: text, showEditor: false, - showControls: Boolean(showSettings.showControls), showSummary: Boolean(showSettings.showSummary), }) ); diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index ef17bc39..c23cf97d 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -105,11 +105,6 @@ "configuration": { "title": "Squiggle", "properties": { - "squiggle.playground.showControls": { - "type": "boolean", - "default": false, - "description": "Whether to show the log scale controls in the playground" - }, "squiggle.playground.showSummary": { "type": "boolean", "default": false, diff --git a/packages/website/src/pages/playground.js b/packages/website/src/pages/playground.js index 5c52a9fa..203f10ab 100644 --- a/packages/website/src/pages/playground.js +++ b/packages/website/src/pages/playground.js @@ -47,8 +47,8 @@ export default function PlaygroundPage() { ...hashData, onCodeChange: (code) => setHashData({ initialSquiggleString: code }), onSettingsChange: (settings) => { - const { showControls, showSummary, showEditor } = settings; - setHashData({ showControls, showSummary, showEditor }); + const { showSummary, showEditor } = settings; + setHashData({ showSummary, showEditor }); }, }; return ( From 3eccd9afd1029911f554628868a68e9a9b911002 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 23 Jul 2022 00:18:27 +0400 Subject: [PATCH 077/203] filter out Math.* and System.* in viewer --- .../src/components/SquiggleViewer/ExpressionViewer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx b/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx index 28133230..1417fb28 100644 --- a/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx +++ b/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx @@ -236,7 +236,7 @@ export const ExpressionViewer: React.FC = ({ {(settings) => Object.entries(expression.value) - .filter(([key, r]) => key !== "Math") + .filter(([key, r]) => !key.match(/^(Math|System)\./)) .map(([key, r]) => ( Date: Fri, 22 Jul 2022 15:31:05 -0700 Subject: [PATCH 078/203] Minor docs cleanup --- packages/website/docs/Api/DistGeneric.mdx | 2 +- .../docs/Discussions/Future-Features.md | 6 ---- .../docs/Guides/DistributionCreation.mdx | 6 ++-- packages/website/docs/Guides/Functions.mdx | 30 ++++++------------- 4 files changed, 13 insertions(+), 31 deletions(-) diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx index 982af57c..e37c6f75 100644 --- a/packages/website/docs/Api/DistGeneric.mdx +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -339,7 +339,7 @@ A log loss score. Often that often acts as a [scoring rule](https://en.wikipedia Note that it is fairly slow. ``` -logScore: ({estimate: distribution, ?prior: distribution, answer: distribution|number}) => number +Dist.logScore: ({estimate: distribution, ?prior: distribution, answer: distribution|number}) => number ``` **Examples** diff --git a/packages/website/docs/Discussions/Future-Features.md b/packages/website/docs/Discussions/Future-Features.md index d1b45583..6070dbba 100644 --- a/packages/website/docs/Discussions/Future-Features.md +++ b/packages/website/docs/Discussions/Future-Features.md @@ -23,12 +23,6 @@ Squiggle is still very early. The main first goal is to become stable. This mean ## Distribution Features -`Distribution.fromSamples([])` -Converts a list of samples, for example, from Guesstimate, into a distribution shape. Maybe takes a list of optional parameters. - -`Distribution.fromCoordinates({xs, ys})` -Convert XY coordinates into a distribution. Figure out a good way to do this for continuous, discrete, and mixed distributions. - [Metalog Distribution](https://en.wikipedia.org/wiki/Metalog_distribution) Add the Metalog distribution, and some convenient methods for generating these distributions. This might be a bit tricky because we might need or build a library to fit data. There's no Metalog javascript library yet, this would be pretty useful. There's already a Metalog library in Python, so that one could be used for inspiration. diff --git a/packages/website/docs/Guides/DistributionCreation.mdx b/packages/website/docs/Guides/DistributionCreation.mdx index 95e03b7b..23a4bf0e 100644 --- a/packages/website/docs/Guides/DistributionCreation.mdx +++ b/packages/website/docs/Guides/DistributionCreation.mdx @@ -343,13 +343,13 @@ Creates a [triangular distribution](https://en.wikipedia.org/wiki/Triangular_dis -## FromSamples +## FromList -`fromSamples(samples:number[])` +`SampleSet.fromList(samples:number[])` Creates a sample set distribution using an array of samples. - + ### Arguments diff --git a/packages/website/docs/Guides/Functions.mdx b/packages/website/docs/Guides/Functions.mdx index 56a4929c..28029651 100644 --- a/packages/website/docs/Guides/Functions.mdx +++ b/packages/website/docs/Guides/Functions.mdx @@ -47,7 +47,7 @@ dist1 * dist2`} We also provide concatenation of two distributions as a syntax sugar for `*` - + ### Division @@ -88,16 +88,13 @@ log(dist)`} /> Base `x` #### Validity @@ -114,9 +111,7 @@ For every point on the x-axis, operate the corresponding points in the y axis of TODO: this isn't in the new interpreter/parser yet. ### Pointwise subtraction @@ -124,33 +119,26 @@ dist1 .+ dist2`} TODO: this isn't in the new interpreter/parser yet. ### Pointwise multiplication + ### Pointwise division ### Pointwise exponentiation ## Standard functions on distributions From b9dc7c70332e1132cc093c64195e52edbd676eeb Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 23 Jul 2022 21:14:12 +0400 Subject: [PATCH 079/203] improve playground padding on the website --- packages/components/src/components/SquigglePlayground.tsx | 2 +- packages/website/src/pages/playground.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 3b901809..5ca84040 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -533,7 +533,7 @@ export const SquigglePlayground: FC = ({
-
+
From 0ad09c96aa9a38338589ec37cf4f88341ab67537 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 23 Jul 2022 21:44:08 +0400 Subject: [PATCH 080/203] fallback spinner for the website --- packages/website/package.json | 1 + .../src/components/FallbackSpinner.jsx | 15 ++++++++++++ .../src/components/FallbackSpinner.module.css | 24 +++++++++++++++++++ .../website/src/components/SquiggleEditor.jsx | 3 ++- .../src/components/SquigglePlayground.jsx | 3 ++- yarn.lock | 4 ++-- 6 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 packages/website/src/components/FallbackSpinner.jsx create mode 100644 packages/website/src/components/FallbackSpinner.module.css diff --git a/packages/website/package.json b/packages/website/package.json index 621169f9..986b44c1 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -14,6 +14,7 @@ "dependencies": { "@docusaurus/core": "2.0.0-rc.1", "@docusaurus/preset-classic": "2.0.0-rc.1", + "@heroicons/react": "^1.0.6", "@quri/squiggle-components": "^0.2.20", "base64-js": "^1.5.1", "clsx": "^1.2.1", diff --git a/packages/website/src/components/FallbackSpinner.jsx b/packages/website/src/components/FallbackSpinner.jsx new file mode 100644 index 00000000..1f5f8106 --- /dev/null +++ b/packages/website/src/components/FallbackSpinner.jsx @@ -0,0 +1,15 @@ +import { useEffect, useState } from "react"; +import { RefreshIcon } from "@heroicons/react/solid"; +import styles from "./FallbackSpinner.module.css"; + +export const FallbackSpinner = ({ height }) => { + const [show, setShow] = useState(false); + useEffect(() => { + setTimeout(() => { + setShow(true); + }, 500); + }, []); + return
{ + show ? : null + }
; +}; diff --git a/packages/website/src/components/FallbackSpinner.module.css b/packages/website/src/components/FallbackSpinner.module.css new file mode 100644 index 00000000..c228836e --- /dev/null +++ b/packages/website/src/components/FallbackSpinner.module.css @@ -0,0 +1,24 @@ +.container { + /* height must be set explicitly */ + width: 100%; + display: flex; + align-items: center; + justify-content: center; +} + +.icon { + width: 80px; + height: 80px; + color: #aaa; + + animation: spin 1s linear infinite; +} + +@keyframes spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} diff --git a/packages/website/src/components/SquiggleEditor.jsx b/packages/website/src/components/SquiggleEditor.jsx index 1bcd9b54..43d626c9 100644 --- a/packages/website/src/components/SquiggleEditor.jsx +++ b/packages/website/src/components/SquiggleEditor.jsx @@ -1,8 +1,9 @@ import BrowserOnly from "@docusaurus/BrowserOnly"; +import { FallbackSpinner } from "./FallbackSpinner"; export function SquiggleEditor(props) { return ( - Loading...
}> + }> {() => { const LibComponent = require("@quri/squiggle-components").SquiggleEditor; diff --git a/packages/website/src/components/SquigglePlayground.jsx b/packages/website/src/components/SquigglePlayground.jsx index 4d46e7ea..e93327a0 100644 --- a/packages/website/src/components/SquigglePlayground.jsx +++ b/packages/website/src/components/SquigglePlayground.jsx @@ -1,8 +1,9 @@ import BrowserOnly from "@docusaurus/BrowserOnly"; +import { FallbackSpinner } from "./FallbackSpinner"; export function SquigglePlayground(props) { return ( - Loading...
}> + }> {() => { const LibComponent = require("@quri/squiggle-components").SquigglePlayground; diff --git a/yarn.lock b/yarn.lock index a61e16f2..9255e6a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4796,7 +4796,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": +"@types/react@*", "@types/react@^18.0.9": version "18.0.15" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== @@ -15225,7 +15225,7 @@ react-vega@^7.6.0: prop-types "^15.8.1" vega-embed "^6.5.1" -react@^18.0.0, react@^18.1.0: +react@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== From ce31dc62c2a26165cfcf8ce8e15e85f932842ee2 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 23 Jul 2022 21:56:28 +0400 Subject: [PATCH 081/203] more precise FallbackSpinner height for SquiggleEditor --- packages/website/src/components/SquiggleEditor.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/components/SquiggleEditor.jsx b/packages/website/src/components/SquiggleEditor.jsx index 43d626c9..d8404b82 100644 --- a/packages/website/src/components/SquiggleEditor.jsx +++ b/packages/website/src/components/SquiggleEditor.jsx @@ -3,7 +3,7 @@ import { FallbackSpinner } from "./FallbackSpinner"; export function SquiggleEditor(props) { return ( - }> + }> {() => { const LibComponent = require("@quri/squiggle-components").SquiggleEditor; From 111b4975ee5e4e52388ab0bf3605e803c9ba7846 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 23 Jul 2022 22:03:50 +0400 Subject: [PATCH 082/203] prettify --- .../src/components/FallbackSpinner.jsx | 20 ++++++++++--------- .../src/components/FallbackSpinner.module.css | 10 +++++----- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/website/src/components/FallbackSpinner.jsx b/packages/website/src/components/FallbackSpinner.jsx index 1f5f8106..c4640802 100644 --- a/packages/website/src/components/FallbackSpinner.jsx +++ b/packages/website/src/components/FallbackSpinner.jsx @@ -3,13 +3,15 @@ import { RefreshIcon } from "@heroicons/react/solid"; import styles from "./FallbackSpinner.module.css"; export const FallbackSpinner = ({ height }) => { - const [show, setShow] = useState(false); - useEffect(() => { - setTimeout(() => { - setShow(true); - }, 500); - }, []); - return
{ - show ? : null - }
; + const [show, setShow] = useState(false); + useEffect(() => { + setTimeout(() => { + setShow(true); + }, 500); + }, []); + return ( +
+ {show ? : null} +
+ ); }; diff --git a/packages/website/src/components/FallbackSpinner.module.css b/packages/website/src/components/FallbackSpinner.module.css index c228836e..e3efc0aa 100644 --- a/packages/website/src/components/FallbackSpinner.module.css +++ b/packages/website/src/components/FallbackSpinner.module.css @@ -1,9 +1,9 @@ .container { - /* height must be set explicitly */ - width: 100%; - display: flex; - align-items: center; - justify-content: center; + /* height must be set explicitly */ + width: 100%; + display: flex; + align-items: center; + justify-content: center; } .icon { From ff1f8e8e84ee5dab4b82425e00786655598c4ee1 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 23 Jul 2022 11:06:15 -0700 Subject: [PATCH 083/203] Several small documentation improvements --- packages/website/docs/Guides/Language.mdx | 41 ++++++++++++----------- packages/website/docs/Introduction.md | 14 +++++++- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index 3a195c1f..1bfe58e2 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -7,44 +7,47 @@ import { SquiggleEditor } from "../../src/components/SquiggleEditor"; ## Expressions -### Distributions - - - ### Numbers -### Arrays +### Distributions + + + +### Lists -### Records + + +### Dictionaries -## Statements - -A statement assigns expressions to names. It looks like ` = ` - - - ### Functions -We can define functions + + + +### Anonymous Functions ## See more diff --git a/packages/website/docs/Introduction.md b/packages/website/docs/Introduction.md index e04157c2..57c2ce36 100644 --- a/packages/website/docs/Introduction.md +++ b/packages/website/docs/Introduction.md @@ -3,7 +3,19 @@ sidebar_position: 1 title: Introduction --- -Squiggle is an _estimation language_, and a syntax for _calculating and expressing beliefs_ involving uncertainty. It has use cases in forecasting and writing evaluations. +Squiggle is a simple programming language for intuitive probabilistic estimation. It's meant for quantitative forecasting and evaluations. + +The basics of Squiggle can be pretty simple and intuitive. The more advanced functionality can take some time to learn. + +## What Squiggle Is +- A simple programming language for doing math with probability distributions +- An embeddable language that can be used in Javascript applications +- A tool to embed functions as forecasts that can be embedded in other applications + +## What Squiggle Is Not +- A complete replacement for enterprise Risk Analysis tools (See Crystal Ball, @Risk, Lumina Analytica) +- A Probabilistic Programming Language with backwards inference and sophisticated sampling algorithms. (See [PPLs](https://en.wikipedia.org/wiki/Probabilistic_programming)) +- A visual tool aimed at casual users (see Guesstimate, Causal) ## Get started From dd778dab7655f6fd8c61e3f87d30fc923bfe7721 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sat, 23 Jul 2022 22:17:04 +0400 Subject: [PATCH 084/203] show spinner immediately --- packages/website/src/components/FallbackSpinner.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/components/FallbackSpinner.jsx b/packages/website/src/components/FallbackSpinner.jsx index c4640802..9a888124 100644 --- a/packages/website/src/components/FallbackSpinner.jsx +++ b/packages/website/src/components/FallbackSpinner.jsx @@ -3,7 +3,7 @@ import { RefreshIcon } from "@heroicons/react/solid"; import styles from "./FallbackSpinner.module.css"; export const FallbackSpinner = ({ height }) => { - const [show, setShow] = useState(false); + const [show, setShow] = useState(/* false */ true); useEffect(() => { setTimeout(() => { setShow(true); From 8414cde819a91063e5135df14829df8d5e290005 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 23 Jul 2022 11:41:12 -0700 Subject: [PATCH 085/203] Ran formatting --- packages/website/docs/Guides/Functions.mdx | 29 +++++---------------- packages/website/docs/Guides/Language.mdx | 15 +++++------ packages/website/docs/Introduction.md | 2 ++ packages/website/docusaurus.config.js | 3 ++- packages/website/src/css/custom.css | 11 ++++---- packages/website/src/pages/index.js | 4 +-- packages/website/src/pages/index.module.css | 4 +-- 7 files changed, 26 insertions(+), 42 deletions(-) diff --git a/packages/website/docs/Guides/Functions.mdx b/packages/website/docs/Guides/Functions.mdx index 28029651..843cf888 100644 --- a/packages/website/docs/Guides/Functions.mdx +++ b/packages/website/docs/Guides/Functions.mdx @@ -87,15 +87,11 @@ A projection over a stretched x-axis. log(dist)`} /> - + Base `x` - + #### Validity @@ -110,36 +106,25 @@ For every point on the x-axis, operate the corresponding points in the y axis of TODO: this isn't in the new interpreter/parser yet. - + ### Pointwise subtraction TODO: this isn't in the new interpreter/parser yet. - + ### Pointwise multiplication - - + ### Pointwise division - + ### Pointwise exponentiation - + ## Standard functions on distributions diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index 1bfe58e2..90ee25b5 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -13,11 +13,13 @@ import { SquiggleEditor } from "../../src/components/SquiggleEditor"; ### Distributions - +{a:a, b:b, c:c, d:d}`} +/> ### Lists @@ -25,9 +27,7 @@ d = mixture(a,b,c, [0.3, 0.3, .4]) defaultCode={`[beta(1,10), 4, isNormalized(SampleSet.fromDist(1 to 2))]`} /> - + ### Dictionaries @@ -43,12 +43,9 @@ d.dist`} f`} /> - ### Anonymous Functions - + ## See more diff --git a/packages/website/docs/Introduction.md b/packages/website/docs/Introduction.md index 57c2ce36..22359de2 100644 --- a/packages/website/docs/Introduction.md +++ b/packages/website/docs/Introduction.md @@ -8,11 +8,13 @@ Squiggle is a simple programming language for intuitive probabilistic estimation The basics of Squiggle can be pretty simple and intuitive. The more advanced functionality can take some time to learn. ## What Squiggle Is + - A simple programming language for doing math with probability distributions - An embeddable language that can be used in Javascript applications - A tool to embed functions as forecasts that can be embedded in other applications ## What Squiggle Is Not + - A complete replacement for enterprise Risk Analysis tools (See Crystal Ball, @Risk, Lumina Analytica) - A Probabilistic Programming Language with backwards inference and sophisticated sampling algorithms. (See [PPLs](https://en.wikipedia.org/wiki/Probabilistic_programming)) - A visual tool aimed at casual users (see Guesstimate, Causal) diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index f811da95..16ff6afa 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -10,7 +10,8 @@ const path = require("path"); /** @type {import('@docusaurus/types').Config} */ const config = { title: "Squiggle", - tagline: "A simple programming language for intuitive probabilistic estimation", + tagline: + "A simple programming language for intuitive probabilistic estimation", url: "https://squiggle-language.com", baseUrl: "/", onBrokenLinks: "throw", diff --git a/packages/website/src/css/custom.css b/packages/website/src/css/custom.css index b9126b2d..f5aa047d 100644 --- a/packages/website/src/css/custom.css +++ b/packages/website/src/css/custom.css @@ -4,7 +4,7 @@ * work well for content-centric websites. */ -@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Lato:wght@100;400;700;900&family=Lora:wght@400;500;600&display=swap'); +@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Lato:wght@100;400;700;900&family=Lora:wght@400;500;600&display=swap"); /* You can override the default Infima variables here. */ :root { @@ -40,7 +40,7 @@ html[data-theme="dark"] .docusaurus-highlight-code-line { background-color: rgba(0, 0, 0, 0.3); } -.hero h1{ +.hero h1 { font-size: 4em; font-weight: 900; margin-bottom: 0.5rem; @@ -56,7 +56,7 @@ html[data-theme="dark"] .docusaurus-highlight-code-line { .hero__subtitle { color: #888; - font-size:1.25em; + font-size: 1.25em; } .hero__subtitle2 { @@ -79,7 +79,8 @@ h2 { font-weight: 600; } -.menu__link, .navbar__item { +.menu__link, +.navbar__item { font-family: "Lora", serif; } @@ -89,4 +90,4 @@ h2 { :root { /* --ifm-font-family-base: 'Lora'; */ -} \ No newline at end of file +} diff --git a/packages/website/src/pages/index.js b/packages/website/src/pages/index.js index 616093d5..05278aad 100644 --- a/packages/website/src/pages/index.js +++ b/packages/website/src/pages/index.js @@ -12,9 +12,7 @@ function HomepageHeader() {

{siteConfig.title}

-

- Early Access -

+

Early Access

{siteConfig.tagline}

diff --git a/packages/website/src/pages/index.module.css b/packages/website/src/pages/index.module.css index f4518419..e746813a 100644 --- a/packages/website/src/pages/index.module.css +++ b/packages/website/src/pages/index.module.css @@ -8,7 +8,7 @@ text-align: center; position: relative; overflow: hidden; - background: rgb(255, 246, 237) + background: rgb(255, 246, 237); } @media screen and (max-width: 966px) { @@ -21,4 +21,4 @@ display: flex; align-items: center; justify-content: center; -} \ No newline at end of file +} From 68238ba91437d142028d3684811983cf36b91293 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 24 Jul 2022 16:37:24 -0700 Subject: [PATCH 086/203] Added new logo --- packages/website/docusaurus.config.js | 2 +- packages/website/src/css/custom.css | 6 +++++- packages/website/src/pages/index.js | 7 ++++++- packages/website/static/img/favicon.ico | Bin 12704 -> 12896 bytes packages/website/static/img/squiggle-logo.png | Bin 0 -> 12896 bytes 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 packages/website/static/img/squiggle-logo.png diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index 16ff6afa..06c7b504 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -56,7 +56,7 @@ const config = { title: "Squiggle", logo: { alt: "Squiggle Logo", - src: "img/quri-logo.png", + src: "img/squiggle-logo.png", }, items: [ { diff --git a/packages/website/src/css/custom.css b/packages/website/src/css/custom.css index f5aa047d..7e4f5fe5 100644 --- a/packages/website/src/css/custom.css +++ b/packages/website/src/css/custom.css @@ -60,7 +60,7 @@ html[data-theme="dark"] .docusaurus-highlight-code-line { } .hero__subtitle2 { - color: #ba3e3e; + color: #777; font-size: 1.5em; font-family: "Lora"; font-weight: 500; @@ -88,6 +88,10 @@ h2 { font-weight: 700; } +.navbar__logo { + height: 1.5rem; +} + :root { /* --ifm-font-family-base: 'Lora'; */ } diff --git a/packages/website/src/pages/index.js b/packages/website/src/pages/index.js index 05278aad..fdfe3b45 100644 --- a/packages/website/src/pages/index.js +++ b/packages/website/src/pages/index.js @@ -1,7 +1,6 @@ import React from "react"; import clsx from "clsx"; import Layout from "@theme/Layout"; -import Link from "@docusaurus/Link"; import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; import styles from "./index.module.css"; import HomepageFeatures from "../components/HomepageFeatures"; @@ -11,6 +10,12 @@ function HomepageHeader() { return (
+ {'Docusaurus

{siteConfig.title}

Early Access

{siteConfig.tagline}

diff --git a/packages/website/static/img/favicon.ico b/packages/website/static/img/favicon.ico index d88e28c49f892a935b93c51112215cfa7a8322dc..5a29e1682941102ce60717b2d30bc891b2be859b 100644 GIT binary patch literal 12896 zcmaibbwJZ?_cuADRg^|jLSleOjGQPTAQ-gt28X1!^toc=rNMnodKz{b5)u-6ZLK>GiGQ1julfrB;``B% z?h6tUN@Lh#6E71zU638zRl)`Ww}ndhxw;eSBqU0ze(pAQ&QLENTc`ufO_^`Ap_z{d z22tiSzNIIr=dKQQglPqMKpzF%e{2`vY^MO>Q&pi+@&ge8T%lezJbtb&Zk`}NWxhYS zAmZoq$3Q-wKP+C(%6ukz20ZF;4=B$qiCYqqd@3|NN*)k<(8D_#|Cmf1Df2mcdAWmt zKwn>93E!I%a1RHdl!Af+P*NHwEiF#u5cl+V^Rn?1ck|>whxiNQ4%E}m1Lp1pgS+vZ zW7^oly}gwA_=t3#e}F^m{)O%C?cwqV8Da;7xyZ=k6zlr!4`M)L--TgmL@w0LNpP2RZ z{@?7bu75Mb)9bDe(Q*F>!ryfIrvT5#{_arVL#QX*+rtie*N5mm{y&a8_Y24X<_C2# zxdS6Q)sq+vWj-l+h5w6c`ZucVzp3hQ7r4hGVj4n;)BZd@_Z>*v)y4s841;(%{u}Mz z1YM|`!(WuYkp584wR7=4PX|Lc7||Z-f1{cFo2JYsCk^}$L8kvB>0hw`{n1Yk4k4;{ z^AF&^N!se_1|D#Gm=4St$isS#fEJza$U?2O`de+56wI@gj0bOA_;0 zQchf2=CPCv=$14{<`!`Xl9c>|{D+%ZKM)%)oBtpGc@^*|LF__-j{|~v3piloU_fHw}@ccU>;J1FFjy+jNC zqI$yZy?kvvpkN1LUMcf|?d@U22>SCFoEHoau}CE)ZvB0RuOpO*_P@Im_@AcyQ#B>v ze<}Z$<^R!1i1Yq>M(j|;RtNl7uOklr)h(fJ#1`p6?1f8?kNHVRNW);nO!%)1AR!Ts z^^P47z4PEor>ebU+l6c~F+utwUe$Xp38~NGWHi`Z=9J*}BaK@Dn|kkD5=-8pJ6Hv8XL&)@7F9sY*^i78x;78{v#hl}3{&ZUr-;Szz0uPeNq;;pAb58i z0_kcvIh!^Xot%F3af4C49Xa3lISfv&GS0OWjD4!YhzVqLn6y0|x<+Vzg|-|CZ!l<} z5n8${UQU_sJQ(C4ocCMYzg@XoK#3cy$H^{{?NmBgnH9_c=dI?m@+O^D9F$mcUTP)@ ztasQn?bwVbE^5^7TBe>PB(zNDFH(|s>8vCqJS5t8z>odX*E9SZuN!)AHWzKI$7aGl z@h;vNFeQ5{ugU#BRQiSp&IjdK8@l? zp7$up&<|~|&o%F9jw<9oZ}K(F2<&gFsjE`SdR_@%pQ;+4!-L|7octcR+3p+ z52rM->^ms_;5T1sb_vAGvd?Nt?L#8P@E3`>9Tc-tKqx*9}!| zuPAEY1zlO$jG3l*hd)|jFxZy4nUv`zefcHq zkzct8QI?-YJY5Ub`WfaHgM+AvU-5ha?XQ-KeYas zF{I#B%k-ENm0B5P^I4$s5J%O)$OnyVA0l#6Z!l}as9WQP%53u2YU-R(t+JuTM-ELI z`ACFR6iaQn`8r_X_f*ztbtlhBxoj3l)a_j793I%)5}%xO)q+MGP(1)Jv^k)$&T!Z+ zCSnlC9)_iv(=cj4yLn?Nyns2LJHz=UtVTrgUGaY2*%zPTpYgJvrdq0G-+ z>aCbu6_*uTGCgMDYR0_lT-<*GkMP6`#bg#mofYre#1m`nVXO*Cy=xAh!J(?sBdz{K zMVVy9&AZTN&^PYYjKhPZdd{njt>){z7+;8_C;@@B^oZQ%0~N1K;aI zw1jyfZqDJ)NOb(;9C1|C65U*0XMre7jb7+Y8I07kChjW$lcdiYA*qeg@fz3b<(6XY)iwuvVnA5ADgWDuJCGknSeOba) zN2P!!Lsj|mil4Q_>4jR&8XI|+8aVk$u%4}Ajb*&96owwVM6({>tp~sYzMHH+obA9V zss~t`HW3}G^u8z-tqMr~U{a&d*oP^bxy9U-@$pP4`_mt|R};h4>*T>uI*Cpfoa+M# zm$cg(Z~af62bkU$icA^I>|a`(=vciM>n#6z|&y*n^xLHeWvb5dXah@*)KRB zS-b^65B7Gd7YY=G%hW(JW#&}DLYKY?#rpL3k27GV2?7P8(YlH+GJ9pLaeeaH~`L*r1E`cTr6t#$JGL3h5QB z=og9aNo(bhFL2t+xbq8mbK_jZklWyB7mU<&{jh#C*f=gw=sr-xlppdgC zbo6sB@u@8hsmkY-y?svU4my>X_+Xr{PTlPkgeS08yPgZAsdk5NktjG{bR+1eLnky1NAyO)^9}c<$>2U2C_* z!(#v@at-c}pTnlzQc z#A>FFa$$3KWF*+*9LCVp`;x_@Zq$fUiP^q_`|oXgE>Xp8ue9Pg!hLY9#U(yZiNO>P znI&fYm-i4FPo3Y)v$O~^7I$$>G-mpXlV(qtD^XvHyA_(O-4zw0k0_dxd-AXEOPORB zjF!TS>PwJlrn0r*ZC>i3?(p2jt?yL0Jxm_&{s&~u*1Hq0s{D&LL(gNZRl#1@8hQuf zo*d-&nirFGtFhgq;nvagrK3fP!?bIJmlVU&y(QAamvuS7&XRk9DM@+0^3PJIpTpRP zy;IUiT{}N}wnhwiR#B}$KJy)^i)lZU
&7IOP#iwZu2!H894t5^gL>uLp*(gwT)- zjMs%l2GUusr}6^PS2hfghOF_zsanZFarBly=xSIdD7(+BH*DMX;0Qv4M7!7IbK1<1 zp4!9dZna&sjg#_FR(>w&vdDf?PvsJZO4l2=x1B&=>~m%A!v42Anw6h+yPsWRdeAe6w!ayjWDMj#BF8j5@p6<>~JQaETE0!R2G19y{9);iU z&mK2> zCbN1s{odgeMMWh45nqKJCh1<%4GDhlK`LnC*8|Y6WY6h}dgMt(u;+qHb9@UrG>)nI z+R@_9mZk6I_|)-PJN}Bj&=T?9Fb5SXPveY%)8mAt_-8-TmzEw~!9o@bp-Kw|vreX{ zG;8KT_22T4vlnaG!lvQ9Jo&m8g1+K}DoIqq6}P%J$aldB>2*63a%F6m`R(Fy%9kgV z4WzYUy=h3R^k$ms(Y&8);F#qnyx#hbi41!5;5pJ!?}=#n^H_1~SkiRy%$%u1L6x^-eRCRJN|jN~gx z9z<X>VGTd{7D_oM5!4el!UqnJ{5NFJ@A6k@X8%MZ>w5aYTVL<_tLS)2K5GYh z4q?6|Tk%BYKPeXd>7zzVM72OSa1NVGD(Ab97CJcf{%Dv%xQZjHOM*DFs=y7Bdm_36 z79n#wKCellrc2fow!5eYZ>7lE-V3m^Od-c6R>@>F9XPvfMXgs??oV#k|HkdP^i2-n1Nrv*H5B&!89%l8{Q7=LweX*W;UBeS+Q_Xh@(5dj3*9bzXl!74$8zNaz(67 z-nhH7j@e_pbMaUZ{FE~Y3AtX8&lfmOgd7ns-F~@d8K->py3td^54dSOj>;nEvSvaH z{6al&qMaJXGEyryKD*Kh08w}vACZ4``o!exeO&q)I|^gEl5CL?7nP9I{Bp%~bs(@C zu0hj>5NojVA7Ll%-3gj0NhuC0NQvvWJPlTVwT1t#Y+a_>UUuS3S(wctHC`^xBSjbl|WB*_6bM$&=qyz`MJA z3CFw>Kdl>&yQ%#bE2XJ2MXRxTeHO7CxnMSv^{KM#1PflOA-W;CfO^gBx&Wt&X`k*$;Fb+rWG{5twVEy1u)PgeC-Ovfk#nzb7}-> za#E1F|nss`Q%whYkUxpJ(ApHgk@ zOa|y-lK2BV&m(p`HjkB;x|g!c5vyz|07P-uGB1rYqUos-X(;(G518=OF7ZCdqr3Vi zpK_C%SmOfu(_E4iftj-p@C)RsHGOuMe&Ch_MLljqUD+m(F-;tk<>t{Lt?$V~#<8d0 zFLlj@uVuFD-s9R=XdSt5?9|ZLGEnv4Y3v0g_bJKrwH(m^J8N`U-EK@4_Uf>`ZjWTD z9NgTuW+Y3oj6yN7ab5D@Yzj5O^feUJ~-=#fu7~|WB@tXMCM>@#3 zb3l7!6xOEgjfm>J$FnvSI%8?jGQ=Xd^X^TuzD@lX4%Pr>gw(5s+;6Db86SD!QmaPh zWjowkYoFo)n}F-J*y5w#qRhvw%ZizSw&5_!<;fI9+TpK57As#SWN3wpS_=IaZ?d{G zhuf-ZBJSVYwopilj$g|W0aP|))?hwUrCEfIg5|lc%%L-`;6~9+V~1&_=r;$%esc7^ zju2tB%e{LrWS96PwKw9|UUT<{*TGzLE%S665!bn!7Pdk{uH|KwDeff(Hn#OuuKDf8 zGiYqIV63c_NUw_?dXhYzX$&uV#Fh4AwI*ub@^EX$Js-FlIisZi0s)HOoIX{aO7jsyjJ9R=?2(v z)aL_6AxC8PLiy;g_mW)jCrC`zQgsv%(`fWIM;!oshrd?n+j~6+_zG$yIg!b1s^j;A=5x|VDmP-BH zperU-x>T_v!$uagx;}OJc%tE{67CU5fjoI60Pmb_`gTSe^C67;_U~Eq`|{h)&n3){ z+ADpe1t)h2`B-{S-`k*j?$2!Y0J1hNy2-{rZ;E(>5?Jvp`71c^-S@(I>$Jmd} z$k|Tl2KT<&DWr_Ni1_7{Vco@(`fkqZ@U zi8JgfAAWX$oea`B*#w_4}8>Ng9MYsrJPIq2TD5Rcv|D@!% z#ajrK3?w63CgVvJn)LcQdh4~` z`jmebBX{3an|#49nN<@>R|l%aIhTQRpki9ok^bPw80`>X;Qbu*M@=&5kE6=yEYff87~XX$ReBS%1r>p zZI|Pp*us_srK42B0*qY-W{1!l-dlR3k-%F2H{ytXnn2=;iB+Igt>3d^@Osf6KAC9C za<4zksWy?aqT43UTtV0A<41$7ICipTRd+PO&>wR|{%!drIU)=OKyWw$?1m#dxH$v_ zlLCfN&gz4YXP&)c$ZW_p&2r$HaFBQ;^J%Xa&UyS?LP`a%Bk`1H-IO#7!JUCiw%47H z&D1}0?@eN45r!}gxmy?FjDyjOIF?}a)GeimZZ6%$;u0v)_Zhvy`z`S`dK-eCpN zi&&GfXp^yy;s^%=Kr^dA4SBP>#|HV{)v&$M4drES@UCn2V%Y7iAr>>>gH6HDVR=Et zg*_udTW0h!SGk;up$#&QtjDhy?tU=n%^3;H@{}_V+hmm720d#jyBQ;epKd(!Kp};M z=fdLP*F&0mjw;Ho5rjx|o=3&Bk~2}MRtnx=+_&cWf-|ReRB{V18-P0A0DbNQEO_Ii z^=@(%uFL8#FrR!6z!z<&9(2-UYAy&}!e{$=R0FWmO|&?x=TAjQQ)`{tOM0X%^)hkk z8wVcW%g8G;k17)jneP=;iB;X)w<>?Ke1E|NiCt8rI9)Q=N0jqwy?tW2a9>Mmx2I1~ zTBz5>eZkjTi+zAR}4GZ=up{h9Z`8gW7jr8xdt{)-OMYBKmioihmT@`>Kh z_je<9!MCtWpdzv9Gy(%Oe`bac=GvVV@1xh{3|cjIr6O*RYI9oC^T696nb+_`A-Dkg zWhnROBpFKVjr4tbh#5mic-17z=-`Y46P(GO`V3Mbal5pZx-QI-0Zqkjb!D?MsiXqj z9yX~ugd*@dQKI#Iu@eb1Xm;n+-E!t**-Wr(QZRls{D<^D8@)HUd>`)R;t{)IgJ#qVu zE}yy4HG-3Z94Ni6wP5Whd?nCLv?to1@=%V*&Jun!7mPlCaldSq%?m$eJCm z@Zod>6zP5E+GydIZ%MORbuT_;3gX%g(=TZK@F{5$L(I=8dRvfRF|=F!!m8wtQIy^f zj-Kk#5~>oe&+m4-gkdae;Lv4oCKucaS8`ky^z-_t&ue61d!bG%SK(uNW62PTtcG%4 zT_!=hTS;`1y_UL(p|coDJnhEUVe`PA!I`Tvj{af+3$|l@g+lUNSDFB7iD_rpYJ*t*Yw|e(S&nJsL!vu%fvtAOv${x9S`WsYAl~1 zVcZ`rPbI41$ZNtHbVa@;jLWI$3n#A&d$oicE34cT;c&# zE?Y*j55p}>|IU*s)XzY7=G$$-u#zU^ZX%2hK`-+FZ&yxgh!?rPxUNjkUV&Fv-nZz=X~UFN zPjepIHhAJsdzx6Wn%y-pk?t!#3V7vDsa`&s$KPbGkDlCHmkp%1Ml`!{jLs8_w_0%^ zi?nbYoU4*FRnjOfKb~cuH7K$=xX1)*U++`Ro*(AT31s40GlP_w{;ufRtByeL&80Dt zMDm+IRCwgcoDJXlaK2V>e@c@1v|j~&IyrS`2vr3#`7S@Ni#!~QB;U%VlYLf2sI#l{ zNuz9^^Z_st3BFq zr(hRmIJ`LK5u%M`$e}y^#E6jdqa!wf$}6^X$0jZY`RXFFj>&)w(mivW(({CC1cq7) zc}|meJ2`WD%ii)dh;MviyE2Z>&Z&kRv)g4&09HN@3R)ie0FHZ^O@!B3dN*?fNFGh7 z;GS4(+7tm%Z67IaX5t(!E+-)Kz;zc{1IUXWHYB2IIoH_QE<9p?DCb~78HBV|dwF)* z(1!^XkT+&_%!vG0o=JE}5ok9>DT%33RPVzSudUm>3!61|D zS<@VFnaoUN=onjCnnkjo-lh>ZmhythV)+ z6M&UcEFz+T5?IeOHk7U6-I~IFy^q!AtAdYrb*AY`?`d_r@qu|$hqEW_g zeVCg&%-+h-o7Law3t=a)YgwY#yj5Adg<|4@Y-py*f*3A@Xw|}R+1rVqfDQShtST-v z`P^V`c5x-XL0&p}f0`-h8yj*Sy?3%_kr*^q;o%Ll6DRl8;aJ7NYb2>GxsKOmhg$-x zJgv{di}4YdNv)mucX$RI0%OzCG@_Ws5yVUOYD`cueo2V_-D+UjEblO?W`MYv>97yW z0q@=RNOaG#MC|T4td9}es7}hXRb>O0(1I!}8CBmB6Uxm;%FoZso(=4uRcR8>KaP>T z3r&j|R!*mvu4T6p-_!I%)D82IPehPinG^AMc=6T(A(5GQpj>o!b>)gZ= z+_x1iV=!WkipT<7pU=*3kQ1JZoZ#~-k39~T(&2xR|E)7Dez~LyJ`6Q?q436;LgYD9LgnIVxR=p(AOSe>|+DOMK~E*;L+v&ISvj~VqgSuZr8 z3BZzl_J_a3g7q!$)&Ja|U_QDcrsm{o%iNs8ovFv}CAQhTX7N&|0BvgCGi372o7H6h zLGzi%wP6%PIk_LLz>=iq&=s6>Xbl-7LfkXK0O9;21KiSL=x=SS ze05A8?Jon)G@F)OhqF)(c8J5~pA4-YGYf6)y8Fm=y%wIX~p>PrK%+Tkh4n3>v@&*Sk*XujiKq zZ8i_E;Ri1Ugo?NT_JwfsIq>_ALRazXlFwU!Yr_;l2bevz`PANJexH&SMz!JPpB6aS z;8z4Go+|jtJncdPoEOGl)j_0RqTDsb*Ru>Sq+IjEP^nDL`Mp(RH$TkOwP~iXBzw{#IdDUx#Jwqk z`>UBzsl+wsm2#)6&MOT!D7{$w%`|2xuzhtX1}IB`SNbc4Q=haI1Fp1ChPb%k)Cg4@ zbZ8_mYT&18STm`cTeCCUk6%9-P$K$nZW!fwbIK4C$KpXZXZ+F8sM`D}?+?L|Ul-+9 zoV_owrfCSlYiA!$@;2xauWC6~9)7R3ZQYR1c-zZOy2&4`{aB~ls!+M~KCeD^Z5u#h zslDAR!mR2#7 zIXy8JLD3caz&8lu(l0|=Wb`TEnkaL~*6OFRilD@gJ%B{-kJZz*{#rvPWhF5^_MH<-(`wAZhDS`&NR~kGB zUR{UFpMC;C7qG6OTjw z)ML+aNIV9?uzeQR?)>HRsBW3*Nw+WB&M&S*l)s#yocbl9q^pt554gft#VmR=vTFa< zm~_3LI5USqRZ;|{d8>KP^mm6)AG_`|o;{D212JnhP#{yBhzk{-5(mpEV}gk^t*OoG zeF#d*PElS~At&A_h;aO@qn7U(AW?u|@9aMQ1S~!nQLLtaIgs9^HJjE5Deb?MpouSL$bZK_v-k2?%iBCr-O`<-BxeMk>oT(m`We4`4 z1FzKiC^KTu==|6^7{?G>#R|d8b|cdHNh-kMWntU`#xC^gNaI@yytz*F)gqG~RFq7h zGh6k3`2^~I34erjCS(ppm7+mKs?X=`zd3l9$~PKDY|j#_gMz|t!NVWL_XE|YC4;Yca?1_tj|DGm?&=tK2yN3SV`Scu z5c^YX9x(A893Kp8Q=n4i>Rib z;wt{A?Jy;+_k{NN8x*O5KQ1EIvkOpJl$dn?zMa=8(?qMme1+hjszF5-qIbCa(>q5e zsi?*6k)x7C=V=0fYYU0Jnc|bO;?&zjI-D;Tv_09-3CgC`ViqGPcW*3Tqf}zrCm&)$ zT{shN*&|T^;T@9cosL$KMbmK&6v!#c^! zC^w!IjIbZeinK+<12Wo=fO}!+h?T??#M?UJIesa%ChfH@$0QInpi>>QZiBHRVH8p( zO(NInpgo<*13MhxYFa;&d)9;^!d9kJRG^EeOPI|JQ1u>q6Ig)-GX~?w$sXl!KT~{5 zP(E~)6z`n5LwS5zfR^D{u*I1($YzRu%6?IzlW62Mt&le@1EJ|XE(V0RZamKMVVhc&z(A=QreR;nCi0mGs*|4r zeZ!B%{OV@au<@|Z)U}Fvfz}(2gAeSdUep<;2ueE*|?OFbgOcIz8g^02zv}TBYrzZHms0R z3OHf#thv^BKpiDGD^F85dwVlpRA{#tGjk-6qcCEK%!^sc6k^QVCXJu zkGDAE?zed-HB7hY*5bvntfAZ7GED^FzbVQ&fM zbBpdH+{UXFEnO-bvsZQ6gO_h!H}xm`{Oofhr>FMHy>iB3I>)Tk>3DDxZG1%yWlT#G z)eM7fGylnP@72^akNDJTYd4m>G_`T;_wnep@WD%8-$$qj8kfvCDMX<;J$t}KeKHX% zYQ4%Np8>;Jb|6;IB=WPG6p1!3{$B{}IJnli$O@)Lr#>V(Y WvZnVA-_HLrMEmajJEga+!~YM=$BMoH literal 12704 zcmbVzWmHt}7w!O(0z-$SL8l0eG?JopcXvt-9intdmy~o#cXz0Sbj{Gx14szNz&-r_ z_v8I^XRTSY)|_+R+3$XLKKq$SRb_bsyeD`d5QsqGt&BPdgysUgxp1(6Z-y(^-GPrs z?otYxIKayv$1(y0VgxD3ywUXjdbIlfi^04P%gH@7Byhme{yS}F@mR*2G}Z))BL!$; zhC2T!PG@FaM)FkgSGQjU5#upb&Xvc-9Yoo(P##WSGh!wC0@Y|aFAXcTRqhP+ZME4+ z#n~7>g{Ticwn=0H1R~K>{kRFbF*j%{E)<{zFnX*z4|lLT&s{frauqXu^XRbzVb|Ym zchIx{&sUVl-W4X1Y=-r^Gogqcv5y>x5~R76y&gN3xTSV{b)n|}vLh0G>Gjdis1ecq z{7w}GQ5*YzjYsCy)zMfO{aGU{zxr06C~#toG_*SCiP|KhDX;dNFrVd9tc*Wl+zbP= zfnBtRb*1uagiu|eZ>2ayE1)&!_!ru3UTXX`R4|z^`yvvPUILIRW2fs<#?g?#)SCI? zrxD2jH@^8^jbyPh<=fvCte-uV_!nNEG22@lwC0~m_Ez~hf8S&h#tr%=2CU&!s$m2} zV%8fZ@mPtAB`IDV_OZ{LL$}0V=GQr4X zY>w)Zm|VSIzt?#yQzFN$qZ4XEO)L+S;ZhK2U7>o3Xf?a4`fP2LeDkZ~W24JHRex4# zq{_Vm9|7a)IoROSSz;}7#{VmyNZp@>rT?2I=g5+&NP!iCa;qOzQ2}HaqJr^H zKC(4-5X9ZK?p@(bCVZ*(6rdu>2tU@PF1?n>DmD5UNvD^< zC8p*Ik)%-OUPqEKUfRLtg0bJYje}ffc8sVEiMSQC%rutFor+vvFA=N>EiG!lwQi?m zDSxdf>bMTOwcE`gs$cADUd^!88*4X+d~y+~FcGk=`2Dh+3wKCsV|Nm0>=pN(DQDKC zWb5CHDb2pA3qKQH{0{}~jh#u|8eXD2FHd`}jwzIkGqJ$(Fn-mO|G6Se`ATtKz?9r54Nxq{$0sVWHhR}7T+F2^kaN|B4lCk1>*OUGs zJ>h&TU>$X_ExuKDv%>(s{;bjd%oKO8RZ&1R0eqJzrU}?E+teoDeP}oUlCL*w<#Dvai z=_%VB5U`j26u?E2Kbv27N#GQ{m(>?fLzL(wGx#8ru!TFHMKQ;9L|*#*`_=B_oqjxK z+gket8!PnmvH*J3&x7Ji`vGPJA{HsQ+YCy%&l|3uk&LdPgH%!0h-yoPQ{3_ zB8_5#G;e4pj=E~GFm0qXY$PMbvroiYucp$1geoSH?^&xpwSY!!ISgd4rzEWQEQtUm zYZG>#S?deD1lzWaGNgexVF7nCunG6T^P+wsOl#>DQBYX^%6Z7IZccWM_}fJuZ4474 zS(5%N^WI-oEhz&hb#tk4%}+n)@9${(IFJ3~zXW%Ccw=Hs(0TD9Y*7{Ll6MIbs6me& zo#F^{Z;dUwF(W#8bPn6*m4IrJ@^n6~B0#anJ0&RsIJZZ;^KV$;SDM(O^F!JjA+=JA z|9(Y$iziJbv%6R`4((pU3MM1b6-jQlCmVWjMP;dy`~}<*3>Ml0(kxqOg@jg;lNIV~ zt&p&$)%<9%nYV`J5uUTja`*AZvyjHAm1VXh5sBNm)o)QhGcetis+9{VG24}~@Bx=p zc>3sy@QrI}oq(M_#{CKW{;aNK#Ot<=;HhV+qhq}X-`m$`#Urln9NdWu?FpJJWSh&8 z3FOo5_tVzqgpK3mNq-1Sa%qm_5FZl?(*%M9qlCjCvdT;^JMb@rTo+P{!A8CuHf|HO zQmuwsF6@=2&L-M+UdPr+d`eF7Zcm5+CrXx13*>c}Bc%E?9=Maz9Fv1|4+?C?Nf^Y) zV6N6_FS-*vDh?2REDJ=>N=T-kNYU@* zP;5#~AX57g?|AS-7!5z+E~#7N4dmcEimwtSeQy{oV*(vCe%(bh~UN=mozPHJQyKjFM}c}*_P zuuZCEQ=66V&+~P81yj;DTMS-1bi&Nh+DhI$pOnnSHUu`h37Im(&*ex?1M$PH1wW~F zQI2Cl-}yd0?v|P}^G-@>BJCGCw@9pG%77Sk6ntsT>!tNpuOAKgRFtG^;jJ-W#8-b@ zYcs(u>UxG*pwQs^*1FwS?XGq7lZ|H3{j5|g$W~mH7czb6TBo4{_x#IPmWzt}5&0t> z@P>KOyT-*+7UdixdWF|eO;`I0eXexT@d>2%QskJeVLu)B@3P~WVJwf(@(8*v-s$WJI%k%ue4LfF#>MZE zHujyV7o{?;Yjb4;;U+$>VgtEGPTyd@Do#oRWhxs#!G_jHPFOdG=H`&5y&O0xmdts5 zEw!^d+A5&*`anI)&~cX9Tzo%ldLC0qoJz&`F8W^07*o~uCOkXb?Z=-bD2++b($Q40 z@eBuN)|c7`$vwZu;O(F(WhiE($F+ft+A?J)ya*1zqG$A1cVygc(RAzBLQRJI4YfXS z?LNMS-gif1WS~t3-jhe+$90rdS!68EOxaBA$dQb<;iZ~&?N52n5af*x` zCgR%0zFM5ec62KR7j_~?(yiN#N8POlDy@2O_;bDJs*fJI`V}UBN9EnsJAAgcag+S$ z+dMow>*x0?&Qv`eeinM3l&A!Gp_Mig-Uxe`HIEBx;*~)WieBgVmIQMhxRO=;9}APT z24li%IE`d>6ptwv)vgHV8$2gzE>kTvtS9#okb${g3Kzn?i;|U@h4yWA?`j!TU&2+e z$b-;1z9lbaws-Yge3)$b`=bAqB6I9#sh87{>Se2_xu74}=!B zp?6*uzx*WWko${=Q%O9A8W(d?1kSy`t+h%NkDr99U5OP}g<9NKbUeyyxIf6I74De7 zJF-PA=LjAg&^&i=-4Zi>Fp$g-b40$j_Py>N$DIf+0XU&21CXqoS;DG62hpLPZzyFp z5Pp}~w$86R{JZFIPx@i26KRH?@dODEYJPH15T%@c+XVkoAgXqCW$yt#R~H* zXH#jVBQcAgz`5sJD20@!!4ez>Y+3Y}Yo!dDO8Z*hIUrAZny}yc`K1wLViRr9wFgjy z->pOart++U^a*~jYXgBMmt2XCVheoMgFh_>WTpSY?jfP?jF${ zXiA_C_o@Anr76(*W5Xf{b@ljZ7yAX!J^8Ya7aY?GL$9vkPVLd~8x7}o72|E!(_!8a z*}dBCYrg^rbseb#jJWx3+4;uie$EKF=+f$N(0x>l3=lhVWRcq;K3Ky7WkB6IoVtf= zp+A_MII|$S>@FSO0w*Z-XC|MPEq9-C81gZg;UjSLRoagya=hv#0+x)RqLpROsy;Ss znjMv>wEs9zS@f~@cB0V|&{w8+jr}a*B!ufyJ9``wBBgi5Q|p5I^lgP*a7b?nM?D?Blk0$PuFjf#DkQRv4$JyfDkvDwaxg2;F&x5Y6Nu9uNbQz$l*Km-L1(o1p*ZRWRanrsDcV{M!*SQNL1Mx^*d_sW%JK zVl7OSm~**q8XKcgQW}zP^BvnL!x#w|jSL`FAll0NtO>z@bnVWi`||JN)ao!!cUU&#i^WZD^DI4F>d;v@xp*&~Ta$gS#?#Bk z%la6}LJ^ONJ=pC%C^l@5k2GU+)Nk_kZay7_3`K3%mFTV@=eZ}f zS&sOTSI&1XbK1WvECT}G&p`2AqGM22KDb%JSP8PF$zc2)=FGdh%t!TXvU+PuS;_A~ zj0uwzp3ZECD~hnnZxbHVA90X zB8U<@+W4gX*oxT2?Xdc1o7R6->#PvwE?Bl9y;3s@`$DuGNa~4-asBSUiEcB|?FJl~ ziuY1$n}-<2qMCd+D;{eioT2g=fgAD+f0S~=Zlc#$nPRu6n4|d#)tB$3QbTUAF{`5y`RAaEP83q%M@p++b6+9z^Hn%k%SHo?WS{ZE3q1IH4PT`!^{S-uCYq&0%J!2KdG94$MUd4z&sqL^iF8a$`YF0dn)oi4 zfYV-qnK60mOOzk>n7{1Z?nQhob75IG6^yQ&M=~RPF`}mMnLBgVMOF)nraO^%$|i3F zWPWyYBarV)3lM_unCAA_sPMt4O9enYv3i)Lba6IYc_`yYk2m-6>Sl-yImFWs2P^pH~lBh4^0objkh*t$z)di_I8c1h9kf4j(<6N;lQ-(Vm)Om zg_!(Uip~VNa6s(Mtu!HV#!r6w00uvPCS^~tWJ-aYfw{igT>qaBHYXVK*s5)7qZ4d2ta%=6@pAYo)u z3%~}gd1HbmqcjAC1_x!jrTlogJ zBK)GlF37jDF2V8}yq5j_QPmQswm#H$><5a@A2~Hhp!ozMZ~$nx>RmN4<#Uz{O=15v)?!_TRM0Z z*rE@b5S4Ka7YC`sU`tf5xI$*H9!+>6%RlmoaUTuK(`U>sd4W3fGbQfCDUTMOsjrKj zuUvBmYZz7cda(`A$ho_ed@YO<$%(5Nc@1-6vV zPjJ$o_Wk>U=#(Sh4OZ|$yjUIK-YN~ZJp8ieKNC7R8F6HN{~fjO7J+~wh+xcpD@Yp2 zPy0*aIA_a2{^PcmwtlE(kMjW3seHXHRM)lC^7P*kn8NqUcP8p$JzEr&o${Tt{Zd+u zXe!!lZUD*V>**xnG46rBbbQm?Sb#Xwwn}=x!(|%ajiG%(otCG&0)rV66b#nPhpBWY zPw7`dW)Tj1%$~eMo4kVe6{pn!k?H1mqN_if`>OQ-^6w8i5r0tKx0OhsH{!? z%J!^Q^HDSnxl36?+sx_P*&(884zxPFS%xsWoyN@}k`h&p*up+v7!{k7i<5G?KS_Br zSkR<#!DI+q&`{!R1kd*ZYhVg$;>p#ak)a2DvG-Hj?6zR}*B+f5Dm6K*5PpJI+QvLdk*q-{~i06P``7O^XM-Z;lsW2#~lu z;ghKoYhjM-LXPYWCB?n4WRm=VA^9$kLtbUPiq7vcYfrhl;B3EDYWpl&0~gzZXzPG0 zkUyAg{A@SlFIy6lPzyqdmfYt1=B}08W?`3LklKx+J>caPj`}=95Wj=l{6j}uTb(1& z#?wf7GlE>unXuOC%WRzg_}2V%=m5_3>C9sh6Kd=I`tb<9E(5)&_!2hw0sfoaTiwdd zaBJLGq@r8+ur-C5cb!_B|M%sMxUZWt!IxxK3YQMor|{Ls(an?n$lcNU)pTCms#is3 z|IXi2gU8uYHL+sjxBq&js>FaDsg#=*_?l?&9pJ+`C}3@e4z^UPjb6{^9qkQSym^wa zGT&&kuz%w@YXJ-YqHZL|aOGJPg##T|JI4OC@VCpu_l!);Be03ePMlR4tK*=jK)?9e zt;V@uIk&-bVUXBjiYGTczKitvylmEpKls{fa^)&`(Gt=!FM?7y| zBP58mTw9}#8`*rZzfEe;93!yodZKGBScF?*Bq1z)3tA7q(wP{S^7ZDQHa4oxo^8_d z%vp~bqB>C%uXR0*+uLm){;?A)5A0p6Js z$9jAju{*bA{pzaEaBDtK*cox=zqH=&Z@vs;k;~FH3cAgAEuF5{2vwYD!@p7Jq{+5X zn{Mn>vPa9&Jq|#%le0zb4;oKc{ucs3Y{M0pt?W5vMub;PwQ_)ph6)fc?ktFe-5qek z2RQ%AJikbHAlvcgv<-JmCv1x*au7T`rXU)j=F{_M-N3-(@^m{te59PelS!9!~x* zwgyglPP>RC**lAj=d$o?{vaRRm((o5eRi3;91-oqv;*ODB zw4vG+;qRT{Bzjo`d?N@AhR*1c&EUU04oQ`v;^tS4-oxdg(Xna2uH4q+zBOpAe#L3^ zoSeWM5F9}If?TWSiiCa~v{a~ekdFR-C)tQH_VDKg2k`RbE_i*Y1y$sV2APj-bqR8> zpb2Mni0a--twc?49wcQ7(wj7y;C|H7^05Kny#Zg%E|sGe0R@h)Hjmy83;iUo({H`~ zriMe`b{?uHdDF;xB;Lfm;+n{3_FI^0XluK7gLFgt6U6jy;m(^voT)y>Fdv{gYw$ix zY5C57;d2%zyG{Dn>aUoX6TPljAX2&jGEgv)^NX53cOgXo;6pN$uYtLPMjeQLuh+LY zvu7Mj9_6uqWI$I&OL=EU^p2~*X1t_4=jQ;&NKr>;<4bF|54BF)q*UB1wT+&yw`a9t1j+n-7$Wp-*~H3+&b*dzb4sTynE`D&a<+2lmid;CLM+&TaG5I;(xFpQ}S9`_I!K{{?t7qg%MmBPvR)q zFG)SVk~_Qj058>y5<~X>kaQ6j z_^0Qy7=AVyIOi-+(|Urnj~G#~=|aBxjgkK#TwlM+plj4B=je<+q0>^$&lutK$`0S} zrfwz`V=P`xgijbUuo}cXOLQt9pS}%)hHn2jdhT38@ViVq+6?*&KUcgvug3b5{kMkB zMj_(Pv&dXhsBg#{{`5wpO9u^)1z-bXWX>*IKb|BCpD z7SAHp4os_Acu>hIZQb6(&0P%m#L*|trSrpX5sFkY+Ik^cl3j4uFM#5|vUhVZ&Rf%j1`mZyGpZOm7lzCH%T(8HfQZprPlTOdQ z$(u*!06`A4_5kx5NSIv-4`ds6yscjK-|YKsJxfE{Yu;UL1!__KY2T+8w6V3gJ=`rw zV_VqjdA)*8CYMbdkXr8fs{sl$H9kO4Kp#yl`!=ad!d7dszgB>(F~78+E%+^0Bmbwzw|C8D96l|hi%qXh3m zz+}+itm@hKS+zF3LrvP9st5D z9qt%~sxEu0BTj4ea@f+t%;2BTTZAdve9phY0eVgv-J!3!ld%8Oa(+wy( zMs{rq8`?B4XV zIO(DAwna1xI}O=xGfn=5AwU<1E*I0;r(6J-`)dD@J=Jc)RUkw=?H#0gi&^&TsO{|U zXTzSN!*HD2_z9)uTbF0_sR>2^^ubhN(Dbu;Yh@*BO5m#HiiW6AF7f%0nLl9h73L_~ z(Kj!Snjv4;S7n^k|87U#fThde^Q0Pg82%0xBt$e))fqFBBN1vgaz4)GoEy~HlhalJ z=WYfsBl|TsmAf4;4c%KG zBuF?wqvTxmM}4dwb&TsENYPFkYyNJSo>~sUVoc^z+sm1G`>fVlc(V(&)G9hKcg*OS z)L*dU!b#3CM^pF^lTF=*1Cv!iJt5!Iz4AakRUDMXPdmHEL1WK!&uLab@~{wB@aYNL zmu}DPkFLMmcF&>T7yX{ak2{&%rK)-B*5A}cMYg-MECqUWr@F1K4~#VCc;(I{H?wD1 z6w|Txbk@66-6m6bAS3+Z!N`wT1YkMBG#sFc3^W5eg#YCn!}`Cb7HrZLNe|t(8r^i% z<(oIB#}H-3^p!@FZBo!+)!2?@GKOd+L4~g1-efFfS3~lW|5!!USzllIW#h24M3qZ8F{o^4(C!H zPn#X`k0d}Nym{Sh$J8&F6@z-hm4jGp5M}4$g4K0aS8pV?leR{l_ zJn6YZAjKJ|aZr@*FkGEv@cb7C<&ZDkgRuqlD=6jqb29vg4}2NO%tpa?!XcoZ{P#L( zQ-5-aiCyZNDBt_d$BVXsN~f%KjMT%tlZtK31ZU#q4MP@L!uiOeA@G*TdGfFL2=UF{ zksUHV&xfp+{5rUSBOAfLn7j`j;gJ_JOlBXg)%bAqWxL zksCh4%x7fJCT#$guzLmNts$I~NX$lU>6j#_h|S zmHU8r^!Fw$sC-0gs2^#@$D&_R&9)l05Z(^1fzX8I2qo0=pUYYRq6`sF`{>^QHV(R- z;+#3G{P|t|7emnfb9hoB&{I2D{PzUl5px^r_m|W61iCLn^q!PEE2YnMSO2fyH0oj| z4bjJS8ajys(Z{T4`qb~oQuE|Cx7|5)-Q$92+s@~nHep__zKXV@|($KglveS6PV&vR?087yr6l%ct%Xm zxxm|ne$=Wj)b<~(CfQ7z&O#nR|b#^3NY$5=1?$M zGf%he93JjtVbw>2`D1g1r;n_=g;fF3>vo$F%hr`X@`iSvW&VFJ9=l@%^43+~K(}Yz zF(1JvzWwm<2T~DD`10x>m8}r*K%S`6qk)>!xlX|G7{LiJqv~&u681I`L9Z!F9$YOh zJ4BpnQT`rc>hm~1o;+Rh-T+6o_TT8wNX%*EmFXj6tgQ_IG@~-nnBncPuvcXfKpox_ zEYPi?XD_wga&4+;pa?&JrY}^`<=V*BtR%UewFFZ)W~Nv1`$cx*#QeO>CYc4qhO>BA z?`dj;dQhHuAd0V22n$SRBKu&lqAjFmht3^h++D+K>lXnuftUa0tz)lVEe0MLc4=cY zA5jT-K8+NZem)a?!*(8Uh$fHj5bmZEdw(ol7E-bE5Rivmf@*kKdkH>liK${awsuyN zdV{i-af(`idf#qIYIjF_k_#yEfz1y&|4!sT4&)7at!dK$Qy)O~AnVH#veg@R1z>%*xx41q@^9 zU*^u7i$&ssq)SXPF$cWK%~V*6n}HGr(&?v(@l_w7YG}L^rxH>P2ImH{6?{mo${eu_ z2J?qO=va%fpQn-YIr);PNOzKM=S>g#@z|pgCaVn==6)8P0fdMdI5oBGe!qtXTEv71 ziMDa7`U#%Ln+8XFYZUv1Xt*1iDabhkp}5FQG2nV=3tHr5Ak3E z1LAr@U@q3cIHRz+ai9(Q2cYfgb`Z)DPCkzFldq`K)xZXmtx4?4LX^7nJtp%O!EECz>76_#34?rQX7-CnlYRNe?-^-q zl@*hXEH%^H;BfC!pqEW4e>FULOb^_|&dni!`ueUrOY7(p8hXcHWiqx1P0B@u-vRh8 z`%&q%F&%As7saT#-Xr#ck>8gEOh?YBQ5Uj zlzaJf*TGs%Y0QTEs|u|C$e)Q3kYAI>VquUAnSm=JupxGH5smEs0RL$Wx+jFCp#UlE zMyNiq49asl&DsQ;!{34*5az1txA9j#JcvpU<7>l3RmF6OL3awB0q6m^Q-mvhM-BZCV zvvGiQ+!2Fr`tST2Q&!@=y!t2YlF*snvY-|wPQ5>KDQP+nr3=;|?YCM~CC4N=eEG+m zlaY8c=z>}GU~5-w%KX{7%sL{&YkefElA?3_vX}CL@d1sBAHS+BQdI+W2*tG&L;_4L zqFRMt|I2nYWLv#PE^L}){2_y56@T!Id;<4z0bba<0l+|-Ab6A6sZwEHmAoBniO)QE z-Sh@B+D>nvkKfSK{g_)%UWo1i6qqXYL>KUWs#L^N*wh^> zzc;|cRDJe=mrs7(^3%E!#^_mSf)HLw(*y7Ma80Mzd;&z^VbV+wG@jLenI-BTGGmTc&;LLFcJTjv>>I_MMC6>f1zunJKj1GHAO%@v KneS4jAO8==>R7G- diff --git a/packages/website/static/img/squiggle-logo.png b/packages/website/static/img/squiggle-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..5a29e1682941102ce60717b2d30bc891b2be859b GIT binary patch literal 12896 zcmaibbwJZ?_cuADRg^|jLSleOjGQPTAQ-gt28X1!^toc=rNMnodKz{b5)u-6ZLK>GiGQ1julfrB;``B% z?h6tUN@Lh#6E71zU638zRl)`Ww}ndhxw;eSBqU0ze(pAQ&QLENTc`ufO_^`Ap_z{d z22tiSzNIIr=dKQQglPqMKpzF%e{2`vY^MO>Q&pi+@&ge8T%lezJbtb&Zk`}NWxhYS zAmZoq$3Q-wKP+C(%6ukz20ZF;4=B$qiCYqqd@3|NN*)k<(8D_#|Cmf1Df2mcdAWmt zKwn>93E!I%a1RHdl!Af+P*NHwEiF#u5cl+V^Rn?1ck|>whxiNQ4%E}m1Lp1pgS+vZ zW7^oly}gwA_=t3#e}F^m{)O%C?cwqV8Da;7xyZ=k6zlr!4`M)L--TgmL@w0LNpP2RZ z{@?7bu75Mb)9bDe(Q*F>!ryfIrvT5#{_arVL#QX*+rtie*N5mm{y&a8_Y24X<_C2# zxdS6Q)sq+vWj-l+h5w6c`ZucVzp3hQ7r4hGVj4n;)BZd@_Z>*v)y4s841;(%{u}Mz z1YM|`!(WuYkp584wR7=4PX|Lc7||Z-f1{cFo2JYsCk^}$L8kvB>0hw`{n1Yk4k4;{ z^AF&^N!se_1|D#Gm=4St$isS#fEJza$U?2O`de+56wI@gj0bOA_;0 zQchf2=CPCv=$14{<`!`Xl9c>|{D+%ZKM)%)oBtpGc@^*|LF__-j{|~v3piloU_fHw}@ccU>;J1FFjy+jNC zqI$yZy?kvvpkN1LUMcf|?d@U22>SCFoEHoau}CE)ZvB0RuOpO*_P@Im_@AcyQ#B>v ze<}Z$<^R!1i1Yq>M(j|;RtNl7uOklr)h(fJ#1`p6?1f8?kNHVRNW);nO!%)1AR!Ts z^^P47z4PEor>ebU+l6c~F+utwUe$Xp38~NGWHi`Z=9J*}BaK@Dn|kkD5=-8pJ6Hv8XL&)@7F9sY*^i78x;78{v#hl}3{&ZUr-;Szz0uPeNq;;pAb58i z0_kcvIh!^Xot%F3af4C49Xa3lISfv&GS0OWjD4!YhzVqLn6y0|x<+Vzg|-|CZ!l<} z5n8${UQU_sJQ(C4ocCMYzg@XoK#3cy$H^{{?NmBgnH9_c=dI?m@+O^D9F$mcUTP)@ ztasQn?bwVbE^5^7TBe>PB(zNDFH(|s>8vCqJS5t8z>odX*E9SZuN!)AHWzKI$7aGl z@h;vNFeQ5{ugU#BRQiSp&IjdK8@l? zp7$up&<|~|&o%F9jw<9oZ}K(F2<&gFsjE`SdR_@%pQ;+4!-L|7octcR+3p+ z52rM->^ms_;5T1sb_vAGvd?Nt?L#8P@E3`>9Tc-tKqx*9}!| zuPAEY1zlO$jG3l*hd)|jFxZy4nUv`zefcHq zkzct8QI?-YJY5Ub`WfaHgM+AvU-5ha?XQ-KeYas zF{I#B%k-ENm0B5P^I4$s5J%O)$OnyVA0l#6Z!l}as9WQP%53u2YU-R(t+JuTM-ELI z`ACFR6iaQn`8r_X_f*ztbtlhBxoj3l)a_j793I%)5}%xO)q+MGP(1)Jv^k)$&T!Z+ zCSnlC9)_iv(=cj4yLn?Nyns2LJHz=UtVTrgUGaY2*%zPTpYgJvrdq0G-+ z>aCbu6_*uTGCgMDYR0_lT-<*GkMP6`#bg#mofYre#1m`nVXO*Cy=xAh!J(?sBdz{K zMVVy9&AZTN&^PYYjKhPZdd{njt>){z7+;8_C;@@B^oZQ%0~N1K;aI zw1jyfZqDJ)NOb(;9C1|C65U*0XMre7jb7+Y8I07kChjW$lcdiYA*qeg@fz3b<(6XY)iwuvVnA5ADgWDuJCGknSeOba) zN2P!!Lsj|mil4Q_>4jR&8XI|+8aVk$u%4}Ajb*&96owwVM6({>tp~sYzMHH+obA9V zss~t`HW3}G^u8z-tqMr~U{a&d*oP^bxy9U-@$pP4`_mt|R};h4>*T>uI*Cpfoa+M# zm$cg(Z~af62bkU$icA^I>|a`(=vciM>n#6z|&y*n^xLHeWvb5dXah@*)KRB zS-b^65B7Gd7YY=G%hW(JW#&}DLYKY?#rpL3k27GV2?7P8(YlH+GJ9pLaeeaH~`L*r1E`cTr6t#$JGL3h5QB z=og9aNo(bhFL2t+xbq8mbK_jZklWyB7mU<&{jh#C*f=gw=sr-xlppdgC zbo6sB@u@8hsmkY-y?svU4my>X_+Xr{PTlPkgeS08yPgZAsdk5NktjG{bR+1eLnky1NAyO)^9}c<$>2U2C_* z!(#v@at-c}pTnlzQc z#A>FFa$$3KWF*+*9LCVp`;x_@Zq$fUiP^q_`|oXgE>Xp8ue9Pg!hLY9#U(yZiNO>P znI&fYm-i4FPo3Y)v$O~^7I$$>G-mpXlV(qtD^XvHyA_(O-4zw0k0_dxd-AXEOPORB zjF!TS>PwJlrn0r*ZC>i3?(p2jt?yL0Jxm_&{s&~u*1Hq0s{D&LL(gNZRl#1@8hQuf zo*d-&nirFGtFhgq;nvagrK3fP!?bIJmlVU&y(QAamvuS7&XRk9DM@+0^3PJIpTpRP zy;IUiT{}N}wnhwiR#B}$KJy)^i)lZU&7IOP#iwZu2!H894t5^gL>uLp*(gwT)- zjMs%l2GUusr}6^PS2hfghOF_zsanZFarBly=xSIdD7(+BH*DMX;0Qv4M7!7IbK1<1 zp4!9dZna&sjg#_FR(>w&vdDf?PvsJZO4l2=x1B&=>~m%A!v42Anw6h+yPsWRdeAe6w!ayjWDMj#BF8j5@p6<>~JQaETE0!R2G19y{9);iU z&mK2> zCbN1s{odgeMMWh45nqKJCh1<%4GDhlK`LnC*8|Y6WY6h}dgMt(u;+qHb9@UrG>)nI z+R@_9mZk6I_|)-PJN}Bj&=T?9Fb5SXPveY%)8mAt_-8-TmzEw~!9o@bp-Kw|vreX{ zG;8KT_22T4vlnaG!lvQ9Jo&m8g1+K}DoIqq6}P%J$aldB>2*63a%F6m`R(Fy%9kgV z4WzYUy=h3R^k$ms(Y&8);F#qnyx#hbi41!5;5pJ!?}=#n^H_1~SkiRy%$%u1L6x^-eRCRJN|jN~gx z9z<X>VGTd{7D_oM5!4el!UqnJ{5NFJ@A6k@X8%MZ>w5aYTVL<_tLS)2K5GYh z4q?6|Tk%BYKPeXd>7zzVM72OSa1NVGD(Ab97CJcf{%Dv%xQZjHOM*DFs=y7Bdm_36 z79n#wKCellrc2fow!5eYZ>7lE-V3m^Od-c6R>@>F9XPvfMXgs??oV#k|HkdP^i2-n1Nrv*H5B&!89%l8{Q7=LweX*W;UBeS+Q_Xh@(5dj3*9bzXl!74$8zNaz(67 z-nhH7j@e_pbMaUZ{FE~Y3AtX8&lfmOgd7ns-F~@d8K->py3td^54dSOj>;nEvSvaH z{6al&qMaJXGEyryKD*Kh08w}vACZ4``o!exeO&q)I|^gEl5CL?7nP9I{Bp%~bs(@C zu0hj>5NojVA7Ll%-3gj0NhuC0NQvvWJPlTVwT1t#Y+a_>UUuS3S(wctHC`^xBSjbl|WB*_6bM$&=qyz`MJA z3CFw>Kdl>&yQ%#bE2XJ2MXRxTeHO7CxnMSv^{KM#1PflOA-W;CfO^gBx&Wt&X`k*$;Fb+rWG{5twVEy1u)PgeC-Ovfk#nzb7}-> za#E1F|nss`Q%whYkUxpJ(ApHgk@ zOa|y-lK2BV&m(p`HjkB;x|g!c5vyz|07P-uGB1rYqUos-X(;(G518=OF7ZCdqr3Vi zpK_C%SmOfu(_E4iftj-p@C)RsHGOuMe&Ch_MLljqUD+m(F-;tk<>t{Lt?$V~#<8d0 zFLlj@uVuFD-s9R=XdSt5?9|ZLGEnv4Y3v0g_bJKrwH(m^J8N`U-EK@4_Uf>`ZjWTD z9NgTuW+Y3oj6yN7ab5D@Yzj5O^feUJ~-=#fu7~|WB@tXMCM>@#3 zb3l7!6xOEgjfm>J$FnvSI%8?jGQ=Xd^X^TuzD@lX4%Pr>gw(5s+;6Db86SD!QmaPh zWjowkYoFo)n}F-J*y5w#qRhvw%ZizSw&5_!<;fI9+TpK57As#SWN3wpS_=IaZ?d{G zhuf-ZBJSVYwopilj$g|W0aP|))?hwUrCEfIg5|lc%%L-`;6~9+V~1&_=r;$%esc7^ zju2tB%e{LrWS96PwKw9|UUT<{*TGzLE%S665!bn!7Pdk{uH|KwDeff(Hn#OuuKDf8 zGiYqIV63c_NUw_?dXhYzX$&uV#Fh4AwI*ub@^EX$Js-FlIisZi0s)HOoIX{aO7jsyjJ9R=?2(v z)aL_6AxC8PLiy;g_mW)jCrC`zQgsv%(`fWIM;!oshrd?n+j~6+_zG$yIg!b1s^j;A=5x|VDmP-BH zperU-x>T_v!$uagx;}OJc%tE{67CU5fjoI60Pmb_`gTSe^C67;_U~Eq`|{h)&n3){ z+ADpe1t)h2`B-{S-`k*j?$2!Y0J1hNy2-{rZ;E(>5?Jvp`71c^-S@(I>$Jmd} z$k|Tl2KT<&DWr_Ni1_7{Vco@(`fkqZ@U zi8JgfAAWX$oea`B*#w_4}8>Ng9MYsrJPIq2TD5Rcv|D@!% z#ajrK3?w63CgVvJn)LcQdh4~` z`jmebBX{3an|#49nN<@>R|l%aIhTQRpki9ok^bPw80`>X;Qbu*M@=&5kE6=yEYff87~XX$ReBS%1r>p zZI|Pp*us_srK42B0*qY-W{1!l-dlR3k-%F2H{ytXnn2=;iB+Igt>3d^@Osf6KAC9C za<4zksWy?aqT43UTtV0A<41$7ICipTRd+PO&>wR|{%!drIU)=OKyWw$?1m#dxH$v_ zlLCfN&gz4YXP&)c$ZW_p&2r$HaFBQ;^J%Xa&UyS?LP`a%Bk`1H-IO#7!JUCiw%47H z&D1}0?@eN45r!}gxmy?FjDyjOIF?}a)GeimZZ6%$;u0v)_Zhvy`z`S`dK-eCpN zi&&GfXp^yy;s^%=Kr^dA4SBP>#|HV{)v&$M4drES@UCn2V%Y7iAr>>>gH6HDVR=Et zg*_udTW0h!SGk;up$#&QtjDhy?tU=n%^3;H@{}_V+hmm720d#jyBQ;epKd(!Kp};M z=fdLP*F&0mjw;Ho5rjx|o=3&Bk~2}MRtnx=+_&cWf-|ReRB{V18-P0A0DbNQEO_Ii z^=@(%uFL8#FrR!6z!z<&9(2-UYAy&}!e{$=R0FWmO|&?x=TAjQQ)`{tOM0X%^)hkk z8wVcW%g8G;k17)jneP=;iB;X)w<>?Ke1E|NiCt8rI9)Q=N0jqwy?tW2a9>Mmx2I1~ zTBz5>eZkjTi+zAR}4GZ=up{h9Z`8gW7jr8xdt{)-OMYBKmioihmT@`>Kh z_je<9!MCtWpdzv9Gy(%Oe`bac=GvVV@1xh{3|cjIr6O*RYI9oC^T696nb+_`A-Dkg zWhnROBpFKVjr4tbh#5mic-17z=-`Y46P(GO`V3Mbal5pZx-QI-0Zqkjb!D?MsiXqj z9yX~ugd*@dQKI#Iu@eb1Xm;n+-E!t**-Wr(QZRls{D<^D8@)HUd>`)R;t{)IgJ#qVu zE}yy4HG-3Z94Ni6wP5Whd?nCLv?to1@=%V*&Jun!7mPlCaldSq%?m$eJCm z@Zod>6zP5E+GydIZ%MORbuT_;3gX%g(=TZK@F{5$L(I=8dRvfRF|=F!!m8wtQIy^f zj-Kk#5~>oe&+m4-gkdae;Lv4oCKucaS8`ky^z-_t&ue61d!bG%SK(uNW62PTtcG%4 zT_!=hTS;`1y_UL(p|coDJnhEUVe`PA!I`Tvj{af+3$|l@g+lUNSDFB7iD_rpYJ*t*Yw|e(S&nJsL!vu%fvtAOv${x9S`WsYAl~1 zVcZ`rPbI41$ZNtHbVa@;jLWI$3n#A&d$oicE34cT;c&# zE?Y*j55p}>|IU*s)XzY7=G$$-u#zU^ZX%2hK`-+FZ&yxgh!?rPxUNjkUV&Fv-nZz=X~UFN zPjepIHhAJsdzx6Wn%y-pk?t!#3V7vDsa`&s$KPbGkDlCHmkp%1Ml`!{jLs8_w_0%^ zi?nbYoU4*FRnjOfKb~cuH7K$=xX1)*U++`Ro*(AT31s40GlP_w{;ufRtByeL&80Dt zMDm+IRCwgcoDJXlaK2V>e@c@1v|j~&IyrS`2vr3#`7S@Ni#!~QB;U%VlYLf2sI#l{ zNuz9^^Z_st3BFq zr(hRmIJ`LK5u%M`$e}y^#E6jdqa!wf$}6^X$0jZY`RXFFj>&)w(mivW(({CC1cq7) zc}|meJ2`WD%ii)dh;MviyE2Z>&Z&kRv)g4&09HN@3R)ie0FHZ^O@!B3dN*?fNFGh7 z;GS4(+7tm%Z67IaX5t(!E+-)Kz;zc{1IUXWHYB2IIoH_QE<9p?DCb~78HBV|dwF)* z(1!^XkT+&_%!vG0o=JE}5ok9>DT%33RPVzSudUm>3!61|D zS<@VFnaoUN=onjCnnkjo-lh>ZmhythV)+ z6M&UcEFz+T5?IeOHk7U6-I~IFy^q!AtAdYrb*AY`?`d_r@qu|$hqEW_g zeVCg&%-+h-o7Law3t=a)YgwY#yj5Adg<|4@Y-py*f*3A@Xw|}R+1rVqfDQShtST-v z`P^V`c5x-XL0&p}f0`-h8yj*Sy?3%_kr*^q;o%Ll6DRl8;aJ7NYb2>GxsKOmhg$-x zJgv{di}4YdNv)mucX$RI0%OzCG@_Ws5yVUOYD`cueo2V_-D+UjEblO?W`MYv>97yW z0q@=RNOaG#MC|T4td9}es7}hXRb>O0(1I!}8CBmB6Uxm;%FoZso(=4uRcR8>KaP>T z3r&j|R!*mvu4T6p-_!I%)D82IPehPinG^AMc=6T(A(5GQpj>o!b>)gZ= z+_x1iV=!WkipT<7pU=*3kQ1JZoZ#~-k39~T(&2xR|E)7Dez~LyJ`6Q?q436;LgYD9LgnIVxR=p(AOSe>|+DOMK~E*;L+v&ISvj~VqgSuZr8 z3BZzl_J_a3g7q!$)&Ja|U_QDcrsm{o%iNs8ovFv}CAQhTX7N&|0BvgCGi372o7H6h zLGzi%wP6%PIk_LLz>=iq&=s6>Xbl-7LfkXK0O9;21KiSL=x=SS ze05A8?Jon)G@F)OhqF)(c8J5~pA4-YGYf6)y8Fm=y%wIX~p>PrK%+Tkh4n3>v@&*Sk*XujiKq zZ8i_E;Ri1Ugo?NT_JwfsIq>_ALRazXlFwU!Yr_;l2bevz`PANJexH&SMz!JPpB6aS z;8z4Go+|jtJncdPoEOGl)j_0RqTDsb*Ru>Sq+IjEP^nDL`Mp(RH$TkOwP~iXBzw{#IdDUx#Jwqk z`>UBzsl+wsm2#)6&MOT!D7{$w%`|2xuzhtX1}IB`SNbc4Q=haI1Fp1ChPb%k)Cg4@ zbZ8_mYT&18STm`cTeCCUk6%9-P$K$nZW!fwbIK4C$KpXZXZ+F8sM`D}?+?L|Ul-+9 zoV_owrfCSlYiA!$@;2xauWC6~9)7R3ZQYR1c-zZOy2&4`{aB~ls!+M~KCeD^Z5u#h zslDAR!mR2#7 zIXy8JLD3caz&8lu(l0|=Wb`TEnkaL~*6OFRilD@gJ%B{-kJZz*{#rvPWhF5^_MH<-(`wAZhDS`&NR~kGB zUR{UFpMC;C7qG6OTjw z)ML+aNIV9?uzeQR?)>HRsBW3*Nw+WB&M&S*l)s#yocbl9q^pt554gft#VmR=vTFa< zm~_3LI5USqRZ;|{d8>KP^mm6)AG_`|o;{D212JnhP#{yBhzk{-5(mpEV}gk^t*OoG zeF#d*PElS~At&A_h;aO@qn7U(AW?u|@9aMQ1S~!nQLLtaIgs9^HJjE5Deb?MpouSL$bZK_v-k2?%iBCr-O`<-BxeMk>oT(m`We4`4 z1FzKiC^KTu==|6^7{?G>#R|d8b|cdHNh-kMWntU`#xC^gNaI@yytz*F)gqG~RFq7h zGh6k3`2^~I34erjCS(ppm7+mKs?X=`zd3l9$~PKDY|j#_gMz|t!NVWL_XE|YC4;Yca?1_tj|DGm?&=tK2yN3SV`Scu z5c^YX9x(A893Kp8Q=n4i>Rib z;wt{A?Jy;+_k{NN8x*O5KQ1EIvkOpJl$dn?zMa=8(?qMme1+hjszF5-qIbCa(>q5e zsi?*6k)x7C=V=0fYYU0Jnc|bO;?&zjI-D;Tv_09-3CgC`ViqGPcW*3Tqf}zrCm&)$ zT{shN*&|T^;T@9cosL$KMbmK&6v!#c^! zC^w!IjIbZeinK+<12Wo=fO}!+h?T??#M?UJIesa%ChfH@$0QInpi>>QZiBHRVH8p( zO(NInpgo<*13MhxYFa;&d)9;^!d9kJRG^EeOPI|JQ1u>q6Ig)-GX~?w$sXl!KT~{5 zP(E~)6z`n5LwS5zfR^D{u*I1($YzRu%6?IzlW62Mt&le@1EJ|XE(V0RZamKMVVhc&z(A=QreR;nCi0mGs*|4r zeZ!B%{OV@au<@|Z)U}Fvfz}(2gAeSdUep<;2ueE*|?OFbgOcIz8g^02zv}TBYrzZHms0R z3OHf#thv^BKpiDGD^F85dwVlpRA{#tGjk-6qcCEK%!^sc6k^QVCXJu zkGDAE?zed-HB7hY*5bvntfAZ7GED^FzbVQ&fM zbBpdH+{UXFEnO-bvsZQ6gO_h!H}xm`{Oofhr>FMHy>iB3I>)Tk>3DDxZG1%yWlT#G z)eM7fGylnP@72^akNDJTYd4m>G_`T;_wnep@WD%8-$$qj8kfvCDMX<;J$t}KeKHX% zYQ4%Np8>;Jb|6;IB=WPG6p1!3{$B{}IJnli$O@)Lr#>V(Y WvZnVA-_HLrMEmajJEga+!~YM=$BMoH literal 0 HcmV?d00001 From 712f393df6931237216f491b78a2b0816f842b5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 14:22:11 +0000 Subject: [PATCH 087/203] :arrow_up: Bump fast-check from 3.0.1 to 3.1.0 Bumps [fast-check](https://github.com/dubzzz/fast-check/tree/HEAD/packages/fast-check) from 3.0.1 to 3.1.0. - [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.0/packages/fast-check) --- updated-dependencies: - dependency-name: fast-check dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/squiggle-lang/package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index e12b363c..fb137a39 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.0.1", + "fast-check": "^3.1.0", "gentype": "^4.5.0", "jest": "^27.5.1", "moduleserve": "^0.9.1", diff --git a/yarn.lock b/yarn.lock index 9255e6a9..64cdb8a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4796,7 +4796,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.9": +"@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": version "18.0.15" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== @@ -9207,10 +9207,10 @@ fast-check@^2.17.0: dependencies: pure-rand "^5.0.1" -fast-check@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-3.0.1.tgz#b9e7b57c4643a4e62893aca85e21c270591d0eac" - integrity sha512-AriFDYpYVOBynpPZq/quxSLumFOo2hPB2H5Nz2vc1QlNfjOaA62zX8USNXcOY5nwKHEq7lZ84dG9M1W+LAND1g== +fast-check@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-3.1.0.tgz#0c958b6592f45fb66ea291a0bd1be2e7045f7e57" + integrity sha512-LHM6ZiznfQ5ZxReDUZnlKzSI/nlwCdfwaQ6qrCYBIkuWT6PfI3GOK/O2Xj50DF9oC0HIP22vbbHA8v4itAiyGA== dependencies: pure-rand "^5.0.1" @@ -15225,7 +15225,7 @@ react-vega@^7.6.0: prop-types "^15.8.1" vega-embed "^6.5.1" -react@^18.1.0: +react@^18.0.0, react@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== From 3d2b2f4c622458d2eaf9c7a4f419f540d345d91c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 14:23:47 +0000 Subject: [PATCH 088/203] :arrow_up: Bump @typescript-eslint/eslint-plugin from 5.30.6 to 5.30.7 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.30.6 to 5.30.7. - [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.30.7/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/vscode-ext/package.json | 2 +- yarn.lock | 76 +++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 22 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index bd9ca529..bb5bcbdf 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -139,7 +139,7 @@ "@types/glob": "^7.2.0", "@types/node": "18.x", "@types/vscode": "^1.69.0", - "@typescript-eslint/eslint-plugin": "^5.30.6", + "@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/parser": "^5.30.6", "eslint": "^8.20.0", "glob": "^8.0.3", diff --git a/yarn.lock b/yarn.lock index 9255e6a9..91ba0f15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4796,7 +4796,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.9": +"@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": version "18.0.15" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== @@ -4972,14 +4972,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.30.6", "@typescript-eslint/eslint-plugin@^5.5.0": - version "5.30.6" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.6.tgz#9c6017b6c1d04894141b4a87816388967f64c359" - integrity sha512-J4zYMIhgrx4MgnZrSDD7sEnQp7FmhKNOaqaOpaoQ/SfdMfRB/0yvK74hTnvH+VQxndZynqs5/Hn4t+2/j9bADg== +"@typescript-eslint/eslint-plugin@^5.30.7", "@typescript-eslint/eslint-plugin@^5.5.0": + version "5.30.7" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.7.tgz#1621dabc1ae4084310e19e9efc80dfdbb97e7493" + integrity sha512-l4L6Do+tfeM2OK0GJsU7TUcM/1oN/N25xHm3Jb4z3OiDU4Lj8dIuxX9LpVMS9riSXQs42D1ieX7b85/r16H9Fw== dependencies: - "@typescript-eslint/scope-manager" "5.30.6" - "@typescript-eslint/type-utils" "5.30.6" - "@typescript-eslint/utils" "5.30.6" + "@typescript-eslint/scope-manager" "5.30.7" + "@typescript-eslint/type-utils" "5.30.7" + "@typescript-eslint/utils" "5.30.7" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -5020,12 +5020,20 @@ "@typescript-eslint/types" "5.30.6" "@typescript-eslint/visitor-keys" "5.30.6" -"@typescript-eslint/type-utils@5.30.6": - version "5.30.6" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.30.6.tgz#a64aa9acbe609ab77f09f53434a6af2b9685f3af" - integrity sha512-GFVVzs2j0QPpM+NTDMXtNmJKlF842lkZKDSanIxf+ArJsGeZUIaeT4jGg+gAgHt7AcQSFwW7htzF/rbAh2jaVA== +"@typescript-eslint/scope-manager@5.30.7": + version "5.30.7" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz#8269a931ef1e5ae68b5eb80743cc515c4ffe3dd7" + integrity sha512-7BM1bwvdF1UUvt+b9smhqdc/eniOnCKxQT/kj3oXtj3LqnTWCAM0qHRHfyzCzhEfWX0zrW7KqXXeE4DlchZBKw== dependencies: - "@typescript-eslint/utils" "5.30.6" + "@typescript-eslint/types" "5.30.7" + "@typescript-eslint/visitor-keys" "5.30.7" + +"@typescript-eslint/type-utils@5.30.7": + version "5.30.7" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.30.7.tgz#5693dc3db6f313f302764282d614cfdbc8a9fcfd" + integrity sha512-nD5qAE2aJX/YLyKMvOU5jvJyku4QN5XBVsoTynFrjQZaDgDV6i7QHFiYCx10wvn7hFvfuqIRNBtsgaLe0DbWhw== + dependencies: + "@typescript-eslint/utils" "5.30.7" debug "^4.3.4" tsutils "^3.21.0" @@ -5039,6 +5047,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.30.6.tgz#86369d0a7af8c67024115ac1da3e8fb2d38907e1" integrity sha512-HdnP8HioL1F7CwVmT4RaaMX57RrfqsOMclZc08wGMiDYJBsLGBM7JwXM4cZJmbWLzIR/pXg1kkrBBVpxTOwfUg== +"@typescript-eslint/types@5.30.7": + version "5.30.7" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.30.7.tgz#18331487cc92d0f1fb1a6f580c8ec832528079d0" + integrity sha512-ocVkETUs82+U+HowkovV6uxf1AnVRKCmDRNUBUUo46/5SQv1owC/EBFkiu4MOHeZqhKz2ktZ3kvJJ1uFqQ8QPg== + "@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" @@ -5065,6 +5078,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.30.7": + version "5.30.7" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz#05da9f1b281985bfedcf62349847f8d168eecc07" + integrity sha512-tNslqXI1ZdmXXrHER83TJ8OTYl4epUzJC0aj2i4DMDT4iU+UqLT3EJeGQvJ17BMbm31x5scSwo3hPM0nqQ1AEA== + dependencies: + "@typescript-eslint/types" "5.30.7" + "@typescript-eslint/visitor-keys" "5.30.7" + 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" @@ -5077,15 +5103,15 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/utils@5.30.6", "@typescript-eslint/utils@^5.13.0": - version "5.30.6" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.30.6.tgz#1de2da14f678e7d187daa6f2e4cdb558ed0609dc" - integrity sha512-xFBLc/esUbLOJLk9jKv0E9gD/OH966M40aY9jJ8GiqpSkP2xOV908cokJqqhVd85WoIvHVHYXxSFE4cCSDzVvA== +"@typescript-eslint/utils@5.30.7", "@typescript-eslint/utils@^5.13.0": + version "5.30.7" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.30.7.tgz#7135be070349e9f7caa262b0ca59dc96123351bb" + integrity sha512-Z3pHdbFw+ftZiGUnm1GZhkJgVqsDL5CYW2yj+TB2mfXDFOMqtbzQi2dNJIyPqPbx9mv2kUxS1gU+r2gKlKi1rQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.30.6" - "@typescript-eslint/types" "5.30.6" - "@typescript-eslint/typescript-estree" "5.30.6" + "@typescript-eslint/scope-manager" "5.30.7" + "@typescript-eslint/types" "5.30.7" + "@typescript-eslint/typescript-estree" "5.30.7" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -5105,6 +5131,14 @@ "@typescript-eslint/types" "5.30.6" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.30.7": + version "5.30.7" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz#c093abae75b4fd822bfbad9fc337f38a7a14909a" + integrity sha512-KrRXf8nnjvcpxDFOKej4xkD7657+PClJs5cJVSG7NNoCNnjEdc46juNAQt7AyuWctuCgs6mVRc1xGctEqrjxWw== + dependencies: + "@typescript-eslint/types" "5.30.7" + 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" @@ -15225,7 +15259,7 @@ react-vega@^7.6.0: prop-types "^15.8.1" vega-embed "^6.5.1" -react@^18.1.0: +react@^18.0.0, react@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== From c91defc30713d1d28d18b1a4b605ca92c7afa681 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 14:24:31 +0000 Subject: [PATCH 089/203] :arrow_up: Bump @testing-library/user-event from 14.2.6 to 14.3.0 Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 14.2.6 to 14.3.0. - [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.2.6...v14.3) --- updated-dependencies: - dependency-name: "@testing-library/user-event" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 043423cd..4311bb69 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -34,7 +34,7 @@ "@storybook/react": "^6.5.9", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.3.0", - "@testing-library/user-event": "^14.2.6", + "@testing-library/user-event": "^14.3.0", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.182", "@types/node": "^18.0.6", diff --git a/yarn.lock b/yarn.lock index 9255e6a9..3aefd9f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4378,10 +4378,10 @@ "@testing-library/dom" "^8.5.0" "@types/react-dom" "^18.0.0" -"@testing-library/user-event@^14.2.6": - version "14.2.6" - resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.2.6.tgz#9ba313a212994eea66e018520e23542ac3eb6fbe" - integrity sha512-l/4W4x3Lm24wkWNkPasXqvEzG+a6n2X872XCUjhyfbNqcoOapaWyCxC5Fz+E4r7JPu8gysQKSSCrK0OO2x+D+A== +"@testing-library/user-event@^14.3.0": + version "14.3.0" + resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.3.0.tgz#0a6750b94b40e4739706d41e8efc2ccf64d2aad9" + integrity sha512-P02xtBBa8yMaLhK8CzJCIns8rqwnF6FxhR9zs810flHOBXUYCFjLd8Io1rQrAkQRWEmW2PGdZIEdMxf/KLsqFA== "@tootallnate/once@1": version "1.1.2" @@ -4796,7 +4796,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.9": +"@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": version "18.0.15" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== @@ -15225,7 +15225,7 @@ react-vega@^7.6.0: prop-types "^15.8.1" vega-embed "^6.5.1" -react@^18.1.0: +react@^18.0.0, react@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== From 26a6f06c1a2f43504fe486af817ddbb743d986e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 14:25:33 +0000 Subject: [PATCH 090/203] :arrow_up: Bump webpack from 5.73.0 to 5.74.0 Bumps [webpack](https://github.com/webpack/webpack) from 5.73.0 to 5.74.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.73.0...v5.74.0) --- updated-dependencies: - dependency-name: webpack 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 +- yarn.lock | 28 ++++++++++++++-------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 043423cd..7d068d85 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -54,7 +54,7 @@ "tsconfig-paths-webpack-plugin": "^3.5.2", "typescript": "^4.7.4", "web-vitals": "^2.1.4", - "webpack": "^5.73.0", + "webpack": "^5.74.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.9.3" }, diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index e12b363c..a722e8c2 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -69,7 +69,7 @@ "ts-loader": "^9.3.0", "ts-node": "^10.9.1", "typescript": "^4.7.4", - "webpack": "^5.73.0", + "webpack": "^5.74.0", "webpack-cli": "^4.10.0" }, "source": "./src/js/index.ts", diff --git a/yarn.lock b/yarn.lock index 9255e6a9..79ccbe8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4796,7 +4796,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.9": +"@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": version "18.0.15" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== @@ -8577,10 +8577,10 @@ enhanced-resolve@^4.5.0: memory-fs "^0.5.0" tapable "^1.0.0" -enhanced-resolve@^5.0.0, enhanced-resolve@^5.7.0, enhanced-resolve@^5.9.3: - version "5.9.3" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.9.3.tgz#44a342c012cbc473254af5cc6ae20ebd0aae5d88" - integrity sha512-Bq9VSor+kjvW3f9/MiiR4eE3XYgOl7/rS8lnSxbRbF3kS0B2r+Y9w5krBWxZgDxASVZbdYrn5wT4j/Wb0J9qow== +enhanced-resolve@^5.0.0, enhanced-resolve@^5.10.0, enhanced-resolve@^5.7.0: + version "5.10.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" + integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -15225,7 +15225,7 @@ react-vega@^7.6.0: prop-types "^15.8.1" vega-embed "^6.5.1" -react@^18.1.0: +react@^18.0.0, react@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== @@ -18484,7 +18484,7 @@ watchpack@^1.7.4: chokidar "^3.4.1" watchpack-chokidar2 "^2.0.1" -watchpack@^2.2.0, watchpack@^2.3.1: +watchpack@^2.2.0, watchpack@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== @@ -18732,21 +18732,21 @@ webpack@4: watchpack "^1.7.4" webpack-sources "^1.4.1" -"webpack@>=4.43.0 <6.0.0", webpack@^5, webpack@^5.64.4, webpack@^5.73.0, webpack@^5.9.0: - version "5.73.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.73.0.tgz#bbd17738f8a53ee5760ea2f59dce7f3431d35d38" - integrity sha512-svjudQRPPa0YiOYa2lM/Gacw0r6PvxptHj4FuEKQ2kX05ZLkjbVc5MnPs6its5j7IZljnIqSVo/OsY2X0IpHGA== +"webpack@>=4.43.0 <6.0.0", webpack@^5, webpack@^5.64.4, webpack@^5.73.0, webpack@^5.74.0, webpack@^5.9.0: + version "5.74.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" + integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^0.0.51" "@webassemblyjs/ast" "1.11.1" "@webassemblyjs/wasm-edit" "1.11.1" "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.4.1" + acorn "^8.7.1" acorn-import-assertions "^1.7.6" browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.9.3" + enhanced-resolve "^5.10.0" es-module-lexer "^0.9.0" eslint-scope "5.1.1" events "^3.2.0" @@ -18759,7 +18759,7 @@ webpack@4: schema-utils "^3.1.0" tapable "^2.1.1" terser-webpack-plugin "^5.1.3" - watchpack "^2.3.1" + watchpack "^2.4.0" webpack-sources "^3.2.3" webpackbar@^5.0.2: From 6f1f23108b169301ac83f3d09b9c286b2b6e929b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 15:46:51 +0000 Subject: [PATCH 091/203] :arrow_up: Bump mathjs from 10.6.4 to 11.0.1 Bumps [mathjs](https://github.com/josdejong/mathjs) from 10.6.4 to 11.0.1. - [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/v10.6.4...v11.0.1) --- updated-dependencies: - dependency-name: mathjs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- packages/squiggle-lang/package.json | 4 +-- yarn.lock | 40 ++++++++++++++--------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index e12b363c..411d19d0 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": "^10.6.4", + "mathjs": "^11.0.1", "pdfast": "^0.2.0" }, "devDependencies": { @@ -55,7 +55,7 @@ "bisect_ppx": "^2.7.1", "chalk": "^5.0.1", "codecov": "^3.8.3", - "fast-check": "^3.0.1", + "fast-check": "^3.1.0", "gentype": "^4.5.0", "jest": "^27.5.1", "moduleserve": "^0.9.1", diff --git a/yarn.lock b/yarn.lock index 9255e6a9..f639f511 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1562,10 +1562,10 @@ core-js-pure "^3.20.2" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.6", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.0", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.6.tgz#6a1ef59f838debd670421f8c7f2cbb8da9751580" - integrity sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ== +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.6", "@babel/runtime@^7.18.9", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.0", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" + integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== dependencies: regenerator-runtime "^0.13.4" @@ -4796,7 +4796,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.9": +"@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": version "18.0.15" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== @@ -9207,10 +9207,10 @@ fast-check@^2.17.0: dependencies: pure-rand "^5.0.1" -fast-check@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-3.0.1.tgz#b9e7b57c4643a4e62893aca85e21c270591d0eac" - integrity sha512-AriFDYpYVOBynpPZq/quxSLumFOo2hPB2H5Nz2vc1QlNfjOaA62zX8USNXcOY5nwKHEq7lZ84dG9M1W+LAND1g== +fast-check@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-3.1.0.tgz#0c958b6592f45fb66ea291a0bd1be2e7045f7e57" + integrity sha512-LHM6ZiznfQ5ZxReDUZnlKzSI/nlwCdfwaQ6qrCYBIkuWT6PfI3GOK/O2Xj50DF9oC0HIP22vbbHA8v4itAiyGA== dependencies: pure-rand "^5.0.1" @@ -12401,12 +12401,12 @@ markdown-it@^8.3.1: mdurl "^1.0.1" uc.micro "^1.0.5" -mathjs@^10.6.4: - version "10.6.4" - resolved "https://registry.yarnpkg.com/mathjs/-/mathjs-10.6.4.tgz#1b87a1268781d64f0c8b4e5e1b36cf7ecf58bb05" - integrity sha512-omQyvRE1jIy+3k2qsqkWASOcd45aZguXZDckr3HtnTYyXk5+2xpVfC3kATgbO2Srjxlqww3TVdhD0oUdZ/hiFA== +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== dependencies: - "@babel/runtime" "^7.18.6" + "@babel/runtime" "^7.18.9" complex.js "^2.1.1" decimal.js "^10.3.1" escape-latex "^1.2.0" @@ -12414,7 +12414,7 @@ mathjs@^10.6.4: javascript-natural-sort "^0.7.1" seedrandom "^3.0.5" tiny-emitter "^2.1.0" - typed-function "^2.1.0" + typed-function "^3.0.0" md5.js@^1.3.4: version "1.3.5" @@ -15225,7 +15225,7 @@ react-vega@^7.6.0: prop-types "^15.8.1" vega-embed "^6.5.1" -react@^18.1.0: +react@^18.0.0, react@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== @@ -17502,10 +17502,10 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -typed-function@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/typed-function/-/typed-function-2.1.0.tgz#ded6f8a442ba8749ff3fe75bc41419c8d46ccc3f" - integrity sha512-bctQIOqx2iVbWGDGPWwIm18QScpu2XRmkC19D8rQGFsjKSgteq/o1hTZvIG/wuDq8fanpBDrLkLq+aEN/6y5XQ== +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-rest-client@1.2.0: version "1.2.0" From 12cdc53f479b082995899e16bb65396e5a81f094 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 15:50:26 +0000 Subject: [PATCH 092/203] :arrow_up: Bump @types/node from 18.0.6 to 18.6.1 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.0.6 to 18.6.1. - [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 | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 043423cd..7b521073 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -37,7 +37,7 @@ "@testing-library/user-event": "^14.2.6", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.182", - "@types/node": "^18.0.6", + "@types/node": "^18.6.1", "@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 9255e6a9..9b03f99a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4686,10 +4686,10 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@18.x", "@types/node@^18.0.6": - version "18.0.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.6.tgz#0ba49ac517ad69abe7a1508bc9b3a5483df9d5d7" - integrity sha512-/xUq6H2aQm261exT6iZTMifUySEt4GR5KX8eYyY+C4MSNPqSh9oNIP7tz2GLKTlFaiBbgZNxffoR3CVRG+cljw== +"@types/node@*", "@types/node@18.x", "@types/node@^18.6.1": + version "18.6.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.1.tgz#828e4785ccca13f44e2fb6852ae0ef11e3e20ba5" + integrity sha512-z+2vB6yDt1fNwKOeGbckpmirO+VBDuQqecXkgeIqDlaOtmKn6hPR/viQ8cxCfqLU4fTlvM3+YjM367TukWdxpg== "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0": version "16.11.41" @@ -4796,7 +4796,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.9": +"@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": version "18.0.15" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== @@ -9207,10 +9207,10 @@ fast-check@^2.17.0: dependencies: pure-rand "^5.0.1" -fast-check@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-3.0.1.tgz#b9e7b57c4643a4e62893aca85e21c270591d0eac" - integrity sha512-AriFDYpYVOBynpPZq/quxSLumFOo2hPB2H5Nz2vc1QlNfjOaA62zX8USNXcOY5nwKHEq7lZ84dG9M1W+LAND1g== +fast-check@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-3.1.0.tgz#0c958b6592f45fb66ea291a0bd1be2e7045f7e57" + integrity sha512-LHM6ZiznfQ5ZxReDUZnlKzSI/nlwCdfwaQ6qrCYBIkuWT6PfI3GOK/O2Xj50DF9oC0HIP22vbbHA8v4itAiyGA== dependencies: pure-rand "^5.0.1" @@ -15225,7 +15225,7 @@ react-vega@^7.6.0: prop-types "^15.8.1" vega-embed "^6.5.1" -react@^18.1.0: +react@^18.0.0, react@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== From 79c86146ca2279c86a60b4b36062359026a5bc41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 16:13:13 +0000 Subject: [PATCH 093/203] :arrow_up: Bump @typescript-eslint/parser from 5.30.6 to 5.30.7 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.30.6 to 5.30.7. - [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.30.7/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 bb5bcbdf..f99ce5ed 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -140,7 +140,7 @@ "@types/node": "18.x", "@types/vscode": "^1.69.0", "@typescript-eslint/eslint-plugin": "^5.30.7", - "@typescript-eslint/parser": "^5.30.6", + "@typescript-eslint/parser": "^5.30.7", "eslint": "^8.20.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index 458dfe8d..6defd8c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4994,14 +4994,14 @@ dependencies: "@typescript-eslint/utils" "5.29.0" -"@typescript-eslint/parser@^5.30.6", "@typescript-eslint/parser@^5.5.0": - version "5.30.6" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.30.6.tgz#add440db038fa9d777e4ebdaf66da9e7fb7abe92" - integrity sha512-gfF9lZjT0p2ZSdxO70Xbw8w9sPPJGfAdjK7WikEjB3fcUI/yr9maUVEdqigBjKincUYNKOmf7QBMiTf719kbrA== +"@typescript-eslint/parser@^5.30.7", "@typescript-eslint/parser@^5.5.0": + version "5.30.7" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.30.7.tgz#99d09729392aec9e64b1de45cd63cb81a4ddd980" + integrity sha512-Rg5xwznHWWSy7v2o0cdho6n+xLhK2gntImp0rJroVVFkcYFYQ8C8UJTSuTw/3CnExBmPjycjmUJkxVmjXsld6A== dependencies: - "@typescript-eslint/scope-manager" "5.30.6" - "@typescript-eslint/types" "5.30.6" - "@typescript-eslint/typescript-estree" "5.30.6" + "@typescript-eslint/scope-manager" "5.30.7" + "@typescript-eslint/types" "5.30.7" + "@typescript-eslint/typescript-estree" "5.30.7" debug "^4.3.4" "@typescript-eslint/scope-manager@5.29.0": @@ -5012,14 +5012,6 @@ "@typescript-eslint/types" "5.29.0" "@typescript-eslint/visitor-keys" "5.29.0" -"@typescript-eslint/scope-manager@5.30.6": - version "5.30.6" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.30.6.tgz#ce1b49ff5ce47f55518d63dbe8fc9181ddbd1a33" - integrity sha512-Hkq5PhLgtVoW1obkqYH0i4iELctEKixkhWLPTYs55doGUKCASvkjOXOd/pisVeLdO24ZX9D6yymJ/twqpJiG3g== - dependencies: - "@typescript-eslint/types" "5.30.6" - "@typescript-eslint/visitor-keys" "5.30.6" - "@typescript-eslint/scope-manager@5.30.7": version "5.30.7" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz#8269a931ef1e5ae68b5eb80743cc515c4ffe3dd7" @@ -5042,11 +5034,6 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== -"@typescript-eslint/types@5.30.6": - version "5.30.6" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.30.6.tgz#86369d0a7af8c67024115ac1da3e8fb2d38907e1" - integrity sha512-HdnP8HioL1F7CwVmT4RaaMX57RrfqsOMclZc08wGMiDYJBsLGBM7JwXM4cZJmbWLzIR/pXg1kkrBBVpxTOwfUg== - "@typescript-eslint/types@5.30.7": version "5.30.7" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.30.7.tgz#18331487cc92d0f1fb1a6f580c8ec832528079d0" @@ -5065,19 +5052,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.30.6": - version "5.30.6" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.6.tgz#a84a0d6a486f9b54042da1de3d671a2c9f14484e" - integrity sha512-Z7TgPoeYUm06smfEfYF0RBkpF8csMyVnqQbLYiGgmUSTaSXTP57bt8f0UFXstbGxKIreTwQCujtaH0LY9w9B+A== - dependencies: - "@typescript-eslint/types" "5.30.6" - "@typescript-eslint/visitor-keys" "5.30.6" - 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.30.7": version "5.30.7" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz#05da9f1b281985bfedcf62349847f8d168eecc07" @@ -5123,14 +5097,6 @@ "@typescript-eslint/types" "5.29.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@5.30.6": - version "5.30.6" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.6.tgz#94dd10bb481c8083378d24de1742a14b38a2678c" - integrity sha512-41OiCjdL2mCaSDi2SvYbzFLlqqlm5v1ZW9Ym55wXKL/Rx6OOB1IbuFGo71Fj6Xy90gJDFTlgOS+vbmtGHPTQQA== - dependencies: - "@typescript-eslint/types" "5.30.6" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.30.7": version "5.30.7" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz#c093abae75b4fd822bfbad9fc337f38a7a14909a" From 66e48dd834859d49faaaa2f748acb3693429a011 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Mon, 25 Jul 2022 19:56:18 +0200 Subject: [PATCH 094/203] fixes #872 --- .../Reducer_Peggy_GeneratedParser.peggy | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 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 befda109..dfd3eb45 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 @@ -46,11 +46,11 @@ voidStatement return h.nodeLetStatement(variable, value); } letStatement - = variable:identifier _ assignmentOp _nl value:zeroOMoreArgumentsBlockOrExpression + = variable:variable _ assignmentOp _nl value:zeroOMoreArgumentsBlockOrExpression { return h.nodeLetStatement(variable, value) } defunStatement - = variable:identifier '(' _nl args:array_parameters _nl ')' _ assignmentOp _nl body:innerBlockOrExpression + = variable:variable '(' _nl args:array_parameters _nl ')' _ assignmentOp _nl body:innerBlockOrExpression { var value = h.nodeLambda(args, body) return h.nodeLetStatement(variable, value) } @@ -144,11 +144,11 @@ chainFunctionCall }, head)} chainedFunction - = fn:dollarIdentifier '(' _nl args:array_functionArguments _nl ')' + = fn:variable '(' _nl args:array_functionArguments _nl ')' { return {fnName: fn.value, args: args}} - / fn:dollarIdentifier '(' _nl ')' + / fn:variable '(' _nl ')' { return {fnName: fn.value, args: []}} - / fn:dollarIdentifier + / fn:variable { return {fnName: fn.value, args: []}} // end of binary operators @@ -192,13 +192,14 @@ basicLiteral = string / number / boolean - / dollarIdentifierWithModule - / dollarIdentifier + / variable / voidLiteral voidLiteral 'void' = "()" {return h.nodeVoid();} +variable = dollarIdentifierWithModule / dollarIdentifier + dollarIdentifierWithModule 'identifier' = head:$moduleIdentifier tail:('.' _nl @$moduleIdentifier)* '.' _nl From b76e1df8199dc4fbbb2d177601fe7870f026da8a Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Tue, 26 Jul 2022 20:17:27 +0400 Subject: [PATCH 095/203] smart modal positioning --- .../src/components/SquiggleChart.tsx | 3 + .../src/components/SquiggleContainer.tsx | 1 + .../src/components/SquigglePlayground.tsx | 75 ++++++--- .../SquiggleViewer/ItemSettingsMenu.tsx | 56 +++++-- .../SquiggleViewer/ViewerContext.ts | 2 + .../src/components/SquiggleViewer/index.tsx | 3 + .../components/src/components/ui/Modal.tsx | 143 ++++++++++++++---- yarn.lock | 4 +- 8 files changed, 226 insertions(+), 61 deletions(-) diff --git a/packages/components/src/components/SquiggleChart.tsx b/packages/components/src/components/SquiggleChart.tsx index 9367e63e..10e4e22c 100644 --- a/packages/components/src/components/SquiggleChart.tsx +++ b/packages/components/src/components/SquiggleChart.tsx @@ -51,6 +51,7 @@ export interface SquiggleChartProps { maxX?: number; /** Whether to show vega actions to the user, so they can copy the chart spec */ distributionChartActions?: boolean; + enableLocalSettings?: boolean; } const defaultOnChange = () => {}; @@ -76,6 +77,7 @@ export const SquiggleChart: React.FC = React.memo( color, title, distributionChartActions, + enableLocalSettings = false, }) => { const result = useSquiggle({ code, @@ -111,6 +113,7 @@ export const SquiggleChart: React.FC = React.memo( distributionPlotSettings={distributionPlotSettings} chartSettings={chartSettings} environment={environment ?? defaultEnvironment} + enableLocalSettings={enableLocalSettings} /> ); } diff --git a/packages/components/src/components/SquiggleContainer.tsx b/packages/components/src/components/SquiggleContainer.tsx index 63dbb54a..bb3f1db4 100644 --- a/packages/components/src/components/SquiggleContainer.tsx +++ b/packages/components/src/components/SquiggleContainer.tsx @@ -13,6 +13,7 @@ const SquiggleContext = React.createContext({ export const SquiggleContainer: React.FC = ({ children }) => { const context = useContext(SquiggleContext); + if (context.containerized) { return <>{children}; } else { diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 18e6a4c7..d333985a 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -1,4 +1,11 @@ -import React, { FC, useState, useEffect, useMemo } from "react"; +import React, { + FC, + useState, + useEffect, + useMemo, + useRef, + useCallback, +} from "react"; import { useForm, UseFormRegister, useWatch } from "react-hook-form"; import * as yup from "yup"; import { useMaybeControlledValue } from "../lib/hooks"; @@ -229,6 +236,13 @@ const useRunnerState = (code: string) => { }; }; +type PlaygroundContextShape = { + getLeftPanelElement: () => HTMLDivElement | undefined; +}; +export const PlaygroundContext = React.createContext({ + getLeftPanelElement: () => undefined, +}); + export const SquigglePlayground: FC = ({ defaultCode = "", height = 500, @@ -301,6 +315,7 @@ export const SquigglePlayground: FC = ({ {...vars} bindings={defaultBindings} jsImports={imports} + enableLocalSettings={true} /> ); @@ -345,40 +360,54 @@ export const SquigglePlayground: FC = ({ ); + const leftPanelRef = useRef(null); + const withEditor = (
-
{tabs}
+
+ {tabs} +
{squiggleChart}
); const withoutEditor =
{tabs}
; + const getLeftPanelElement = useCallback(() => { + return leftPanelRef.current ?? undefined; + }, []); + return ( - -
-
- - + +
+
+ + + + + + + - - - - - +
+ {vars.showEditor ? withEditor : withoutEditor}
- {vars.showEditor ? withEditor : withoutEditor} -
- + + ); }; diff --git a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx index 39f14988..c4c226d8 100644 --- a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx +++ b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx @@ -1,5 +1,5 @@ import { CogIcon } from "@heroicons/react/solid"; -import React, { useContext, useState } from "react"; +import React, { useContext, useRef, useState, useEffect } from "react"; import { useForm } from "react-hook-form"; import { yupResolver } from "@hookform/resolvers/yup"; import { Modal } from "../ui/Modal"; @@ -10,6 +10,7 @@ import { defaultColor, defaultTickFormat, } from "../../lib/distributionSpecBuilder"; +import { PlaygroundContext } from "../SquigglePlayground"; type Props = { path: Path; @@ -18,12 +19,15 @@ type Props = { withFunctionSettings: boolean; }; -const ItemSettingsModal: React.FC void }> = ({ +const ItemSettingsModal: React.FC< + Props & { close: () => void; resetScroll: () => void } +> = ({ path, onChange, disableLogX, withFunctionSettings, close, + resetScroll, }) => { const { setSettings, getSettings, getMergedSettings } = useContext(ViewerContext); @@ -51,7 +55,7 @@ const ItemSettingsModal: React.FC void }> = ({ diagramCount: mergedSettings.chartSettings.count, }, }); - React.useEffect(() => { + useEffect(() => { const subscription = watch((vars) => { const settings = getSettings(path); // get the latest version setSettings(path, { @@ -78,10 +82,26 @@ const ItemSettingsModal: React.FC void }> = ({ return () => subscription.unsubscribe(); }, [getSettings, setSettings, onChange, path, watch]); + const { getLeftPanelElement } = useContext(PlaygroundContext); + return ( - - - Chart settings{path.length ? " for " + pathAsString(path) : ""} + + + Chart settings + {path.length ? ( + <> + {" for "} + + {pathAsString(path)} + {" "} + + ) : ( + "" + )} void }> = ({ export const ItemSettingsMenu: React.FC = (props) => { const [isOpen, setIsOpen] = useState(false); - const { setSettings, getSettings } = useContext(ViewerContext); + const { enableLocalSettings, setSettings, getSettings } = + useContext(ViewerContext); + + const ref = useRef(null); + + if (!enableLocalSettings) { + return null; + } const settings = getSettings(props.path); + const resetScroll = () => { + if (!ref.current) return; + window.scroll({ + top: ref.current.getBoundingClientRect().y + window.scrollY, + }); + }; + return ( -
+
setIsOpen(!isOpen)} @@ -122,7 +156,11 @@ export const ItemSettingsMenu: React.FC = (props) => { ) : null} {isOpen ? ( - setIsOpen(false)} /> + setIsOpen(false)} + resetScroll={resetScroll} + /> ) : null}
); diff --git a/packages/components/src/components/SquiggleViewer/ViewerContext.ts b/packages/components/src/components/SquiggleViewer/ViewerContext.ts index 58270a90..0769f3b1 100644 --- a/packages/components/src/components/SquiggleViewer/ViewerContext.ts +++ b/packages/components/src/components/SquiggleViewer/ViewerContext.ts @@ -9,6 +9,7 @@ type ViewerContextShape = { getSettings(path: Path): LocalItemSettings; getMergedSettings(path: Path): MergedItemSettings; setSettings(path: Path, value: LocalItemSettings): void; + enableLocalSettings: boolean; // show local settings icon in the UI }; export const ViewerContext = React.createContext({ @@ -30,4 +31,5 @@ export const ViewerContext = React.createContext({ height: 150, }), setSettings() {}, + enableLocalSettings: false, }); diff --git a/packages/components/src/components/SquiggleViewer/index.tsx b/packages/components/src/components/SquiggleViewer/index.tsx index 0c6a20dd..6feb3cad 100644 --- a/packages/components/src/components/SquiggleViewer/index.tsx +++ b/packages/components/src/components/SquiggleViewer/index.tsx @@ -23,6 +23,7 @@ type Props = { chartSettings: FunctionChartSettings; /** Environment for further function executions */ environment: environment; + enableLocalSettings?: boolean; }; type Settings = { @@ -38,6 +39,7 @@ export const SquiggleViewer: React.FC = ({ distributionPlotSettings, chartSettings, environment, + enableLocalSettings = false, }) => { // can't store settings in the state because we don't want to rerender the entire tree on every change const settingsRef = useRef({}); @@ -85,6 +87,7 @@ export const SquiggleViewer: React.FC = ({ getSettings, setSettings, getMergedSettings, + enableLocalSettings, }} > {result.tag === "Ok" ? ( diff --git a/packages/components/src/components/ui/Modal.tsx b/packages/components/src/components/ui/Modal.tsx index d0565ddc..31f3e914 100644 --- a/packages/components/src/components/ui/Modal.tsx +++ b/packages/components/src/components/ui/Modal.tsx @@ -1,20 +1,35 @@ import { motion } from "framer-motion"; -import * as React from "react"; +import React, { useContext } from "react"; import * as ReactDOM from "react-dom"; import { XIcon } from "@heroicons/react/solid"; +import { SquiggleContainer } from "../SquiggleContainer"; +import clsx from "clsx"; +import { useWindowScroll, useWindowSize } from "react-use"; +import { rectToClientRect } from "@floating-ui/core"; -const Overlay: React.FC = () => ( - -); +type ModalContextShape = { + close: () => void; +}; +const ModalContext = React.createContext({ + close: () => undefined, +}); + +const Overlay: React.FC = () => { + const { close } = useContext(ModalContext); + return ( + + ); +}; const ModalHeader: React.FC<{ - close: () => void; children: React.ReactNode; -}> = ({ children, close }) => { +}> = ({ children }) => { + const { close } = useContext(ModalContext); return (
{children}
@@ -41,22 +56,92 @@ const ModalFooter: React.FC<{ children: React.ReactNode }> = ({ children }) => (
{children}
); -const ModalWindow: React.FC<{ children: React.ReactNode }> = ({ children }) => ( -
- {children} -
-); +const ModalWindow: React.FC<{ + children: React.ReactNode; + container?: HTMLElement; +}> = ({ children, container }) => { + // This component works in two possible modes: + // 1. container mode - the modal is rendered inside a container element + // 2. centered mode - the modal is rendered in the middle of the screen + // The mode is determined by the presence of the `container` prop and by whether the available space is large enough to fit the modal. -type ModalType = React.FC<{ children: React.ReactNode }> & { + // Necessary for container mode - need to reposition the modal on scroll and resize events. + useWindowSize(); + useWindowScroll(); + + let position: + | { + left: number; + top: number; + maxWidth: number; + maxHeight: number; + transform: string; + } + | undefined; + + const { clientWidth: screenWidth, clientHeight: screenHeight } = + document.documentElement; + if (container) { + const rect = container?.getBoundingClientRect(); + + // If available space in `visibleRect` is smaller than these, fallback to positioning in the middle of the screen. + const minWidth = 384; // matches the w-96 below + const minHeight = 300; + const offset = 8; + + const visibleRect = { + left: Math.max(rect.left, 0), + right: Math.min(rect.right, screenWidth), + top: Math.max(rect.top, 0), + bottom: Math.min(rect.bottom, screenHeight), + }; + const maxWidth = visibleRect.right - visibleRect.left - 2 * offset; + const maxHeight = visibleRect.bottom - visibleRect.top - 2 * offset; + + const center = { + left: visibleRect.left + (visibleRect.right - visibleRect.left) / 2, + top: visibleRect.top + (visibleRect.bottom - visibleRect.top) / 2, + }; + position = { + left: center.left, + top: center.top, + transform: "translate(-50%, -50%)", + maxWidth, + maxHeight, + }; + if (maxWidth < minWidth || maxHeight < minHeight) { + position = undefined; // modal is hard to fit in the container, fallback to positioning it in the middle of the screen + } + } + return ( +
+ {children} +
+ ); +}; + +type ModalType = React.FC<{ + children: React.ReactNode; + container?: HTMLElement; // if specified, modal will be positioned over the visible part of the container, if it's not too small + close: () => void; +}> & { Body: typeof ModalBody; Footer: typeof ModalFooter; Header: typeof ModalHeader; }; -export const Modal: ModalType = ({ children }) => { +export const Modal: ModalType = ({ children, container, close }) => { const [el] = React.useState(() => document.createElement("div")); React.useEffect(() => { @@ -68,15 +153,19 @@ export const Modal: ModalType = ({ children }) => { }, [el]); const modal = ( -
-
- - {children} -
-
+ + +
+
+ + {children} +
+
+
+
); - return ReactDOM.createPortal(modal, el); + return ReactDOM.createPortal(modal, container || el); }; Modal.Body = ModalBody; diff --git a/yarn.lock b/yarn.lock index cb466cc6..1ede77ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4825,7 +4825,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.9": +"@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": version "18.0.15" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== @@ -15261,7 +15261,7 @@ react-vega@^7.6.0: prop-types "^15.8.1" vega-embed "^6.5.1" -react@^18.1.0: +react@^18.0.0, react@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== From fd36e9ef9ed11adfb3f57aa777d6da395bd390dd Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Tue, 26 Jul 2022 20:19:31 +0400 Subject: [PATCH 096/203] change variable border color --- .../components/src/components/SquiggleViewer/VariableBox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/components/SquiggleViewer/VariableBox.tsx b/packages/components/src/components/SquiggleViewer/VariableBox.tsx index f87c8914..97c31d45 100644 --- a/packages/components/src/components/SquiggleViewer/VariableBox.tsx +++ b/packages/components/src/components/SquiggleViewer/VariableBox.tsx @@ -67,7 +67,7 @@ export const VariableBox: React.FC = ({
{path.length ? (
) : null} From e76a4beb4db9ab6bd1e178c058691596c5a0acbe Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Tue, 26 Jul 2022 20:27:10 +0400 Subject: [PATCH 097/203] close modals on escape key --- packages/components/src/components/ui/Modal.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/components/src/components/ui/Modal.tsx b/packages/components/src/components/ui/Modal.tsx index 31f3e914..ba1499ec 100644 --- a/packages/components/src/components/ui/Modal.tsx +++ b/packages/components/src/components/ui/Modal.tsx @@ -146,12 +146,24 @@ export const Modal: ModalType = ({ children, container, close }) => { React.useEffect(() => { document.body.appendChild(el); - return () => { document.body.removeChild(el); }; }, [el]); + React.useEffect(() => { + const handleEscape = (e: KeyboardEvent) => { + if (e.key === "Escape") { + close(); + } + }; + document.addEventListener("keydown", handleEscape); + + return () => { + document.removeEventListener("keydown", handleEscape); + }; + }, [close]); + const modal = ( From 2abb3968dd238ce991cbc387d38f7efc8e4ffc69 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Tue, 26 Jul 2022 20:47:42 +0400 Subject: [PATCH 098/203] fix tooltip padding on website --- packages/components/src/components/ui/Modal.tsx | 16 +++++++--------- .../components/src/components/ui/Tooltip.tsx | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/components/src/components/ui/Modal.tsx b/packages/components/src/components/ui/Modal.tsx index ba1499ec..f688e17c 100644 --- a/packages/components/src/components/ui/Modal.tsx +++ b/packages/components/src/components/ui/Modal.tsx @@ -165,16 +165,14 @@ export const Modal: ModalType = ({ children, container, close }) => { }, [close]); const modal = ( - - -
-
- - {children} -
+ +
+
+ + {children}
- - +
+
); return ReactDOM.createPortal(modal, container || el); diff --git a/packages/components/src/components/ui/Tooltip.tsx b/packages/components/src/components/ui/Tooltip.tsx index 60a4ef12..7940d5fb 100644 --- a/packages/components/src/components/ui/Tooltip.tsx +++ b/packages/components/src/components/ui/Tooltip.tsx @@ -54,7 +54,7 @@ export const Tooltip: React.FC = ({ text, children }) => { }, })} > -
{text}
+
{text}
)} From 8be3f91d8e15ccd2ec2d867b46c603c5688ee5e8 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Tue, 26 Jul 2022 21:55:38 +0400 Subject: [PATCH 099/203] improve tooltip positioning --- packages/components/src/components/ui/Tooltip.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/src/components/ui/Tooltip.tsx b/packages/components/src/components/ui/Tooltip.tsx index 7940d5fb..4eefa448 100644 --- a/packages/components/src/components/ui/Tooltip.tsx +++ b/packages/components/src/components/ui/Tooltip.tsx @@ -1,6 +1,7 @@ import React, { cloneElement, useState } from "react"; import { AnimatePresence, motion } from "framer-motion"; import { + flip, shift, useDismiss, useFloating, @@ -21,7 +22,7 @@ export const Tooltip: React.FC = ({ text, children }) => { placement: "top", open: isOpen, onOpenChange: setIsOpen, - middleware: [shift()], + middleware: [shift(), flip()], }); const { getReferenceProps, getFloatingProps } = useInteractions([ From e3e9c76af2471db9e1abe2e1c326b95ddb7565e8 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Tue, 26 Jul 2022 21:55:59 +0400 Subject: [PATCH 100/203] smooth scrolling when scrolling back to item from modal --- .../src/components/SquiggleViewer/ItemSettingsMenu.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx index c4c226d8..2c26b9aa 100644 --- a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx +++ b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx @@ -131,6 +131,7 @@ export const ItemSettingsMenu: React.FC = (props) => { if (!ref.current) return; window.scroll({ top: ref.current.getBoundingClientRect().y + window.scrollY, + behavior: "smooth", }); }; From 8fbf5decf8c5b6d0594415679eea373a577eeb23 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Tue, 26 Jul 2022 21:58:03 +0400 Subject: [PATCH 101/203] hideOnScoll navbar on website --- packages/website/docusaurus.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index 16ff6afa..dd1879fb 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -54,6 +54,7 @@ const config = { ({ navbar: { title: "Squiggle", + hideOnScroll: true, logo: { alt: "Squiggle Logo", src: "img/quri-logo.png", From d6cc3a419be866013bc7c3bb86088cbcb14602d6 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Tue, 26 Jul 2022 23:00:20 +0400 Subject: [PATCH 102/203] remove toggle animation --- packages/components/src/components/ui/Toggle.tsx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/components/src/components/ui/Toggle.tsx b/packages/components/src/components/ui/Toggle.tsx index 90e73e08..3295bda0 100644 --- a/packages/components/src/components/ui/Toggle.tsx +++ b/packages/components/src/components/ui/Toggle.tsx @@ -1,5 +1,4 @@ import clsx from "clsx"; -import { motion } from "framer-motion"; import React from "react"; type IconType = (props: React.ComponentProps<"svg">) => JSX.Element; @@ -19,9 +18,7 @@ export const Toggle: React.FC = ({ }) => { const CurrentIcon = status ? OnIcon : OffIcon; return ( - = ({ )} onClick={() => onChange(!status)} > - +
- - - {status ? onText : offText} - - +
+ {status ? onText : offText} + ); }; From a599768638f0d7c6b6bda90fda967414c960f479 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Wed, 27 Jul 2022 01:26:54 +0400 Subject: [PATCH 103/203] increase modal width --- .../components/src/components/ui/Modal.tsx | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/packages/components/src/components/ui/Modal.tsx b/packages/components/src/components/ui/Modal.tsx index f688e17c..e18631cb 100644 --- a/packages/components/src/components/ui/Modal.tsx +++ b/packages/components/src/components/ui/Modal.tsx @@ -2,10 +2,8 @@ import { motion } from "framer-motion"; import React, { useContext } from "react"; import * as ReactDOM from "react-dom"; import { XIcon } from "@heroicons/react/solid"; -import { SquiggleContainer } from "../SquiggleContainer"; import clsx from "clsx"; import { useWindowScroll, useWindowSize } from "react-use"; -import { rectToClientRect } from "@floating-ui/core"; type ModalContextShape = { close: () => void; @@ -79,15 +77,16 @@ const ModalWindow: React.FC<{ } | undefined; - const { clientWidth: screenWidth, clientHeight: screenHeight } = - document.documentElement; - if (container) { - const rect = container?.getBoundingClientRect(); + // If available space in `visibleRect` is smaller than these, fallback to positioning in the middle of the screen. + const minWidth = 384; + const minHeight = 300; + const offset = 8; + const naturalWidth = 576; // maximum possible width; modal tries to take this much space, but can be smaller - // If available space in `visibleRect` is smaller than these, fallback to positioning in the middle of the screen. - const minWidth = 384; // matches the w-96 below - const minHeight = 300; - const offset = 8; + if (container) { + const { clientWidth: screenWidth, clientHeight: screenHeight } = + document.documentElement; + const rect = container?.getBoundingClientRect(); const visibleRect = { left: Math.max(rect.left, 0), @@ -116,15 +115,17 @@ const ModalWindow: React.FC<{ return (
{children}
From 3bdc5c67a2a6ef44e5c1de6d79189af0054514e9 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Wed, 27 Jul 2022 12:12:03 +0400 Subject: [PATCH 104/203] spinner in autorun mode; autorun refactorings --- .../src/components/SquigglePlayground.tsx | 48 ++-------- .../components/src/components/ui/Toggle.tsx | 8 +- packages/components/src/lib/hooks/index.ts | 3 + .../src/lib/hooks/useMaybeControlledValue.ts | 22 +++++ .../src/lib/hooks/useRunnerState.ts | 92 +++++++++++++++++++ .../lib/{hooks.ts => hooks/useSquiggle.ts} | 22 +---- 6 files changed, 129 insertions(+), 66 deletions(-) create mode 100644 packages/components/src/lib/hooks/index.ts create mode 100644 packages/components/src/lib/hooks/useMaybeControlledValue.ts create mode 100644 packages/components/src/lib/hooks/useRunnerState.ts rename packages/components/src/lib/{hooks.ts => hooks/useSquiggle.ts} (65%) diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 5ca84040..a2fadb7d 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -1,7 +1,7 @@ import React, { FC, useState, useEffect, useMemo } from "react"; import { Path, useForm, UseFormRegister, useWatch } from "react-hook-form"; import * as yup from "yup"; -import { useMaybeControlledValue } from "../lib/hooks"; +import { useMaybeControlledValue, useRunnerState } from "../lib/hooks"; import { yupResolver } from "@hookform/resolvers/yup"; import { ChartSquareBarIcon, @@ -358,54 +358,18 @@ const RunControls: React.FC<{ )}
); }; -const useRunnerState = (code: string) => { - const [autorunMode, setAutorunMode] = useState(true); - const [renderedCode, setRenderedCode] = useState(code); // used in manual run mode only - const [isRunning, setIsRunning] = useState(false); // used in manual run mode only - - // This part is tricky and fragile; we need to re-render first to make sure that the icon is spinning, - // and only then evaluate the squiggle code (which freezes the UI). - // Also note that `useEffect` execution order matters here. - // Hopefully it'll all go away after we make squiggle code evaluation async. - useEffect(() => { - if (renderedCode === code && isRunning) { - // It's not possible to put this after `setRenderedCode(code)` below because React would apply - // `setIsRunning` and `setRenderedCode` together and spinning icon will disappear immediately. - setIsRunning(false); - } - }, [renderedCode, code, isRunning]); - - useEffect(() => { - if (!autorunMode && isRunning) { - setRenderedCode(code); // TODO - force run even if code hasn't changed - } - }, [autorunMode, code, isRunning]); - - const run = () => { - // The rest will be handled by useEffects above, but we need to update the spinner first. - setIsRunning(true); - }; - - return { - run, - renderedCode: autorunMode ? code : renderedCode, - isRunning, - autorunMode, - setAutorunMode: (newValue: boolean) => { - if (!newValue) setRenderedCode(code); - setAutorunMode(newValue); - }, - }; -}; - export const SquigglePlayground: FC = ({ defaultCode = "", height = 500, diff --git a/packages/components/src/components/ui/Toggle.tsx b/packages/components/src/components/ui/Toggle.tsx index 3295bda0..17ecc3f6 100644 --- a/packages/components/src/components/ui/Toggle.tsx +++ b/packages/components/src/components/ui/Toggle.tsx @@ -8,13 +8,15 @@ type Props = { onChange: (status: boolean) => void; texts: [string, string]; icons: [IconType, IconType]; + spinIcon?: boolean; }; export const Toggle: React.FC = ({ - texts: [onText, offText], - icons: [OnIcon, OffIcon], status, onChange, + texts: [onText, offText], + icons: [OnIcon, OffIcon], + spinIcon, }) => { const CurrentIcon = status ? OnIcon : OffIcon; return ( @@ -28,7 +30,7 @@ export const Toggle: React.FC = ({ onClick={() => onChange(!status)} >
- +
{status ? onText : offText} diff --git a/packages/components/src/lib/hooks/index.ts b/packages/components/src/lib/hooks/index.ts new file mode 100644 index 00000000..01fb46f9 --- /dev/null +++ b/packages/components/src/lib/hooks/index.ts @@ -0,0 +1,3 @@ +export { useMaybeControlledValue } from "./useMaybeControlledValue"; +export { useSquiggle, useSquigglePartial } from "./useSquiggle"; +export { useRunnerState } from "./useRunnerState"; diff --git a/packages/components/src/lib/hooks/useMaybeControlledValue.ts b/packages/components/src/lib/hooks/useMaybeControlledValue.ts new file mode 100644 index 00000000..aa7abc50 --- /dev/null +++ b/packages/components/src/lib/hooks/useMaybeControlledValue.ts @@ -0,0 +1,22 @@ +import { useState } from "react"; + +type ControlledValueArgs = { + value?: T; + defaultValue: T; + onChange?: (x: T) => void; +}; + +export function useMaybeControlledValue( + args: ControlledValueArgs +): [T, (x: T) => void] { + let [uncontrolledValue, setUncontrolledValue] = useState(args.defaultValue); + let value = args.value ?? uncontrolledValue; + let onChange = (newValue: T) => { + if (args.value === undefined) { + // uncontrolled mode + setUncontrolledValue(newValue); + } + args.onChange?.(newValue); + }; + return [value, onChange]; +} diff --git a/packages/components/src/lib/hooks/useRunnerState.ts b/packages/components/src/lib/hooks/useRunnerState.ts new file mode 100644 index 00000000..e12eb5ad --- /dev/null +++ b/packages/components/src/lib/hooks/useRunnerState.ts @@ -0,0 +1,92 @@ +import { useEffect, useReducer } from "react"; + +type State = { + autorunMode: boolean; + renderedCode: string; + isRunning: boolean; + executionId: number; +}; + +const buildInitialState = (code: string) => ({ + autorunMode: true, + renderedCode: code, + isRunning: false, + executionId: 0, +}); + +type Action = + | { + type: "SET_AUTORUN_MODE"; + value: boolean; + code: string; + } + | { + type: "PREPARE_RUN"; + } + | { + type: "RUN"; + code: string; + } + | { + type: "STOP_RUN"; + }; + +const reducer = (state: State, action: Action): State => { + switch (action.type) { + case "SET_AUTORUN_MODE": + return { + ...state, + autorunMode: action.value, + }; + case "PREPARE_RUN": + return { + ...state, + isRunning: true, + }; + case "RUN": + return { + ...state, + renderedCode: action.code, + executionId: state.executionId + 1, + }; + case "STOP_RUN": + return { + ...state, + isRunning: false, + }; + } +}; + +export const useRunnerState = (code: string) => { + const [state, dispatch] = useReducer(reducer, buildInitialState(code)); + + useEffect(() => { + if (state.isRunning) { + if (state.renderedCode !== code) { + dispatch({ type: "RUN", code }); + } else { + dispatch({ type: "STOP_RUN" }); + } + } + }, [state.isRunning, state.renderedCode, code]); + + const run = () => { + // The rest will be handled by dispatches above on following renders, but we need to update the spinner first. + dispatch({ type: "PREPARE_RUN" }); + }; + + if (state.autorunMode && state.renderedCode !== code && !state.isRunning) { + run(); + } + + return { + run, + autorunMode: state.autorunMode, + renderedCode: state.renderedCode, + isRunning: state.isRunning, + executionId: state.executionId, + setAutorunMode: (newValue: boolean) => { + dispatch({ type: "SET_AUTORUN_MODE", value: newValue, code }); + }, + }; +}; diff --git a/packages/components/src/lib/hooks.ts b/packages/components/src/lib/hooks/useSquiggle.ts similarity index 65% rename from packages/components/src/lib/hooks.ts rename to packages/components/src/lib/hooks/useSquiggle.ts index b52c23be..03b8c69d 100644 --- a/packages/components/src/lib/hooks.ts +++ b/packages/components/src/lib/hooks/useSquiggle.ts @@ -5,7 +5,7 @@ import { run, runPartial, } from "@quri/squiggle-lang"; -import { useEffect, useMemo, useState } from "react"; +import { useEffect, useMemo } from "react"; type SquiggleArgs> = { code: string; @@ -42,23 +42,3 @@ export const useSquigglePartial = ( export const useSquiggle = (args: SquiggleArgs>) => { return useSquiggleAny(args, run); }; - -type ControlledValueArgs = { - value?: T; - defaultValue: T; - onChange?: (x: T) => void; -}; -export function useMaybeControlledValue( - args: ControlledValueArgs -): [T, (x: T) => void] { - let [uncontrolledValue, setUncontrolledValue] = useState(args.defaultValue); - let value = args.value ?? uncontrolledValue; - let onChange = (newValue: T) => { - if (args.value === undefined) { - // uncontrolled mode - setUncontrolledValue(newValue); - } - args.onChange?.(newValue); - }; - return [value, onChange]; -} From eacc1adf1d507cbb380e1f3fee06c968bf99d019 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Wed, 27 Jul 2022 13:03:23 +0400 Subject: [PATCH 105/203] executionId for code re-runs --- .../src/components/SquiggleChart.tsx | 3 ++ .../src/components/SquigglePlayground.tsx | 11 ++++-- .../src/lib/hooks/useRunnerState.ts | 34 +++++++++++-------- .../components/src/lib/hooks/useSquiggle.ts | 11 +++++- 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/packages/components/src/components/SquiggleChart.tsx b/packages/components/src/components/SquiggleChart.tsx index 10e4e22c..088b49bf 100644 --- a/packages/components/src/components/SquiggleChart.tsx +++ b/packages/components/src/components/SquiggleChart.tsx @@ -14,6 +14,8 @@ import { SquiggleViewer } from "./SquiggleViewer"; export interface SquiggleChartProps { /** The input string for squiggle */ code?: string; + /** Allows to re-run the code if code hasn't changed */ + executionId?: number; /** If the output requires monte carlo sampling, the amount of samples */ sampleCount?: number; /** The amount of points returned to draw the distribution */ @@ -59,6 +61,7 @@ const defaultOnChange = () => {}; export const SquiggleChart: React.FC = React.memo( ({ code = "", + executionId = 0, environment, onChange = defaultOnChange, // defaultOnChange must be constant, don't move its definition here height = 200, diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index a40b1efd..c7e63f4e 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -269,12 +269,19 @@ export const SquigglePlayground: FC = ({ [vars.sampleCount, vars.xyPointLength] ); - const { run, autorunMode, setAutorunMode, isRunning, renderedCode } = - useRunnerState(code); + const { + run, + autorunMode, + setAutorunMode, + isRunning, + renderedCode, + executionId, + } = useRunnerState(code); const squiggleChart = ( ({ +const buildInitialState = (code: string): State => ({ autorunMode: true, renderedCode: code, - isRunning: false, - executionId: 0, + runningState: "none", + executionId: 1, }); type Action = @@ -41,18 +42,19 @@ const reducer = (state: State, action: Action): State => { case "PREPARE_RUN": return { ...state, - isRunning: true, + runningState: "prepared", }; case "RUN": return { ...state, + runningState: "run", renderedCode: action.code, executionId: state.executionId + 1, }; case "STOP_RUN": return { ...state, - isRunning: false, + runningState: "none", }; } }; @@ -61,21 +63,23 @@ export const useRunnerState = (code: string) => { const [state, dispatch] = useReducer(reducer, buildInitialState(code)); useEffect(() => { - if (state.isRunning) { - if (state.renderedCode !== code) { - dispatch({ type: "RUN", code }); - } else { - dispatch({ type: "STOP_RUN" }); - } + if (state.runningState === "prepared") { + dispatch({ type: "RUN", code }); + } else if (state.runningState === "run") { + dispatch({ type: "STOP_RUN" }); } - }, [state.isRunning, state.renderedCode, code]); + }, [state.runningState, code]); const run = () => { // The rest will be handled by dispatches above on following renders, but we need to update the spinner first. dispatch({ type: "PREPARE_RUN" }); }; - if (state.autorunMode && state.renderedCode !== code && !state.isRunning) { + if ( + state.autorunMode && + state.renderedCode !== code && + state.runningState === "none" + ) { run(); } @@ -83,7 +87,7 @@ export const useRunnerState = (code: string) => { run, autorunMode: state.autorunMode, renderedCode: state.renderedCode, - isRunning: state.isRunning, + isRunning: state.runningState !== "none", executionId: state.executionId, setAutorunMode: (newValue: boolean) => { dispatch({ type: "SET_AUTORUN_MODE", value: newValue, code }); diff --git a/packages/components/src/lib/hooks/useSquiggle.ts b/packages/components/src/lib/hooks/useSquiggle.ts index 03b8c69d..4165a7be 100644 --- a/packages/components/src/lib/hooks/useSquiggle.ts +++ b/packages/components/src/lib/hooks/useSquiggle.ts @@ -9,6 +9,7 @@ import { useEffect, useMemo } from "react"; type SquiggleArgs> = { code: string; + executionId?: number; bindings?: bindings; jsImports?: jsImports; environment?: environment; @@ -21,7 +22,15 @@ const useSquiggleAny = >( ) => { const result: T = useMemo( () => f(args.code, args.bindings, args.environment, args.jsImports), - [f, args.code, args.bindings, args.environment, args.jsImports] + // eslint-disable-next-line react-hooks/exhaustive-deps + [ + f, + args.code, + args.bindings, + args.environment, + args.jsImports, + args.executionId, + ] ); const { onChange } = args; From 329bb9432e98b73f99a56d6f4e47854e6f9d136b Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Wed, 27 Jul 2022 21:28:21 +0400 Subject: [PATCH 106/203] playground renders code on second pass --- .../src/components/SquiggleChart.tsx | 1 + .../src/components/SquigglePlayground.tsx | 23 ++++++++++--------- .../src/lib/hooks/useRunnerState.ts | 12 ++++++---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/packages/components/src/components/SquiggleChart.tsx b/packages/components/src/components/SquiggleChart.tsx index 088b49bf..86b2b078 100644 --- a/packages/components/src/components/SquiggleChart.tsx +++ b/packages/components/src/components/SquiggleChart.tsx @@ -88,6 +88,7 @@ export const SquiggleChart: React.FC = React.memo( environment, jsImports, onChange, + executionId, }); const distributionPlotSettings = { diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index c7e63f4e..2477f22f 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -278,17 +278,18 @@ export const SquigglePlayground: FC = ({ executionId, } = useRunnerState(code); - const squiggleChart = ( - - ); + const squiggleChart = + renderedCode === "" ? null : ( + + ); const firstTab = vars.showEditor ? (
diff --git a/packages/components/src/lib/hooks/useRunnerState.ts b/packages/components/src/lib/hooks/useRunnerState.ts index 861861d8..ff148d69 100644 --- a/packages/components/src/lib/hooks/useRunnerState.ts +++ b/packages/components/src/lib/hooks/useRunnerState.ts @@ -1,4 +1,4 @@ -import { useEffect, useReducer } from "react"; +import { useLayoutEffect, useReducer } from "react"; type State = { autorunMode: boolean; @@ -10,7 +10,7 @@ type State = { const buildInitialState = (code: string): State => ({ autorunMode: true, - renderedCode: code, + renderedCode: "", runningState: "none", executionId: 1, }); @@ -62,9 +62,13 @@ const reducer = (state: State, action: Action): State => { export const useRunnerState = (code: string) => { const [state, dispatch] = useReducer(reducer, buildInitialState(code)); - useEffect(() => { + useLayoutEffect(() => { if (state.runningState === "prepared") { - dispatch({ type: "RUN", code }); + // this is necessary for async playground loading - otherwise it executes the code synchronously on the initial load + // (it's surprising that this is necessary, but empirically it _is_ necessary, both with `useEffect` and `useLayoutEffect`) + setTimeout(() => { + dispatch({ type: "RUN", code }); + }, 0); } else if (state.runningState === "run") { dispatch({ type: "STOP_RUN" }); } From b1e7164c7e17a8221f0ca357d62f1b4cb0c62bcc Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Wed, 27 Jul 2022 22:37:46 +0400 Subject: [PATCH 107/203] delayed overlay and autorun spinner --- .../src/components/SquigglePlayground.tsx | 28 ++++++++++--------- .../components/src/components/ui/Toggle.tsx | 13 +++++++-- packages/components/tailwind.config.js | 23 ++++++++++++++- 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 2477f22f..79cac032 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -188,10 +188,7 @@ const RunControls: React.FC<{ )} = ({ const squiggleChart = renderedCode === "" ? null : ( - +
+ {isRunning ? ( +
+ ) : null} + +
); const firstTab = vars.showEditor ? ( diff --git a/packages/components/src/components/ui/Toggle.tsx b/packages/components/src/components/ui/Toggle.tsx index 17ecc3f6..bbf9a5ee 100644 --- a/packages/components/src/components/ui/Toggle.tsx +++ b/packages/components/src/components/ui/Toggle.tsx @@ -1,3 +1,4 @@ +import { RefreshIcon } from "@heroicons/react/solid"; import clsx from "clsx"; import React from "react"; @@ -29,8 +30,16 @@ export const Toggle: React.FC = ({ )} onClick={() => onChange(!status)} > -
- +
+ + {spinIcon && ( + + )}
{status ? onText : offText} diff --git a/packages/components/tailwind.config.js b/packages/components/tailwind.config.js index f059a98e..b49e3366 100644 --- a/packages/components/tailwind.config.js +++ b/packages/components/tailwind.config.js @@ -5,6 +5,27 @@ module.exports = { }, important: ".squiggle", theme: { - extend: {}, + extend: { + animation: { + "appear-and-spin": + "spin 1s linear infinite, squiggle-appear 0.2s forwards", + "semi-appear": "squiggle-semi-appear 0.2s forwards", + hide: "squiggle-hide 0.2s forwards", + }, + keyframes: { + "squiggle-appear": { + from: { opacity: 0 }, + to: { opacity: 1 }, + }, + "squiggle-semi-appear": { + from: { opacity: 0 }, + to: { opacity: 0.5 }, + }, + "squiggle-hide": { + from: { opacity: 1 }, + to: { opacity: 0 }, + }, + }, + }, }, }; From ec4777bd61e0f0812b7c6754adf26e776841f3ed Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Wed, 27 Jul 2022 23:01:15 +0400 Subject: [PATCH 108/203] don't spin pause icon on runs --- 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 79cac032..837c4bed 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -191,7 +191,7 @@ const RunControls: React.FC<{ icons={[CheckCircleIcon, PauseIcon]} status={autorunMode} onChange={onAutorunModeChange} - spinIcon={isRunning} + spinIcon={autorunMode && isRunning} />
); From 405c1bf8f3bec01aa136b05f6d2be9123f88a80e Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Wed, 27 Jul 2022 17:31:40 -0400 Subject: [PATCH 109/203] imported bindings --- .../SquiggleEditorImportedBindings.tsx | 50 +++++++++++++++++++ packages/components/src/index.ts | 1 + .../website/docs/Internal/ImportIntoMdx.mdx | 37 ++++++++++++++ packages/website/package.json | 2 +- .../website/static/squiggle/demo.squiggle | 4 ++ 5 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 packages/components/src/components/SquiggleEditorImportedBindings.tsx create mode 100644 packages/website/docs/Internal/ImportIntoMdx.mdx create mode 100644 packages/website/static/squiggle/demo.squiggle diff --git a/packages/components/src/components/SquiggleEditorImportedBindings.tsx b/packages/components/src/components/SquiggleEditorImportedBindings.tsx new file mode 100644 index 00000000..db8fd07d --- /dev/null +++ b/packages/components/src/components/SquiggleEditorImportedBindings.tsx @@ -0,0 +1,50 @@ +import React from "react"; +import { SquiggleEditor } from "./SquiggleEditor"; +import type { SquiggleEditorProps } from "./SquiggleEditor"; +import { runPartial, defaultBindings } from "@quri/squiggle-lang"; +import type { result, errorValue, bindings } from "@quri/squiggle-lang"; + +function resultDefault( + x: result, + defaul: bindings +): bindings { + switch (x.tag) { + case "Ok": + return x.value; + case "Error": + return defaul; + } +} + +function replaceBindings( + props: SquiggleEditorProps, + newBindings: bindings +): SquiggleEditorProps { + return { ...props, bindings: newBindings }; +} + +export type SquiggleEditorImportedBindingsProps = SquiggleEditorProps & { + bindingsImportFile: string; +}; + +export const SquiggleEditorImportedBindings: React.FC< + SquiggleEditorImportedBindingsProps +> = (props) => { + const [bindingsResult, setBindingsResult] = React.useState({ + tag: "Ok" as "Ok", + value: defaultBindings, + } as result); + React.useEffect(() => { + async function retrieveBindings(fileName: string) { + //: Promise> { + let contents = await fetch(fileName).then((response) => { + return response.text(); + }); + setBindingsResult(runPartial(contents)); + } + retrieveBindings(props.bindingsImportFile); + }, []); + const deliveredBindings = resultDefault(bindingsResult, {}); + const newProps = replaceBindings(props, deliveredBindings); + return ; +}; diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index ce6e107c..a1822c34 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -2,5 +2,6 @@ export { SquiggleChart } from "./components/SquiggleChart"; export { SquiggleEditor, SquigglePartial } from "./components/SquiggleEditor"; export { SquigglePlayground } from "./components/SquigglePlayground"; export { SquiggleContainer } from "./components/SquiggleContainer"; +export { SquiggleEditorImportedBindings } from "./components/SquiggleEditorImportedBindings"; export { mergeBindings } from "@quri/squiggle-lang"; diff --git a/packages/website/docs/Internal/ImportIntoMdx.mdx b/packages/website/docs/Internal/ImportIntoMdx.mdx new file mode 100644 index 00000000..218206da --- /dev/null +++ b/packages/website/docs/Internal/ImportIntoMdx.mdx @@ -0,0 +1,37 @@ +--- +title: How to import squiggle files into `.mdx` documents +sidebar_position: 5 +--- + +import { SquiggleEditorImportedBindings } from "../../src/components/SquiggleEditor"; + +_Proof of concept_ + +## Consider the following squiggle file + +In our docusaurus repo, we have a static asset called `demo.squiggle`. It looks like this + +```js +x = 1 to 2 +y = {a: x, b: 1e1} +f(t) = normal(t, 1.1) +z = y.b * y.a +``` + +We can call `f(z)` upon the assignments in `demo.squiggle` like so: + +```jsx +import { SquiggleEditorImportedBindings } from "../../src/components/SquiggleEditor"; + +; +``` + +Which would then look exactly like + + diff --git a/packages/website/package.json b/packages/website/package.json index 986b44c1..11e83791 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -15,7 +15,7 @@ "@docusaurus/core": "2.0.0-rc.1", "@docusaurus/preset-classic": "2.0.0-rc.1", "@heroicons/react": "^1.0.6", - "@quri/squiggle-components": "^0.2.20", + "@quri/squiggle-components": "^0.2.23", "base64-js": "^1.5.1", "clsx": "^1.2.1", "hast-util-is-element": "2.1.2", diff --git a/packages/website/static/squiggle/demo.squiggle b/packages/website/static/squiggle/demo.squiggle new file mode 100644 index 00000000..94ab4ac7 --- /dev/null +++ b/packages/website/static/squiggle/demo.squiggle @@ -0,0 +1,4 @@ +x = 1 to 2 +y = {a: x, b: 1e1} +f(t) = normal(t, 1.1) +z = y.b * y.a From a46f50dd0fd8894fe7dd6d2e1c750de3817cdab0 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Wed, 27 Jul 2022 17:40:21 -0400 Subject: [PATCH 110/203] removed comment, cleaned up a function --- .../src/components/SquiggleEditorImportedBindings.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/components/src/components/SquiggleEditorImportedBindings.tsx b/packages/components/src/components/SquiggleEditorImportedBindings.tsx index db8fd07d..f812a910 100644 --- a/packages/components/src/components/SquiggleEditorImportedBindings.tsx +++ b/packages/components/src/components/SquiggleEditorImportedBindings.tsx @@ -6,13 +6,12 @@ import type { result, errorValue, bindings } from "@quri/squiggle-lang"; function resultDefault( x: result, - defaul: bindings ): bindings { switch (x.tag) { case "Ok": return x.value; case "Error": - return defaul; + return defaultBindings; } } @@ -31,12 +30,11 @@ export const SquiggleEditorImportedBindings: React.FC< SquiggleEditorImportedBindingsProps > = (props) => { const [bindingsResult, setBindingsResult] = React.useState({ - tag: "Ok" as "Ok", + tag: "Ok", value: defaultBindings, } as result); React.useEffect(() => { async function retrieveBindings(fileName: string) { - //: Promise> { let contents = await fetch(fileName).then((response) => { return response.text(); }); @@ -44,7 +42,7 @@ export const SquiggleEditorImportedBindings: React.FC< } retrieveBindings(props.bindingsImportFile); }, []); - const deliveredBindings = resultDefault(bindingsResult, {}); + const deliveredBindings = resultDefault(bindingsResult); const newProps = replaceBindings(props, deliveredBindings); return ; }; From 2279624750628de059f853dcd6c5c4330f6af25f Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Wed, 27 Jul 2022 17:42:46 -0400 Subject: [PATCH 111/203] checking in editor.jsx file --- packages/website/src/components/SquiggleEditor.jsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/website/src/components/SquiggleEditor.jsx b/packages/website/src/components/SquiggleEditor.jsx index d8404b82..fd054d3b 100644 --- a/packages/website/src/components/SquiggleEditor.jsx +++ b/packages/website/src/components/SquiggleEditor.jsx @@ -12,3 +12,15 @@ export function SquiggleEditor(props) { ); } + +export function SquiggleEditorImportedBindings(props) { + return ( + }> + {() => { + const LibComponent = + require("@quri/squiggle-components").SquiggleEditorImportedBindings; + return ; + }} + + ); +} From 5f3dd1254266c8e101597a0436d1b027a6304d63 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Wed, 27 Jul 2022 17:44:09 -0400 Subject: [PATCH 112/203] fix lint --- .../src/components/SquiggleEditorImportedBindings.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/components/src/components/SquiggleEditorImportedBindings.tsx b/packages/components/src/components/SquiggleEditorImportedBindings.tsx index f812a910..d2debd9a 100644 --- a/packages/components/src/components/SquiggleEditorImportedBindings.tsx +++ b/packages/components/src/components/SquiggleEditorImportedBindings.tsx @@ -4,9 +4,7 @@ import type { SquiggleEditorProps } from "./SquiggleEditor"; import { runPartial, defaultBindings } from "@quri/squiggle-lang"; import type { result, errorValue, bindings } from "@quri/squiggle-lang"; -function resultDefault( - x: result, -): bindings { +function resultDefault(x: result): bindings { switch (x.tag) { case "Ok": return x.value; From 3f8b99aa3ae77c2c297eacfaad5d8a822ca902d9 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Wed, 27 Jul 2022 16:54:25 -0700 Subject: [PATCH 113/203] Improving Overview --- .../docs/Discussions/Future-Features.md | 50 +------------- packages/website/docs/Guides/Language.mdx | 13 ++++ packages/website/docs/Introduction.md | 30 -------- packages/website/docs/Overview.md | 68 +++++++++++++++++++ packages/website/docusaurus.config.js | 7 +- packages/website/sidebars.js | 4 +- 6 files changed, 91 insertions(+), 81 deletions(-) delete mode 100644 packages/website/docs/Introduction.md create mode 100644 packages/website/docs/Overview.md diff --git a/packages/website/docs/Discussions/Future-Features.md b/packages/website/docs/Discussions/Future-Features.md index 6070dbba..a7f24545 100644 --- a/packages/website/docs/Discussions/Future-Features.md +++ b/packages/website/docs/Discussions/Future-Features.md @@ -3,23 +3,15 @@ title: Future Features sidebar_position: 3 --- -Squiggle is still very early. The main first goal is to become stable. This means having a clean codebase, having decent test coverage, and having a syntax we are reasonably confident in. Later on, there are many other features that will be interesting to explore. +Squiggle is still very early. The main first goal is to become stable (to reach version 1.0). Right now we think it is useable to use for small projects, but do note that there are very likely some math bugs and performance problems. ## Programming Language Features -- Equality (a == b) -- If/else statements -- Arrays - Tables / Matrices -- Simple objects - A simple type system -- Simple module system (`Dist.Normal` instead of `normal`) - A simple time library & notation - Optional and default paramaters for functions -- Anonymous Functions (This is particularly convenient in cases where tiny functions are submitted in forecasting competitions) - A notation to limit the domain of functions. For example, maybe a function only applies for t=[2 to 20] -- Custom parser (Right now we're using Math.js's parser, which doesn't give us much flexibility) -- "Partial-domain" distributions. For example, maybe someone has a distribution for when AGI will happen, but doesn't want to make any estimates past 2200. ## Distribution Features @@ -34,12 +26,6 @@ Takes a distribution and smoothens it. For example, [Elicit Forecast](https://fo **Probabilities** Right now Squiggle mostly works with probability distributions only, but it should also work smoothly with probabilities. -**Scoring** -Have functions to score probabilities, probability distributions, and functions that return probability distributions. - -**Full javascript library** -A full Javascript library that accesses most of the probabilistic functionality of Squiggle, but can be used directly in javascript functions. - **Importance & quality scores** Workflows/functionality to declare the importance and coveredness of each part of the paramater space. For example, some subsets of the paramater space of a function might be much more important to get right than others. Similarly, the analyst might be much more certain about some parts than others. Ideally. they could decline sections. @@ -52,12 +38,6 @@ Of course, we'd also need good math for how the scoring should work, exactly. This interface should also be able to handle changing Squiggle values. This is because people would be likely to want to update their functions over time, and that should be taken into account for scoring. -**Easily call other functions** -It would be great to be able to call other people's Squiggle functions, from other Squiggle functions. This could raise a whole bunch of challenging issues. Additionally, it would be neat to call other data, both from knowledge graphs, and from regular APIs. Note that this could obviously complicate scoring a lot; I imagine that either easy scoring, or simple data fetching, would have to accept sacrifices. - -**Correlated uncertainties** -Right now there's no functionality to declare that two different distributions are correlated. - **Static / Sensitivity Analysis** Guesstimate has Sensitivity analysis that's pretty useful. This could be quite feasible to add, though it will likely require some thinking. @@ -70,15 +50,6 @@ Right now, Monte Carlo simulations are totally random. It would be nicer to be a ## Major Standard Language Features - Some testing story. -- A custom code highlighting format. -- Possibly a decent web GUI (a much more advanced playground). -- A VS Code extention and similar. - -## Bugs - -- Discrete distributions are particularly buggy. Try `mm(1,2,3,4,5,6,7,8,9,10) .* (5 to 8)` - -## New Functions ### Distributions @@ -86,21 +57,4 @@ Right now, Monte Carlo simulations are totally random. It would be nicer to be a cauchy(); pareto(); metalog(); -``` - -Possibly change mm to mix, or mx(). Also, change input format, maybe to mx([a,b,c], [a,b,c]). - -### Functions - -```js -samples(distribution, n); -toPdf(distribution); -toCdf(distribution); -toHash(distribution); -trunctate(distribution, leftValue, rightValue); -leftTrunctate(distribution, leftValue); -rightTrunctate(distribution, rightValue); -distributionFromSamples(array, params); -distributionFromPoints(); -distributionFromHash(); -``` +``` \ No newline at end of file diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index 90ee25b5..61882308 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -47,6 +47,19 @@ f`} +### Comments + + + +### Pipes + + truncateLeft(3) |> SampleSet.fromDist`} /> + ## See more - [Distribution creation](./DistributionCreation) diff --git a/packages/website/docs/Introduction.md b/packages/website/docs/Introduction.md deleted file mode 100644 index 22359de2..00000000 --- a/packages/website/docs/Introduction.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -sidebar_position: 1 -title: Introduction ---- - -Squiggle is a simple programming language for intuitive probabilistic estimation. It's meant for quantitative forecasting and evaluations. - -The basics of Squiggle can be pretty simple and intuitive. The more advanced functionality can take some time to learn. - -## What Squiggle Is - -- A simple programming language for doing math with probability distributions -- An embeddable language that can be used in Javascript applications -- A tool to embed functions as forecasts that can be embedded in other applications - -## What Squiggle Is Not - -- A complete replacement for enterprise Risk Analysis tools (See Crystal Ball, @Risk, Lumina Analytica) -- A Probabilistic Programming Language with backwards inference and sophisticated sampling algorithms. (See [PPLs](https://en.wikipedia.org/wiki/Probabilistic_programming)) -- A visual tool aimed at casual users (see Guesstimate, Causal) - -## Get started - -- [Gallery](./Discussions/Gallery) -- [Squiggle playground](/playground) -- [Language basics](./Guides/Language) -- [Squiggle functions source of truth](./Guides/Functions) -- [Known bugs](./Discussions/Bugs) -- [Original lesswrong sequence](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3) -- [Author your squiggle models as Observable notebooks](https://observablehq.com/@hazelfire/squiggle) diff --git a/packages/website/docs/Overview.md b/packages/website/docs/Overview.md new file mode 100644 index 00000000..a843c162 --- /dev/null +++ b/packages/website/docs/Overview.md @@ -0,0 +1,68 @@ +--- +sidebar_position: 1 +title: Overview +--- + +Squiggle is a minimalist programming language for probabilistic estimation. It's meant for intuitively-driven quantitative estimation instead of data analysis or data-driven statistical techniques. + +The basics of Squiggle are fairly straightforward. This can be enough for many models. The more advanced functionality can take some time to learn. + +## Using Squiggle +You can currently interact with Squiggle in a few ways: + +**[Playground](/playground)** +The [Squiggle Playground](/playground) is a nice tool for working with small models and making prototypes. You can make simple sharable links, but you can't save models that change over time. + +**[Typescript Library](https://www.npmjs.com/package/@quri/squiggle-lang)** +Squiggle is built using [Rescript](https://rescript-lang.org/), and is accessible via a simple Typescript library. You can use this library to either run Squiggle code in full, or to call select specific functions within Squiggle (though this latter functionality is very minimal). + +**[React Components Library](https://www.npmjs.com/package/@quri/squiggle-components)** +All of the components used in the playground and documentation are available in a separate component NPM repo. You can see the full Storybook of components [here](https://squiggle-components.netlify.app). + +**[Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle)** +There's a simple [VS Code extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) for running and visualizing Squiggle code. We find that VS Code is a useful editor for managing larger Squiggle setups. + +## Squiggle Vs. Other Tools + +### What Squiggle Is + +- A simple programming language for doing math with probability distributions. +- An embeddable language that can be used in Javascript applications. +- A tool to encode functions as forecasts that can be embedded in other applications. + +### What Squiggle Is Not + +- A complete replacement for enterprise Risk Analysis tools. (See [Crystal Ball](https://www.oracle.com/applications/crystalball/), [@Risk](https://www.palisade.com/risk/), [Lumina Analytica](https://lumina.com/)) +- A [probabilistic programming language](https://en.wikipedia.org/wiki/Probabilistic_programming). Squiggle does not support Bayesian inference. +- A tool for substantial data analysis. (See programming languages like [Python](https://www.python.org/) or [Julia](https://julialang.org/)) +- A programming language for anything other than estimation. +- A visually-driven tool. (See [Guesstimate](https://www.getguesstimate.com/) and [Causal](https://causal.app/)) + +### Strengths +- Simple and readable syntax, especially for dealing with probabilistic math. +- Fast for relatively small models. Strong for rapid prototyping. +- Optimized for using some numeric and symbolic approaches, not just Monte Carlo. +- Embeddable in Javascript. +- Free and open-source. + +### Weaknesses +- Limited scientific capabilities. +- Much slower than serious probabilistic programming languages on sizeable models. +- Can't do Bayesian backwards inference. +- Essentially no support for libraries or modules (yet). +- Still very new, so a tiny ecosystem. +- Still very new, so there are likely math bugs. +- Generally not as easy to use as Guesstimate or Causal, especially for non programmers. + +## Organization +Squiggle is one of the main projects of [The Quantified Uncertainty Research Institute](https://quantifieduncertainty.org/). QURI is a nonprofit funded primarily by [Effective Altruist](https://www.effectivealtruism.org/) donors. + +## Get started + +- [Gallery](./Discussions/Gallery) +- [Squiggle playground](/playground) +- [Language basics](./Guides/Language) +- [Squiggle functions source of truth](./Guides/Functions) +- [Known bugs](./Discussions/Bugs) +- [Original lesswrong sequence](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3) +- [Author your squiggle models as Observable notebooks](https://observablehq.com/@hazelfire/squiggle) diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index 06c7b504..319dbee6 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -61,7 +61,7 @@ const config = { items: [ { type: "doc", - docId: "Introduction", + docId: "Overview", position: "left", label: "Documentation", }, @@ -83,6 +83,11 @@ const config = { label: "GitHub", position: "right", }, + { + href: "https://quantifieduncertainty.org/", + label: "QURI", + position: "right", + }, ], }, footer: { diff --git a/packages/website/sidebars.js b/packages/website/sidebars.js index a22b80a8..5c33d56c 100644 --- a/packages/website/sidebars.js +++ b/packages/website/sidebars.js @@ -23,8 +23,8 @@ const sidebars = { tutorialSidebar: [ { type: "doc", - id: "Introduction", - label: "Introduction", + id: "Overview", + label: "Overview", }, { type: "doc", From 327dc521f1ecd1316102d3241bba562bbc56b8a0 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Wed, 27 Jul 2022 21:08:10 -0700 Subject: [PATCH 114/203] Modifiying Overview page and Guides --- .../docs/Api/{DistGeneric.mdx => Dist.mdx} | 0 .../docs/Guides/DistributionCreation.mdx | 2 +- packages/website/docs/Guides/Functions.mdx | 2 +- packages/website/docs/Guides/Language.mdx | 68 +++++++++++++------ packages/website/docs/Overview.md | 7 ++ packages/website/docusaurus.config.js | 2 +- 6 files changed, 59 insertions(+), 22 deletions(-) rename packages/website/docs/Api/{DistGeneric.mdx => Dist.mdx} (100%) diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/Dist.mdx similarity index 100% rename from packages/website/docs/Api/DistGeneric.mdx rename to packages/website/docs/Api/Dist.mdx diff --git a/packages/website/docs/Guides/DistributionCreation.mdx b/packages/website/docs/Guides/DistributionCreation.mdx index 23a4bf0e..a0833a6d 100644 --- a/packages/website/docs/Guides/DistributionCreation.mdx +++ b/packages/website/docs/Guides/DistributionCreation.mdx @@ -1,5 +1,5 @@ --- -title: "Distribution Creation" +title: "Distributions: Creation" sidebar_position: 2 --- diff --git a/packages/website/docs/Guides/Functions.mdx b/packages/website/docs/Guides/Functions.mdx index 843cf888..4a4bc170 100644 --- a/packages/website/docs/Guides/Functions.mdx +++ b/packages/website/docs/Guides/Functions.mdx @@ -1,5 +1,5 @@ --- -title: "Distribution Functions" +title: "Distributions: Key Functions" sidebar_position: 3 --- diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index 61882308..c5b92fd1 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -5,63 +5,93 @@ title: Language Basics import { SquiggleEditor } from "../../src/components/SquiggleEditor"; -## Expressions +Squiggle supports some simple types and language features. -### Numbers +## Numbers -### Distributions +## Distributions +There are several ways of easily entering distributions. See the [documentation](/docs/Api/Dist/) on distributions for a complete API. -### Lists +## Lists +Squiggle lists can accept items of any type, similar to those in Python. [API](/docs/Api/List). - - -### Dictionaries +## Dictionaries +Squiggle dictionaries work similarly to Python dictionaries. [API](/docs/Api/Dictionary). -### Functions +## Functions -### Anonymous Functions +## Anonymous Functions -### Comments +## Comments - -### Pipes +## Pipes - truncateLeft(3) |> SampleSet.fromDist`} /> +Squiggle features [data-first](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/) pipes. Functions in the standard library are organized to make this convenient. + truncateLeft(3) |> SampleSet.fromDist |> SampleSet.map({|r| r + 10})`} /> -## See more +## Standard Library -- [Distribution creation](./DistributionCreation) -- [Functions reference](./Functions) -- [Gallery](../Discussions/Gallery) +Squiggle features a simple [standard libary](/docs/Api/Dist). + +Most functions are namespaced under their respective types to keep functionality distinct. Certain popular functions are usable without their namespaces. + +For example, + SampleSet.fromList // namespaces required +b = normal(5,2) // namespace not required +c = 5 to 10 // namespace not required +""`} /> + +## Number Prefixes +Numbers support a few scientific notation prefixes. + +| prefix | multiplier | +|-----|-------| +| n | 10^-9 | +| m | 10^-3 | +| k | 10^3 | +| M | 10^6 | +| B,G | 10^9 | +| T | 10^12 | +| P | 10^15 | + + + + +## Gotchas and Key Limitations +**** \ No newline at end of file diff --git a/packages/website/docs/Overview.md b/packages/website/docs/Overview.md index a843c162..ef330ae4 100644 --- a/packages/website/docs/Overview.md +++ b/packages/website/docs/Overview.md @@ -22,6 +22,13 @@ All of the components used in the playground and documentation are available in **[Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle)** There's a simple [VS Code extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) for running and visualizing Squiggle code. We find that VS Code is a useful editor for managing larger Squiggle setups. +## Very simple model + +```squiggle +//Write comments like this +/* +``` + ## Squiggle Vs. Other Tools ### What Squiggle Is diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index 3f7a046f..f48ac952 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -68,7 +68,7 @@ const config = { }, { type: "doc", - docId: "Api/DistGeneric", + docId: "Api/Dist", position: "left", label: "API", }, From 31626b05c4176ee7f8913a9403c152507acb88bc Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Wed, 27 Jul 2022 22:09:43 -0700 Subject: [PATCH 115/203] Added a simple example --- .../src/components/SquiggleChart.tsx | 2 +- packages/website/docs/Guides/Language.mdx | 4 -- .../docs/{Overview.md => Overview.mdx} | 58 ++++++++++++++++--- 3 files changed, 52 insertions(+), 12 deletions(-) rename packages/website/docs/{Overview.md => Overview.mdx} (64%) diff --git a/packages/components/src/components/SquiggleChart.tsx b/packages/components/src/components/SquiggleChart.tsx index 86b2b078..00688512 100644 --- a/packages/components/src/components/SquiggleChart.tsx +++ b/packages/components/src/components/SquiggleChart.tsx @@ -73,7 +73,7 @@ export const SquiggleChart: React.FC = React.memo( expY = false, diagramStart = 0, diagramStop = 10, - diagramCount = 100, + diagramCount = 20, tickFormat, minX, maxX, diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index c5b92fd1..71f7e888 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -91,7 +91,3 @@ Numbers support a few scientific notation prefixes. - - -## Gotchas and Key Limitations -**** \ No newline at end of file diff --git a/packages/website/docs/Overview.md b/packages/website/docs/Overview.mdx similarity index 64% rename from packages/website/docs/Overview.md rename to packages/website/docs/Overview.mdx index ef330ae4..528e1a88 100644 --- a/packages/website/docs/Overview.md +++ b/packages/website/docs/Overview.mdx @@ -3,10 +3,61 @@ sidebar_position: 1 title: Overview --- +import { SquiggleEditor } from "../src/components/SquiggleEditor"; + Squiggle is a minimalist programming language for probabilistic estimation. It's meant for intuitively-driven quantitative estimation instead of data analysis or data-driven statistical techniques. The basics of Squiggle are fairly straightforward. This can be enough for many models. The more advanced functionality can take some time to learn. +## Simple example +Say you're trying to estimate the number of piano tuners in New York City. You can build a simple model of this, like so. +(Tip: This is interactive! Feel free to modify the code directly.) + + + +--- + +Now let's take this a bit further. Let's imagine that you think that NYC will grow over time, and you'd like to estimate the number of piano tuners for every point in time for the next few years. + + + +If you haven't noticed yet, you can hover over the `populationAtTime` graph to see the distribution of population at different points in time. + + + ## Using Squiggle You can currently interact with Squiggle in a few ways: @@ -22,13 +73,6 @@ All of the components used in the playground and documentation are available in **[Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle)** There's a simple [VS Code extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) for running and visualizing Squiggle code. We find that VS Code is a useful editor for managing larger Squiggle setups. -## Very simple model - -```squiggle -//Write comments like this -/* -``` - ## Squiggle Vs. Other Tools ### What Squiggle Is From fc88b065f583159c98832e7eb1bc8e3dacbe2d43 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 28 Jul 2022 13:42:27 +0200 Subject: [PATCH 116/203] 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 5618ef3f341d1412c799321b0d30453b6b9451ac Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Wed, 27 Jul 2022 23:00:00 +0400 Subject: [PATCH 117/203] remove SquiggleItem, unused --- .../src/components/SquiggleItem.tsx | 287 ------------------ 1 file changed, 287 deletions(-) delete mode 100644 packages/components/src/components/SquiggleItem.tsx diff --git a/packages/components/src/components/SquiggleItem.tsx b/packages/components/src/components/SquiggleItem.tsx deleted file mode 100644 index 52330e8b..00000000 --- a/packages/components/src/components/SquiggleItem.tsx +++ /dev/null @@ -1,287 +0,0 @@ -import * as React from "react"; -import { - squiggleExpression, - environment, - declaration, -} from "@quri/squiggle-lang"; -import { NumberShower } from "./NumberShower"; -import { - DistributionChart, - DistributionPlottingSettings, -} from "./DistributionChart"; -import { FunctionChart, FunctionChartSettings } from "./FunctionChart"; - -function getRange
(x: declaration) { - const first = x.args[0]; - switch (first.tag) { - case "Float": { - return { floats: { min: first.value.min, max: first.value.max } }; - } - case "Date": { - return { time: { min: first.value.min, max: first.value.max } }; - } - } -} - -function getChartSettings(x: declaration): FunctionChartSettings { - const range = getRange(x); - const min = range.floats ? range.floats.min : 0; - const max = range.floats ? range.floats.max : 10; - return { - start: min, - stop: max, - count: 20, - }; -} - -interface VariableBoxProps { - heading: string; - children: React.ReactNode; - showTypes: boolean; -} - -export const VariableBox: React.FC = ({ - heading = "Error", - children, - showTypes = false, -}) => { - if (showTypes) { - return ( -
-
-
{heading}
-
-
{children}
-
- ); - } else { - return
{children}
; - } -}; - -export interface SquiggleItemProps { - /** The input string for squiggle */ - expression: squiggleExpression; - width?: number; - height: number; - distributionPlotSettings: DistributionPlottingSettings; - /** Whether to show type information */ - showTypes: boolean; - /** Settings for displaying functions */ - chartSettings: FunctionChartSettings; - /** Environment for further function executions */ - environment: environment; -} - -export const SquiggleItem: React.FC = ({ - expression, - width, - height, - distributionPlotSettings, - showTypes = false, - chartSettings, - environment, -}) => { - switch (expression.tag) { - case "number": - return ( - -
- -
-
- ); - case "distribution": { - const distType = expression.value.type(); - return ( - - {distType === "Symbolic" && showTypes ? ( -
{expression.value.toString()}
- ) : null} - -
- ); - } - case "string": - return ( - - " - - {expression.value} - - " - - ); - case "boolean": - return ( - - {expression.value.toString()} - - ); - case "symbol": - return ( - - Undefined Symbol: - {expression.value} - - ); - case "call": - return ( - - {expression.value} - - ); - case "array": - return ( - - {expression.value.map((r, i) => ( -
-
-
{i}
-
-
- -
-
- ))} -
- ); - case "record": - return ( - -
- {Object.entries(expression.value).map(([key, r]) => ( -
-
-
{key}:
-
-
- -
-
- ))} -
-
- ); - case "arraystring": - return ( - - {expression.value.map((r) => `"${r}"`).join(", ")} - - ); - case "date": - return ( - - {expression.value.toDateString()} - - ); - case "void": - return ( - - {"Void"} - - ); - case "timeDuration": { - return ( - - - - ); - } - case "lambda": - return ( - -
{`function(${expression.value.parameters.join( - "," - )})`}
- -
- ); - case "lambdaDeclaration": { - return ( - - - - ); - } - case "module": { - return ( - -
- {Object.entries(expression.value) - .filter(([key, r]) => key !== "Math") - .map(([key, r]) => ( -
-
-
{key}:
-
-
- -
-
- ))} -
-
- ); - } - default: { - return ( -
- No display for type: {" "} - {expression.tag} -
- ); - } - } -}; From e1f178d0ae2c71e8441b03205429d1f57ed866d8 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Thu, 28 Jul 2022 18:16:31 +0400 Subject: [PATCH 118/203] lazy tabs (fixes #506) --- .../website/docs/Guides/DistributionCreation.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/website/docs/Guides/DistributionCreation.mdx b/packages/website/docs/Guides/DistributionCreation.mdx index 23a4bf0e..075f036d 100644 --- a/packages/website/docs/Guides/DistributionCreation.mdx +++ b/packages/website/docs/Guides/DistributionCreation.mdx @@ -17,7 +17,7 @@ The `to` function is an easy way to generate simple distributions using predicte If both values are above zero, a `lognormal` distribution is used. If not, a `normal` distribution is used. - + When 5 to 10 is entered, both numbers are positive, so it generates a lognormal distribution with 5th and 95th percentiles at 5 and @@ -74,7 +74,7 @@ If both values are above zero, a `lognormal` distribution is used. If not, a `no The `mixture` mixes combines multiple distributions to create a mixture. You can optionally pass in a list of proportional weights. - + @@ -139,7 +139,7 @@ mx(forecast, forecast_if_completely_wrong, [1-chance_completely_wrong, chance_co Creates a [normal distribution](https://en.wikipedia.org/wiki/Normal_distribution) with the given mean and standard deviation. - + @@ -234,7 +234,7 @@ with values at 1 and 2. Therefore, this is the same as `mixture(pointMass(1),poi `pointMass()` distributions are currently the only discrete distributions accessible in Squiggle. - + @@ -263,7 +263,7 @@ with values at 1 and 2. Therefore, this is the same as `mixture(pointMass(1),poi Creates a [beta distribution](https://en.wikipedia.org/wiki/Beta_distribution) with the given `alpha` and `beta` values. For a good summary of the beta distribution, see [this explanation](https://stats.stackexchange.com/a/47782) on Stack Overflow. - + @@ -300,7 +300,7 @@ Creates a [beta distribution](https://en.wikipedia.org/wiki/Beta_distribution) w

Examples - + From ff05685634ce60dacb188fd283ab83697b233b19 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 28 Jul 2022 10:33:31 -0400 Subject: [PATCH 119/203] @berekuk's CR --- ...=> SquiggleEditorWithImportedBindings.tsx} | 35 +++++++++---------- .../website/docs/Internal/ImportIntoMdx.mdx | 10 +++--- .../website/src/components/SquiggleEditor.jsx | 4 +-- .../{squiggle => estimates}/demo.squiggle | 0 4 files changed, 24 insertions(+), 25 deletions(-) rename packages/components/src/components/{SquiggleEditorImportedBindings.tsx => SquiggleEditorWithImportedBindings.tsx} (51%) rename packages/website/static/{squiggle => estimates}/demo.squiggle (100%) diff --git a/packages/components/src/components/SquiggleEditorImportedBindings.tsx b/packages/components/src/components/SquiggleEditorWithImportedBindings.tsx similarity index 51% rename from packages/components/src/components/SquiggleEditorImportedBindings.tsx rename to packages/components/src/components/SquiggleEditorWithImportedBindings.tsx index d2debd9a..5b95a698 100644 --- a/packages/components/src/components/SquiggleEditorImportedBindings.tsx +++ b/packages/components/src/components/SquiggleEditorWithImportedBindings.tsx @@ -2,9 +2,13 @@ import React from "react"; import { SquiggleEditor } from "./SquiggleEditor"; import type { SquiggleEditorProps } from "./SquiggleEditor"; import { runPartial, defaultBindings } from "@quri/squiggle-lang"; -import type { result, errorValue, bindings } from "@quri/squiggle-lang"; +import type { + result, + errorValue, + bindings as bindingsType, +} from "@quri/squiggle-lang"; -function resultDefault(x: result): bindings { +function resultDefault(x: result): bindings { switch (x.tag) { case "Ok": return x.value; @@ -13,24 +17,18 @@ function resultDefault(x: result): bindings { } } -function replaceBindings( - props: SquiggleEditorProps, - newBindings: bindings -): SquiggleEditorProps { - return { ...props, bindings: newBindings }; -} - -export type SquiggleEditorImportedBindingsProps = SquiggleEditorProps & { - bindingsImportFile: string; +export type SquiggleEditorWithImportedBindingsProps = SquiggleEditorProps & { + bindingsImportUrl: string; }; -export const SquiggleEditorImportedBindings: React.FC< - SquiggleEditorImportedBindingsProps +export const SquiggleEditorWithImportedBindings: React.FC< + SquiggleEditorWithImportedBindingsProps > = (props) => { + const { bindingsImportUrl, ...editorProps } = props; const [bindingsResult, setBindingsResult] = React.useState({ tag: "Ok", value: defaultBindings, - } as result); + } as result); React.useEffect(() => { async function retrieveBindings(fileName: string) { let contents = await fetch(fileName).then((response) => { @@ -38,9 +36,10 @@ export const SquiggleEditorImportedBindings: React.FC< }); setBindingsResult(runPartial(contents)); } - retrieveBindings(props.bindingsImportFile); - }, []); + retrieveBindings(bindingsImportUrl); + }, [bindingsImportUrl]); const deliveredBindings = resultDefault(bindingsResult); - const newProps = replaceBindings(props, deliveredBindings); - return ; + return ( + + ); }; diff --git a/packages/website/docs/Internal/ImportIntoMdx.mdx b/packages/website/docs/Internal/ImportIntoMdx.mdx index 218206da..d590c120 100644 --- a/packages/website/docs/Internal/ImportIntoMdx.mdx +++ b/packages/website/docs/Internal/ImportIntoMdx.mdx @@ -3,7 +3,7 @@ title: How to import squiggle files into `.mdx` documents sidebar_position: 5 --- -import { SquiggleEditorImportedBindings } from "../../src/components/SquiggleEditor"; +import { SquiggleEditorWithImportedBindings } from "../../src/components/SquiggleEditor"; _Proof of concept_ @@ -21,17 +21,17 @@ z = y.b * y.a We can call `f(z)` upon the assignments in `demo.squiggle` like so: ```jsx -import { SquiggleEditorImportedBindings } from "../../src/components/SquiggleEditor"; +import { SquiggleEditorWithImportedBindings } from "../../src/components/SquiggleEditor"; ; ``` Which would then look exactly like - diff --git a/packages/website/src/components/SquiggleEditor.jsx b/packages/website/src/components/SquiggleEditor.jsx index fd054d3b..353fa0b2 100644 --- a/packages/website/src/components/SquiggleEditor.jsx +++ b/packages/website/src/components/SquiggleEditor.jsx @@ -13,12 +13,12 @@ export function SquiggleEditor(props) { ); } -export function SquiggleEditorImportedBindings(props) { +export function SquiggleEditorWithImportedBindings(props) { return ( }> {() => { const LibComponent = - require("@quri/squiggle-components").SquiggleEditorImportedBindings; + require("@quri/squiggle-components").SquiggleEditorWithImportedBindings; return ; }} diff --git a/packages/website/static/squiggle/demo.squiggle b/packages/website/static/estimates/demo.squiggle similarity index 100% rename from packages/website/static/squiggle/demo.squiggle rename to packages/website/static/estimates/demo.squiggle From a536f1f4e142ae0de25a34290129d91b53652270 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 28 Jul 2022 10:37:00 -0400 Subject: [PATCH 120/203] trailing slash? --- packages/website/docs/Internal/ImportIntoMdx.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/docs/Internal/ImportIntoMdx.mdx b/packages/website/docs/Internal/ImportIntoMdx.mdx index d590c120..4a3a761b 100644 --- a/packages/website/docs/Internal/ImportIntoMdx.mdx +++ b/packages/website/docs/Internal/ImportIntoMdx.mdx @@ -25,7 +25,7 @@ import { SquiggleEditorWithImportedBindings } from "../../src/components/Squiggl ; ``` @@ -33,5 +33,5 @@ Which would then look exactly like From 7fc646f5b5b316d853bd840a473ac4717408ff53 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 28 Jul 2022 10:43:27 -0400 Subject: [PATCH 121/203] fix build --- .../src/components/SquiggleEditorWithImportedBindings.tsx | 2 +- packages/components/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/src/components/SquiggleEditorWithImportedBindings.tsx b/packages/components/src/components/SquiggleEditorWithImportedBindings.tsx index 5b95a698..b04706a3 100644 --- a/packages/components/src/components/SquiggleEditorWithImportedBindings.tsx +++ b/packages/components/src/components/SquiggleEditorWithImportedBindings.tsx @@ -8,7 +8,7 @@ import type { bindings as bindingsType, } from "@quri/squiggle-lang"; -function resultDefault(x: result): bindings { +function resultDefault(x: result): bindingsType { switch (x.tag) { case "Ok": return x.value; diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index a1822c34..f51ab57a 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -2,6 +2,6 @@ export { SquiggleChart } from "./components/SquiggleChart"; export { SquiggleEditor, SquigglePartial } from "./components/SquiggleEditor"; export { SquigglePlayground } from "./components/SquigglePlayground"; export { SquiggleContainer } from "./components/SquiggleContainer"; -export { SquiggleEditorImportedBindings } from "./components/SquiggleEditorImportedBindings"; +export { SquiggleEditorWithImportedBindings } from "./components/SquiggleEditorWithImportedBindings"; export { mergeBindings } from "@quri/squiggle-lang"; From 33e5ebd6da42a3a5b7bd04384bd26df9af3e5204 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 28 Jul 2022 10:43:59 -0400 Subject: [PATCH 122/203] `yarn format` compels me --- .../src/rescript/ReducerInterface/ReducerInterface_StdLib.res | 3 ++- packages/vscode-ext/README.md | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 diff --git a/packages/vscode-ext/README.md b/packages/vscode-ext/README.md index 1c529ddd..cb161038 100644 --- a/packages/vscode-ext/README.md +++ b/packages/vscode-ext/README.md @@ -9,7 +9,7 @@ Features: - Preview `.squiggle` files in a preview pane - Syntax highlighting for `.squiggle` and `.squiggleU` files -## Installation +## Installation You can install this extension by going to the "extensions" tab, searching for "Squiggle", and then installing it. @@ -23,7 +23,7 @@ After loading a `.squiggle` file, an "Open Preview" button will appear. If you c ### Configuration (optional) -Some preview settings, e.g. whether to show the summary table or types of outputs, can be configurable on in the VS Code settings and persist between different preview sessions. The VS Code settings can be accessed with the shortcut `Ctrl+,` with `Ctrl+Shift+P` + searching "Open Settings", or by accessing a file like `$HOME/.config/Code/User/settings.json` in Linux (see [here](https://stackoverflow.com/questions/65908987/how-can-i-open-visual-studio-codes-settings-json-file)) for other operating systems. +Some preview settings, e.g. whether to show the summary table or types of outputs, can be configurable on in the VS Code settings and persist between different preview sessions. The VS Code settings can be accessed with the shortcut `Ctrl+,` with `Ctrl+Shift+P` + searching "Open Settings", or by accessing a file like `$HOME/.config/Code/User/settings.json` in Linux (see [here](https://stackoverflow.com/questions/65908987/how-can-i-open-visual-studio-codes-settings-json-file)) for other operating systems. ![](./images/vs-code-settings.png) From c77795c83288ec76987444b26d89e0cdf0d0afa6 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 28 Jul 2022 10:57:58 -0400 Subject: [PATCH 123/203] absolute path for `bindingsImportsFile` --- packages/website/docs/Internal/ImportIntoMdx.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/docs/Internal/ImportIntoMdx.mdx b/packages/website/docs/Internal/ImportIntoMdx.mdx index 4a3a761b..60ec93fd 100644 --- a/packages/website/docs/Internal/ImportIntoMdx.mdx +++ b/packages/website/docs/Internal/ImportIntoMdx.mdx @@ -25,7 +25,7 @@ import { SquiggleEditorWithImportedBindings } from "../../src/components/Squiggl ; ``` @@ -33,5 +33,5 @@ Which would then look exactly like From 779fcf4fc65bc8a6cdb68b3746033c9dc178760c Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 28 Jul 2022 11:07:32 -0400 Subject: [PATCH 124/203] inherit props to `runPartial` --- .../components/SquiggleEditorWithImportedBindings.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/components/src/components/SquiggleEditorWithImportedBindings.tsx b/packages/components/src/components/SquiggleEditorWithImportedBindings.tsx index b04706a3..5dcc3241 100644 --- a/packages/components/src/components/SquiggleEditorWithImportedBindings.tsx +++ b/packages/components/src/components/SquiggleEditorWithImportedBindings.tsx @@ -34,7 +34,14 @@ export const SquiggleEditorWithImportedBindings: React.FC< let contents = await fetch(fileName).then((response) => { return response.text(); }); - setBindingsResult(runPartial(contents)); + setBindingsResult( + runPartial( + contents, + editorProps.bindings, + editorProps.environment, + editorProps.jsImports + ) + ); } retrieveBindings(bindingsImportUrl); }, [bindingsImportUrl]); From 91246ffad3af1c4b4f7d5de811445dc754b2cca8 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 28 Jul 2022 11:17:14 -0400 Subject: [PATCH 125/203] changed import from local docusaurus component to `@quri/squiggle-components` component --- packages/website/docs/Internal/ImportIntoMdx.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/website/docs/Internal/ImportIntoMdx.mdx b/packages/website/docs/Internal/ImportIntoMdx.mdx index 60ec93fd..d9de9b09 100644 --- a/packages/website/docs/Internal/ImportIntoMdx.mdx +++ b/packages/website/docs/Internal/ImportIntoMdx.mdx @@ -3,7 +3,7 @@ title: How to import squiggle files into `.mdx` documents sidebar_position: 5 --- -import { SquiggleEditorWithImportedBindings } from "../../src/components/SquiggleEditor"; +import { SquiggleEditorWithImportedBindings } from "@quri/squiggle-components"; _Proof of concept_ @@ -21,11 +21,11 @@ z = y.b * y.a We can call `f(z)` upon the assignments in `demo.squiggle` like so: ```jsx -import { SquiggleEditorWithImportedBindings } from "../../src/components/SquiggleEditor"; +import { SquiggleEditorWithImportedBindings } from "@quri/squiggle-components"; -; ``` From 3f6e1b2caf4da3455307689827ce78bfa195b707 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 28 Jul 2022 11:26:22 -0400 Subject: [PATCH 126/203] revert last commit --- packages/website/docs/Internal/ImportIntoMdx.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/docs/Internal/ImportIntoMdx.mdx b/packages/website/docs/Internal/ImportIntoMdx.mdx index d9de9b09..683f9311 100644 --- a/packages/website/docs/Internal/ImportIntoMdx.mdx +++ b/packages/website/docs/Internal/ImportIntoMdx.mdx @@ -3,7 +3,7 @@ title: How to import squiggle files into `.mdx` documents sidebar_position: 5 --- -import { SquiggleEditorWithImportedBindings } from "@quri/squiggle-components"; +import { SquiggleEditorWithImportedBindings } from "../../src/components/SquiggleEditor"; _Proof of concept_ @@ -21,7 +21,7 @@ z = y.b * y.a We can call `f(z)` upon the assignments in `demo.squiggle` like so: ```jsx -import { SquiggleEditorWithImportedBindings } from "@quri/squiggle-components"; +import { SquiggleEditorWithImportedBindings } from "../../src/components/SquiggleEditor"; Date: Thu, 28 Jul 2022 19:14:39 +0400 Subject: [PATCH 127/203] copy share link button --- .../src/components/SquigglePlayground.tsx | 45 ++++++++++++++++--- .../components/src/components/ui/Button.tsx | 22 +++++++++ .../stories/SquigglePlayground.stories.mdx | 13 ++++++ packages/website/src/pages/playground.js | 1 + 4 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 packages/components/src/components/ui/Button.tsx diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 837c4bed..626fc354 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -13,6 +13,7 @@ import { yupResolver } from "@hookform/resolvers/yup"; import { ChartSquareBarIcon, CheckCircleIcon, + ClipboardCopyIcon, CodeIcon, CogIcon, CurrencyDollarIcon, @@ -40,6 +41,7 @@ import { defaultColor, defaultTickFormat, } from "../lib/distributionSpecBuilder"; +import { Button } from "./ui/Button"; type PlaygroundProps = SquiggleChartProps & { /** The initial squiggle string to put in the playground */ @@ -49,6 +51,8 @@ type PlaygroundProps = SquiggleChartProps & { onSettingsChange?(settings: any): void; /** Should we show the editor? */ showEditor?: boolean; + /** Useful for playground on squiggle website, where we update the anchor link based on current code and settings */ + showShareButton?: boolean; }; const schema = yup @@ -197,6 +201,29 @@ const RunControls: React.FC<{ ); }; +const ShareButton: React.FC = () => { + const [isCopied, setIsCopied] = useState(false); + const copy = () => { + navigator.clipboard.writeText((window.top || window).location.href); + setIsCopied(true); + setTimeout(() => setIsCopied(false), 1000); + }; + return ( +
+ +
+ ); +}; + type PlaygroundContextShape = { getLeftPanelElement: () => HTMLDivElement | undefined; }; @@ -220,6 +247,7 @@ export const SquigglePlayground: FC = ({ onCodeChange, onSettingsChange, showEditor = true, + showShareButton = false, }) => { const [code, setCode] = useMaybeControlledValue({ value: controlledCode, @@ -370,13 +398,16 @@ export const SquigglePlayground: FC = ({ - +
+ + {showShareButton && } +
{vars.showEditor ? withEditor : withoutEditor}
diff --git a/packages/components/src/components/ui/Button.tsx b/packages/components/src/components/ui/Button.tsx new file mode 100644 index 00000000..008b2084 --- /dev/null +++ b/packages/components/src/components/ui/Button.tsx @@ -0,0 +1,22 @@ +import clsx from "clsx"; +import React from "react"; + +type Props = { + onClick: () => void; + children: React.ReactNode; + wide?: boolean; // stretch the button horizontally +}; + +export const Button: React.FC = ({ onClick, wide, children }) => { + return ( + + ); +}; diff --git a/packages/components/src/stories/SquigglePlayground.stories.mdx b/packages/components/src/stories/SquigglePlayground.stories.mdx index 0c198f42..c9c7c3eb 100644 --- a/packages/components/src/stories/SquigglePlayground.stories.mdx +++ b/packages/components/src/stories/SquigglePlayground.stories.mdx @@ -21,3 +21,16 @@ including sampling settings, in squiggle. {Template.bind({})} + + + + {Template.bind({})} + + diff --git a/packages/website/src/pages/playground.js b/packages/website/src/pages/playground.js index 1f33d54d..4192f31a 100644 --- a/packages/website/src/pages/playground.js +++ b/packages/website/src/pages/playground.js @@ -44,6 +44,7 @@ export default function PlaygroundPage() { const playgroundProps = { defaultCode: "normal(0,1)", height: 700, + showShareButton: true, ...hashData, onCodeChange: (code) => setHashData({ initialSquiggleString: code }), onSettingsChange: (settings) => { From 73d158685895325ee225b9ed7c7b837860a65d57 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 28 Jul 2022 12:59:11 -0400 Subject: [PATCH 128/203] hotfix: version increment --- packages/components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/package.json b/packages/components/package.json index 8e11a913..24d2fa85 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@quri/squiggle-components", - "version": "0.2.23", + "version": "0.2.24", "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^0.7.2", From 3d41d8a8d1860f816e7d9af3c8146e9168588784 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Thu, 28 Jul 2022 23:03:13 +0400 Subject: [PATCH 129/203] delete SquiggleItem --- .../src/components/SquiggleItem.tsx | 287 ------------------ 1 file changed, 287 deletions(-) delete mode 100644 packages/components/src/components/SquiggleItem.tsx diff --git a/packages/components/src/components/SquiggleItem.tsx b/packages/components/src/components/SquiggleItem.tsx deleted file mode 100644 index 52330e8b..00000000 --- a/packages/components/src/components/SquiggleItem.tsx +++ /dev/null @@ -1,287 +0,0 @@ -import * as React from "react"; -import { - squiggleExpression, - environment, - declaration, -} from "@quri/squiggle-lang"; -import { NumberShower } from "./NumberShower"; -import { - DistributionChart, - DistributionPlottingSettings, -} from "./DistributionChart"; -import { FunctionChart, FunctionChartSettings } from "./FunctionChart"; - -function getRange(x: declaration) { - const first = x.args[0]; - switch (first.tag) { - case "Float": { - return { floats: { min: first.value.min, max: first.value.max } }; - } - case "Date": { - return { time: { min: first.value.min, max: first.value.max } }; - } - } -} - -function getChartSettings(x: declaration): FunctionChartSettings { - const range = getRange(x); - const min = range.floats ? range.floats.min : 0; - const max = range.floats ? range.floats.max : 10; - return { - start: min, - stop: max, - count: 20, - }; -} - -interface VariableBoxProps { - heading: string; - children: React.ReactNode; - showTypes: boolean; -} - -export const VariableBox: React.FC = ({ - heading = "Error", - children, - showTypes = false, -}) => { - if (showTypes) { - return ( -
-
-
{heading}
-
-
{children}
-
- ); - } else { - return
{children}
; - } -}; - -export interface SquiggleItemProps { - /** The input string for squiggle */ - expression: squiggleExpression; - width?: number; - height: number; - distributionPlotSettings: DistributionPlottingSettings; - /** Whether to show type information */ - showTypes: boolean; - /** Settings for displaying functions */ - chartSettings: FunctionChartSettings; - /** Environment for further function executions */ - environment: environment; -} - -export const SquiggleItem: React.FC = ({ - expression, - width, - height, - distributionPlotSettings, - showTypes = false, - chartSettings, - environment, -}) => { - switch (expression.tag) { - case "number": - return ( - -
- -
-
- ); - case "distribution": { - const distType = expression.value.type(); - return ( - - {distType === "Symbolic" && showTypes ? ( -
{expression.value.toString()}
- ) : null} - -
- ); - } - case "string": - return ( - - " - - {expression.value} - - " - - ); - case "boolean": - return ( - - {expression.value.toString()} - - ); - case "symbol": - return ( - - Undefined Symbol: - {expression.value} - - ); - case "call": - return ( - - {expression.value} - - ); - case "array": - return ( - - {expression.value.map((r, i) => ( -
-
-
{i}
-
-
- -
-
- ))} -
- ); - case "record": - return ( - -
- {Object.entries(expression.value).map(([key, r]) => ( -
-
-
{key}:
-
-
- -
-
- ))} -
-
- ); - case "arraystring": - return ( - - {expression.value.map((r) => `"${r}"`).join(", ")} - - ); - case "date": - return ( - - {expression.value.toDateString()} - - ); - case "void": - return ( - - {"Void"} - - ); - case "timeDuration": { - return ( - - - - ); - } - case "lambda": - return ( - -
{`function(${expression.value.parameters.join( - "," - )})`}
- -
- ); - case "lambdaDeclaration": { - return ( - - - - ); - } - case "module": { - return ( - -
- {Object.entries(expression.value) - .filter(([key, r]) => key !== "Math") - .map(([key, r]) => ( -
-
-
{key}:
-
-
- -
-
- ))} -
-
- ); - } - default: { - return ( -
- No display for type: {" "} - {expression.tag} -
- ); - } - } -}; From 673331940319978b2bcd3c9648a3a346f885c971 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 28 Jul 2022 21:27:46 +0200 Subject: [PATCH 130/203] 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 131/203] 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 f7834b0f46ba79d75e0dcf6bd11f3c6501fa47e3 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 28 Jul 2022 16:59:52 -0700 Subject: [PATCH 132/203] Lots of minor touch-ups --- packages/website/docs/Discussions/Bugs.mdx | 9 ++- .../docs/Discussions/Future-Features.md | 24 +++----- packages/website/docs/Discussions/Gallery.md | 1 + .../docs/Guides/DistributionCreation.mdx | 60 +++++++++++++++---- packages/website/docs/Guides/Functions.mdx | 2 +- packages/website/docs/Overview.mdx | 19 ++---- 6 files changed, 73 insertions(+), 42 deletions(-) diff --git a/packages/website/docs/Discussions/Bugs.mdx b/packages/website/docs/Discussions/Bugs.mdx index 49bf347b..e70e45b3 100644 --- a/packages/website/docs/Discussions/Bugs.mdx +++ b/packages/website/docs/Discussions/Bugs.mdx @@ -7,7 +7,12 @@ import { SquiggleEditor } from "../../src/components/SquiggleEditor"; Much of the Squiggle math is imprecise. This can cause significant errors, so watch out. -Below are some specific examples to watch for. We'll work on improving these over time and adding much better warnings and error management. +Below are a few specific examples to watch for. We'll work on improving these over time and adding much better warnings and error management. + +## Operations on very small or large numbers, silently round to 0 and 1 + +Squiggle is poor at dealing with very small or large numbers, given fundamental limitations of floating point precision. +See [this Github Issue](https://github.com/quantified-uncertainty/squiggle/issues/834). ## Mixtures of distributions with very different means @@ -33,4 +38,4 @@ The means of sample set distributions can vary dramatically, especially as the n defaultCode={`symbolicDist = 5 to 50333333 sampleSetDist = SampleSet.fromDist(symbolicDist) [mean(symbolicDist), mean(sampleSetDist), symbolicDist, sampleSetDist]`} -/> +/> \ No newline at end of file diff --git a/packages/website/docs/Discussions/Future-Features.md b/packages/website/docs/Discussions/Future-Features.md index a7f24545..3ad0e455 100644 --- a/packages/website/docs/Discussions/Future-Features.md +++ b/packages/website/docs/Discussions/Future-Features.md @@ -9,12 +9,15 @@ Squiggle is still very early. The main first goal is to become stable (to reach - Tables / Matrices - A simple type system -- A simple time library & notation - Optional and default paramaters for functions - A notation to limit the domain of functions. For example, maybe a function only applies for t=[2 to 20] +- Some story for tests +- Much better code editor integration ## Distribution Features +There are many important distribution types that Squiggle doesn't yet support. Some key functions we'd like include: + [Metalog Distribution](https://en.wikipedia.org/wiki/Metalog_distribution) Add the Metalog distribution, and some convenient methods for generating these distributions. This might be a bit tricky because we might need or build a library to fit data. There's no Metalog javascript library yet, this would be pretty useful. There's already a Metalog library in Python, so that one could be used for inspiration. @@ -26,9 +29,6 @@ Takes a distribution and smoothens it. For example, [Elicit Forecast](https://fo **Probabilities** Right now Squiggle mostly works with probability distributions only, but it should also work smoothly with probabilities. -**Importance & quality scores** -Workflows/functionality to declare the importance and coveredness of each part of the paramater space. For example, some subsets of the paramater space of a function might be much more important to get right than others. Similarly, the analyst might be much more certain about some parts than others. Ideally. they could decline sections. - **An interface to interpret & score Squiggle files** Squiggle functions need to be aggregated and scored. This should be done outside one Squiggle file. Maybe this should also be done in Squiggle, or maybe it should be done using Javascript. @@ -38,6 +38,9 @@ Of course, we'd also need good math for how the scoring should work, exactly. This interface should also be able to handle changing Squiggle values. This is because people would be likely to want to update their functions over time, and that should be taken into account for scoring. +**Importance & quality scores** +Workflows/functionality to declare the importance and coveredness of each part of the paramater space. For example, some subsets of the paramater space of a function might be much more important to get right than others. Similarly, the analyst might be much more certain about some parts than others. Ideally. they could decline sections. + **Static / Sensitivity Analysis** Guesstimate has Sensitivity analysis that's pretty useful. This could be quite feasible to add, though it will likely require some thinking. @@ -47,14 +50,5 @@ It might be useful to allow people to annotate functions and variables with long **Randomness Seeds** Right now, Monte Carlo simulations are totally random. It would be nicer to be able to enter a seed somehow in order to control the randomness. Or, with the same seed, the function should always return the same values. This would make debugging and similar easier. -## Major Standard Language Features - -- Some testing story. - -### Distributions - -```js -cauchy(); -pareto(); -metalog(); -``` \ No newline at end of file +**Caching/Memoization** +There are many performance improvements that Squiggle could have. We'll get to some of them eventually. \ No newline at end of file diff --git a/packages/website/docs/Discussions/Gallery.md b/packages/website/docs/Discussions/Gallery.md index d0ea8335..c9498ca0 100644 --- a/packages/website/docs/Discussions/Gallery.md +++ b/packages/website/docs/Discussions/Gallery.md @@ -5,4 +5,5 @@ title: Gallery - [Adjusting probabilities for the passage of time](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3/p/j8o6sgRerE3tqNWdj) by Nuño Sempere - [GiveWell's GiveDirectly cost effectiveness analysis](https://observablehq.com/@hazelfire/givewells-givedirectly-cost-effectiveness-analysis) by Sam Nolan +- [List of QURI Squiggle Models](https://github.com/quantified-uncertainty/squiggle-models) by Nuño Sempere, Sam Nolan, and Ozzie Gooen - [Astronomical Waste](https://observablehq.com/@quinn-dougherty/waste) diff --git a/packages/website/docs/Guides/DistributionCreation.mdx b/packages/website/docs/Guides/DistributionCreation.mdx index eb796f77..9feb1d13 100644 --- a/packages/website/docs/Guides/DistributionCreation.mdx +++ b/packages/website/docs/Guides/DistributionCreation.mdx @@ -35,8 +35,7 @@ If both values are above zero, a `lognormal` distribution is used. If not, a `no - It's very easy to generate distributions with very long tails. If this - happens, you can click the "log x scale" box to view this using a log scale. + It's very easy to generate distributions with very long tails. These can be impossible to see without changing view settings. (These settings are available in the Playground, but not this smaller editor component) @@ -67,10 +66,10 @@ If both values are above zero, a `lognormal` distribution is used. If not, a `no ## Mixture -`mixture(...distributions: Distribution[], weights?: number[])` -`mx(...distributions: Distribution[], weights?: number[])` -`mixture(distributions: Distributions[], weights?: number[])` -`mx(distributions: Distributions[], weights?: number[])` +`mixture(...distributions: Distribution[], weights?: number[])` +`mx(...distributions: Distribution[], weights?: number[])` +`mixture(distributions: Distributions[], weights?: number[])` +`mx(distributions: Distributions[], weights?: number[])` The `mixture` mixes combines multiple distributions to create a mixture. You can optionally pass in a list of proportional weights. @@ -110,6 +109,11 @@ The `mixture` mixes combines multiple distributions to create a mixture. You can

In this case, I have a 20% chance of spending 0 time with it. I might estimate my hours with,

+ +

+ There's a temporary bug where the below render is compressed. If you toggle the code it will fix render correctly. +

+
- - + + @@ -280,10 +284,10 @@ Creates a [beta distribution](https://en.wikipedia.org/wiki/Beta_distribution) w - + @@ -343,7 +347,7 @@ Creates a [triangular distribution](https://en.wikipedia.org/wiki/Triangular_dis -## FromList +## SampleSet.fromList `SampleSet.fromList(samples:number[])` @@ -367,3 +371,37 @@ Creates a sample set distribution using an array of samples. specificity.

+ +## PointSet.makeContinuous + +`PointSet.makeContinuous(points:{x: number, y: number})` + +Creates a continuous point set distribution using a list of points. + + + +### Arguments + +- `points`: An array of at least 3 coordinates. + +## PointSet.makeDiscrete + +`PointSet.makeDiscrete(points:{x: number, y: number})` + +Creates a discrete point set distribution using a list of points. + + + +### Arguments + +- `points`: An array of at least 1 coordinate. \ No newline at end of file diff --git a/packages/website/docs/Guides/Functions.mdx b/packages/website/docs/Guides/Functions.mdx index 4a4bc170..4e57f23e 100644 --- a/packages/website/docs/Guides/Functions.mdx +++ b/packages/website/docs/Guides/Functions.mdx @@ -181,7 +181,7 @@ The `sample(distribution)` samples a given distribution. Recall the [three formats of distributions](https://develop--squiggle-documentation.netlify.app/docs/Discussions/Three-Types-Of-Distributions). We can force any distribution into `SampleSet` format - + Or `PointSet` format diff --git a/packages/website/docs/Overview.mdx b/packages/website/docs/Overview.mdx index 528e1a88..a620c9a8 100644 --- a/packages/website/docs/Overview.mdx +++ b/packages/website/docs/Overview.mdx @@ -64,14 +64,17 @@ You can currently interact with Squiggle in a few ways: **[Playground](/playground)** The [Squiggle Playground](/playground) is a nice tool for working with small models and making prototypes. You can make simple sharable links, but you can't save models that change over time. +**[Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle)** +There's a simple [VS Code extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) for running and visualizing Squiggle code. We find that VS Code is a useful editor for managing larger Squiggle setups. + **[Typescript Library](https://www.npmjs.com/package/@quri/squiggle-lang)** Squiggle is built using [Rescript](https://rescript-lang.org/), and is accessible via a simple Typescript library. You can use this library to either run Squiggle code in full, or to call select specific functions within Squiggle (though this latter functionality is very minimal). **[React Components Library](https://www.npmjs.com/package/@quri/squiggle-components)** All of the components used in the playground and documentation are available in a separate component NPM repo. You can see the full Storybook of components [here](https://squiggle-components.netlify.app). -**[Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle)** -There's a simple [VS Code extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) for running and visualizing Squiggle code. We find that VS Code is a useful editor for managing larger Squiggle setups. +**[Observable](https://observablehq.com/@hazelfire/squiggle)** +You can use Squiggle Components in Observable notebooks. Sam Nolan put together an exportable [Observable Notebook](https://observablehq.com/@hazelfire/squiggle) of the key components that you can directly important and use in your Observable notebooks. ## Squiggle Vs. Other Tools @@ -106,14 +109,4 @@ There's a simple [VS Code extension](https://marketplace.visualstudio.com/items? - Generally not as easy to use as Guesstimate or Causal, especially for non programmers. ## Organization -Squiggle is one of the main projects of [The Quantified Uncertainty Research Institute](https://quantifieduncertainty.org/). QURI is a nonprofit funded primarily by [Effective Altruist](https://www.effectivealtruism.org/) donors. - -## Get started - -- [Gallery](./Discussions/Gallery) -- [Squiggle playground](/playground) -- [Language basics](./Guides/Language) -- [Squiggle functions source of truth](./Guides/Functions) -- [Known bugs](./Discussions/Bugs) -- [Original lesswrong sequence](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3) -- [Author your squiggle models as Observable notebooks](https://observablehq.com/@hazelfire/squiggle) +Squiggle is one of the main projects of [The Quantified Uncertainty Research Institute](https://quantifieduncertainty.org/). QURI is a nonprofit funded primarily by [Effective Altruist](https://www.effectivealtruism.org/) donors. \ No newline at end of file From b37e372815252d952a67593f4dbcee19a55f7709 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 28 Jul 2022 17:00:06 -0700 Subject: [PATCH 133/203] Formatted --- packages/website/docs/Discussions/Bugs.mdx | 4 +- .../docs/Discussions/Future-Features.md | 2 +- .../docs/Guides/DistributionCreation.mdx | 25 +++++----- packages/website/docs/Guides/Language.mdx | 46 ++++++++++++------- packages/website/docs/Overview.mdx | 29 +++++++----- packages/website/src/pages/index.js | 12 ++--- 6 files changed, 71 insertions(+), 47 deletions(-) diff --git a/packages/website/docs/Discussions/Bugs.mdx b/packages/website/docs/Discussions/Bugs.mdx index e70e45b3..154ee2a0 100644 --- a/packages/website/docs/Discussions/Bugs.mdx +++ b/packages/website/docs/Discussions/Bugs.mdx @@ -9,7 +9,7 @@ Much of the Squiggle math is imprecise. This can cause significant errors, so wa Below are a few specific examples to watch for. We'll work on improving these over time and adding much better warnings and error management. -## Operations on very small or large numbers, silently round to 0 and 1 +## Operations on very small or large numbers, silently round to 0 and 1 Squiggle is poor at dealing with very small or large numbers, given fundamental limitations of floating point precision. See [this Github Issue](https://github.com/quantified-uncertainty/squiggle/issues/834). @@ -38,4 +38,4 @@ The means of sample set distributions can vary dramatically, especially as the n defaultCode={`symbolicDist = 5 to 50333333 sampleSetDist = SampleSet.fromDist(symbolicDist) [mean(symbolicDist), mean(sampleSetDist), symbolicDist, sampleSetDist]`} -/> \ No newline at end of file +/> diff --git a/packages/website/docs/Discussions/Future-Features.md b/packages/website/docs/Discussions/Future-Features.md index 3ad0e455..cf6c34d8 100644 --- a/packages/website/docs/Discussions/Future-Features.md +++ b/packages/website/docs/Discussions/Future-Features.md @@ -51,4 +51,4 @@ It might be useful to allow people to annotate functions and variables with long Right now, Monte Carlo simulations are totally random. It would be nicer to be able to enter a seed somehow in order to control the randomness. Or, with the same seed, the function should always return the same values. This would make debugging and similar easier. **Caching/Memoization** -There are many performance improvements that Squiggle could have. We'll get to some of them eventually. \ No newline at end of file +There are many performance improvements that Squiggle could have. We'll get to some of them eventually. diff --git a/packages/website/docs/Guides/DistributionCreation.mdx b/packages/website/docs/Guides/DistributionCreation.mdx index 9feb1d13..b5bfdd11 100644 --- a/packages/website/docs/Guides/DistributionCreation.mdx +++ b/packages/website/docs/Guides/DistributionCreation.mdx @@ -35,7 +35,9 @@ If both values are above zero, a `lognormal` distribution is used. If not, a `no - It's very easy to generate distributions with very long tails. These can be impossible to see without changing view settings. (These settings are available in the Playground, but not this smaller editor component) + It's very easy to generate distributions with very long tails. These can be + impossible to see without changing view settings. (These settings are + available in the Playground, but not this smaller editor component) @@ -69,7 +71,7 @@ If both values are above zero, a `lognormal` distribution is used. If not, a `no `mixture(...distributions: Distribution[], weights?: number[])` `mx(...distributions: Distribution[], weights?: number[])` `mixture(distributions: Distributions[], weights?: number[])` -`mx(distributions: Distributions[], weights?: number[])` +`mx(distributions: Distributions[], weights?: number[])` The `mixture` mixes combines multiple distributions to create a mixture. You can optionally pass in a list of proportional weights. @@ -283,10 +285,7 @@ Creates a [beta distribution](https://en.wikipedia.org/wiki/Beta_distribution) w - + @@ -378,12 +377,14 @@ Creates a sample set distribution using an array of samples. Creates a continuous point set distribution using a list of points. - +])`} +/> ### Arguments @@ -395,13 +396,15 @@ Creates a continuous point set distribution using a list of points. Creates a discrete point set distribution using a list of points. - +])`} +/> ### Arguments -- `points`: An array of at least 1 coordinate. \ No newline at end of file +- `points`: An array of at least 1 coordinate. diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index 71f7e888..311ef6ba 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -12,6 +12,7 @@ Squiggle supports some simple types and language features. ## Distributions + There are several ways of easily entering distributions. See the [documentation](/docs/Api/Dist/) on distributions for a complete API. ## Lists + Squiggle lists can accept items of any type, similar to those in Python. [API](/docs/Api/List). ## Dictionaries + Squiggle dictionaries work similarly to Python dictionaries. [API](/docs/Api/Dictionary). +`} +/> ## Pipes Squiggle features [data-first](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/) pipes. Functions in the standard library are organized to make this convenient. - truncateLeft(3) |> SampleSet.fromDist |> SampleSet.map({|r| r + 10})`} /> + + truncateLeft(3) |> SampleSet.fromDist |> SampleSet.map({|r| r + 10})`} +/> ## Standard Library @@ -70,24 +78,30 @@ Squiggle features a simple [standard libary](/docs/Api/Dist). Most functions are namespaced under their respective types to keep functionality distinct. Certain popular functions are usable without their namespaces. For example, - SampleSet.fromList // namespaces required + + SampleSet.fromList // namespaces required b = normal(5,2) // namespace not required c = 5 to 10 // namespace not required -""`} /> +""`} +/> ## Number Prefixes + Numbers support a few scientific notation prefixes. -| prefix | multiplier | -|-----|-------| -| n | 10^-9 | -| m | 10^-3 | -| k | 10^3 | -| M | 10^6 | -| B,G | 10^9 | -| T | 10^12 | -| P | 10^15 | +| prefix | multiplier | +| ------ | ---------- | +| n | 10^-9 | +| m | 10^-3 | +| k | 10^3 | +| M | 10^6 | +| B,G | 10^9 | +| T | 10^12 | +| P | 10^15 | - +distribution`} +/> diff --git a/packages/website/docs/Overview.mdx b/packages/website/docs/Overview.mdx index a620c9a8..9e314211 100644 --- a/packages/website/docs/Overview.mdx +++ b/packages/website/docs/Overview.mdx @@ -10,10 +10,12 @@ Squiggle is a minimalist programming language for probabilistic estimation. It's The basics of Squiggle are fairly straightforward. This can be enough for many models. The more advanced functionality can take some time to learn. ## Simple example + Say you're trying to estimate the number of piano tuners in New York City. You can build a simple model of this, like so. (Tip: This is interactive! Feel free to modify the code directly.) - +`} +/> ---- +--- Now let's take this a bit further. Let's imagine that you think that NYC will grow over time, and you'd like to estimate the number of piano tuners for every point in time for the next few years. - +}`} +/> If you haven't noticed yet, you can hover over the `populationAtTime` graph to see the distribution of population at different points in time. - - ## Using Squiggle + You can currently interact with Squiggle in a few ways: **[Playground](/playground)** @@ -68,7 +72,7 @@ The [Squiggle Playground](/playground) is a nice tool for working with small mod There's a simple [VS Code extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) for running and visualizing Squiggle code. We find that VS Code is a useful editor for managing larger Squiggle setups. **[Typescript Library](https://www.npmjs.com/package/@quri/squiggle-lang)** -Squiggle is built using [Rescript](https://rescript-lang.org/), and is accessible via a simple Typescript library. You can use this library to either run Squiggle code in full, or to call select specific functions within Squiggle (though this latter functionality is very minimal). +Squiggle is built using [Rescript](https://rescript-lang.org/), and is accessible via a simple Typescript library. You can use this library to either run Squiggle code in full, or to call select specific functions within Squiggle (though this latter functionality is very minimal). **[React Components Library](https://www.npmjs.com/package/@quri/squiggle-components)** All of the components used in the playground and documentation are available in a separate component NPM repo. You can see the full Storybook of components [here](https://squiggle-components.netlify.app). @@ -93,13 +97,15 @@ You can use Squiggle Components in Observable notebooks. Sam Nolan put together - A visually-driven tool. (See [Guesstimate](https://www.getguesstimate.com/) and [Causal](https://causal.app/)) ### Strengths + - Simple and readable syntax, especially for dealing with probabilistic math. - Fast for relatively small models. Strong for rapid prototyping. -- Optimized for using some numeric and symbolic approaches, not just Monte Carlo. +- Optimized for using some numeric and symbolic approaches, not just Monte Carlo. - Embeddable in Javascript. - Free and open-source. -### Weaknesses +### Weaknesses + - Limited scientific capabilities. - Much slower than serious probabilistic programming languages on sizeable models. - Can't do Bayesian backwards inference. @@ -109,4 +115,5 @@ You can use Squiggle Components in Observable notebooks. Sam Nolan put together - Generally not as easy to use as Guesstimate or Causal, especially for non programmers. ## Organization -Squiggle is one of the main projects of [The Quantified Uncertainty Research Institute](https://quantifieduncertainty.org/). QURI is a nonprofit funded primarily by [Effective Altruist](https://www.effectivealtruism.org/) donors. \ No newline at end of file + +Squiggle is one of the main projects of [The Quantified Uncertainty Research Institute](https://quantifieduncertainty.org/). QURI is a nonprofit funded primarily by [Effective Altruist](https://www.effectivealtruism.org/) donors. diff --git a/packages/website/src/pages/index.js b/packages/website/src/pages/index.js index fdfe3b45..b0c26514 100644 --- a/packages/website/src/pages/index.js +++ b/packages/website/src/pages/index.js @@ -10,12 +10,12 @@ function HomepageHeader() { return (
- {'Docusaurus + {"Docusaurus

{siteConfig.title}

Early Access

{siteConfig.tagline}

From 5576bf2ef361c39607776d076fa86f590f314013 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Fri, 29 Jul 2022 02:12:07 +0200 Subject: [PATCH 134/203] fixes #904. E.O.default performance --- .../src/rescript/Distributions/PointSetDist/Continuous.res | 2 +- .../src/rescript/Distributions/PointSetDist/Discrete.res | 3 ++- .../Distributions/PointSetDist/MixedShapeBuilder.res | 6 ++++-- .../ReducerInterface/ReducerInterface_ExternalLibrary.res | 2 +- packages/squiggle-lang/src/rescript/Utility/E.res | 6 ++++++ 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Continuous.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Continuous.res index 05d94ca9..2297a3e3 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Continuous.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Continuous.res @@ -250,7 +250,7 @@ module T = Dist({ let downsample = (length, t): t => t |> shapeMap(XYShape.XsConversion.proportionByProbabilityMass(length, integral(t).xyShape)) - let integralEndY = (t: t) => t.integralSumCache |> E.O.default(t |> integral |> lastY) + let integralEndY = (t: t) => t.integralSumCache |> E.O.defaultFn(() => t |> integral |> lastY) let integralXtoY = (f, t: t) => t |> integral |> shapeFn(XYShape.XtoY.linear(f)) let integralYtoX = (f, t: t) => t |> integral |> shapeFn(XYShape.YtoX.linear(f)) let toContinuous = t => Some(t) diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res index 7e7c4981..b7d5ffd4 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res @@ -158,7 +158,8 @@ module T = Dist({ Continuous.make(~interpolation=#Stepwise, integralShape) } - let integralEndY = (t: t) => t.integralSumCache |> E.O.default(t |> integral |> Continuous.lastY) + let integralEndY = (t: t) => + t.integralSumCache |> E.O.defaultFn(() => t |> integral |> Continuous.lastY) let minX = shapeFn(XYShape.T.minX) let maxX = shapeFn(XYShape.T.maxX) let toDiscreteProbabilityMassFraction = _ => 1.0 diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/MixedShapeBuilder.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/MixedShapeBuilder.res index 89273283..f4407ba8 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/MixedShapeBuilder.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/MixedShapeBuilder.res @@ -13,9 +13,11 @@ let buildSimple = ( ~discrete: option, ): option => { let continuous = - continuous |> E.O.default(Continuous.make(~integralSumCache=Some(0.0), {xs: [], ys: []})) + continuous |> E.O.defaultFn(() => + Continuous.make(~integralSumCache=Some(0.0), {xs: [], ys: []}) + ) let discrete = - discrete |> E.O.default(Discrete.make(~integralSumCache=Some(0.0), {xs: [], ys: []})) + discrete |> E.O.defaultFn(() => Discrete.make(~integralSumCache=Some(0.0), {xs: [], ys: []})) let cLength = continuous |> Continuous.getShape |> XYShape.T.xs |> E.A.length let dLength = discrete |> Discrete.getShape |> XYShape.T.xs |> E.A.length switch (cLength, dLength) { diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res index fc0a2821..7ae6ace9 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalLibrary.res @@ -16,7 +16,7 @@ let dispatch = ( () => ReducerInterface_Duration.dispatch(call, environment), () => ReducerInterface_Number.dispatch(call, environment), () => FunctionRegistry_Library.dispatch(call, environment, reducer), - ])->E.O2.default(chain(call, environment, reducer)) + ])->E.O2.defaultFn(() => chain(call, environment, reducer)) } /* diff --git a/packages/squiggle-lang/src/rescript/Utility/E.res b/packages/squiggle-lang/src/rescript/Utility/E.res index 50a28382..22c8c525 100644 --- a/packages/squiggle-lang/src/rescript/Utility/E.res +++ b/packages/squiggle-lang/src/rescript/Utility/E.res @@ -82,6 +82,11 @@ module O = { | None => d | Some(a) => a } + let defaultFn = (d, o) => + switch o { + | None => d() + | Some(a) => a + } let isSome = o => switch o { | Some(_) => true @@ -158,6 +163,7 @@ module O = { module O2 = { let default = (a, b) => O.default(b, a) + let defaultFn = (a, b) => O.defaultFn(b, a) let toExn = (a, b) => O.toExn(b, a) let fmap = (a, b) => O.fmap(b, a) let toResult = (a, b) => O.toResult(b, a) From a5adcdbeb61cf915307ecf8c5e8a6ecabbc6d860 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 28 Jul 2022 17:32:25 -0700 Subject: [PATCH 135/203] Changed FunctionChart1Number to use regular count of operations, was slow for many functions --- packages/components/src/components/FunctionChart1Number.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/components/src/components/FunctionChart1Number.tsx b/packages/components/src/components/FunctionChart1Number.tsx index 12d00b94..7af17c42 100644 --- a/packages/components/src/components/FunctionChart1Number.tsx +++ b/packages/components/src/components/FunctionChart1Number.tsx @@ -39,13 +39,10 @@ interface FunctionChart1NumberProps { type point = { x: number; value: result }; let getFunctionImage = ({ chartSettings, fn, environment }) => { - //We adjust the count, because the count is made for distributions, which are much more expensive to estimate - let adjustedCount = chartSettings.count * 20; - let chartPointsToRender = _rangeByCount( chartSettings.start, chartSettings.stop, - adjustedCount + chartSettings.count ); let chartPointsData: point[] = chartPointsToRender.map((x) => { From a23b2e37099e1845fbe27aea05592ca28121ab4f Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 28 Jul 2022 18:12:25 -0700 Subject: [PATCH 136/203] Minor text fix --- packages/website/docs/Overview.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/docs/Overview.mdx b/packages/website/docs/Overview.mdx index 9e314211..d00ef749 100644 --- a/packages/website/docs/Overview.mdx +++ b/packages/website/docs/Overview.mdx @@ -66,7 +66,7 @@ If you haven't noticed yet, you can hover over the `populationAtTime` graph to s You can currently interact with Squiggle in a few ways: **[Playground](/playground)** -The [Squiggle Playground](/playground) is a nice tool for working with small models and making prototypes. You can make simple sharable links, but you can't save models that change over time. +The [Squiggle Playground](/playground) is a nice tool for working with small models and making prototypes. You can make simple shareable links, but you can't save models that change over time. **[Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle)** There's a simple [VS Code extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) for running and visualizing Squiggle code. We find that VS Code is a useful editor for managing larger Squiggle setups. @@ -78,7 +78,7 @@ Squiggle is built using [Rescript](https://rescript-lang.org/), and is accessibl All of the components used in the playground and documentation are available in a separate component NPM repo. You can see the full Storybook of components [here](https://squiggle-components.netlify.app). **[Observable](https://observablehq.com/@hazelfire/squiggle)** -You can use Squiggle Components in Observable notebooks. Sam Nolan put together an exportable [Observable Notebook](https://observablehq.com/@hazelfire/squiggle) of the key components that you can directly important and use in your Observable notebooks. +You can use Squiggle Components in Observable notebooks. Sam Nolan put together an exportable [Observable Notebook](https://observablehq.com/@hazelfire/squiggle) of the key components that you can directly import and use in your Observable notebooks. ## Squiggle Vs. Other Tools From c6eb69628d67e77a04893b7c2c15f5e35b10925e Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Fri, 29 Jul 2022 05:53:47 +0200 Subject: [PATCH 137/203] 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 9096ee70511a8ba66ccc8017e472b3cb9d0f1b28 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 29 Jul 2022 08:07:11 -0700 Subject: [PATCH 138/203] More small modifications --- .../{DistSampleSet.md => DistSampleSet.mdx} | 3 ++ packages/website/docs/Api/List.md | 9 ++++- .../docs/Discussions/Future-Features.md | 6 ++-- packages/website/docs/Discussions/Gallery.md | 9 ++--- .../Three-Formats-Of-Distributions.md | 26 +++++++------- packages/website/docs/Guides/Gotchas.mdx | 34 +++++++++++++++++++ packages/website/docs/Integrations.md | 29 ++++++++++++++++ packages/website/docs/Node-Packages.md | 24 ------------- packages/website/sidebars.js | 4 +-- 9 files changed, 97 insertions(+), 47 deletions(-) rename packages/website/docs/Api/{DistSampleSet.md => DistSampleSet.mdx} (92%) create mode 100644 packages/website/docs/Guides/Gotchas.mdx create mode 100644 packages/website/docs/Integrations.md delete mode 100644 packages/website/docs/Node-Packages.md diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.mdx similarity index 92% rename from packages/website/docs/Api/DistSampleSet.md rename to packages/website/docs/Api/DistSampleSet.mdx index eaed6942..168ee397 100644 --- a/packages/website/docs/Api/DistSampleSet.md +++ b/packages/website/docs/Api/DistSampleSet.mdx @@ -3,6 +3,9 @@ sidebar_position: 5 title: Sample Set Distribution --- +import { SquiggleEditor } from "../../src/components/SquiggleEditor"; +import Admonition from "@theme/Admonition"; + Sample set distributions are one of the three distribution formats. Internally, they are stored as a list of numbers. It's useful to distinguish point set distributions from arbitrary lists of numbers to make it clear which functions are applicable. Monte Carlo calculations typically result in sample set distributions. diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md index 1a8ef7a8..26c7c555 100644 --- a/packages/website/docs/Api/List.md +++ b/packages/website/docs/Api/List.md @@ -73,6 +73,13 @@ map: (list<'a>, a => b) => list<'b> See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#map). +### filter + +``` +filter: (list<'a>, 'a => bool) => list<'a> +``` +See [Rescript implementation of keep](https://rescript-lang.org/docs/manual/latest/api/belt/array#keep), which is functionally equivalent. + ### reduce ``` @@ -97,4 +104,4 @@ reduceReverse: (list<'b>, 'a, ('a, 'b) => 'a) => 'a Works like `reduce`, but the function is applied to each item from the last back to the first. -See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reducereverse). +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reducereverse). \ No newline at end of file diff --git a/packages/website/docs/Discussions/Future-Features.md b/packages/website/docs/Discussions/Future-Features.md index cf6c34d8..0c333641 100644 --- a/packages/website/docs/Discussions/Future-Features.md +++ b/packages/website/docs/Discussions/Future-Features.md @@ -41,14 +41,14 @@ This interface should also be able to handle changing Squiggle values. This is b **Importance & quality scores** Workflows/functionality to declare the importance and coveredness of each part of the paramater space. For example, some subsets of the paramater space of a function might be much more important to get right than others. Similarly, the analyst might be much more certain about some parts than others. Ideally. they could decline sections. -**Static / Sensitivity Analysis** +**Static / sensitivity analysis** Guesstimate has Sensitivity analysis that's pretty useful. This could be quite feasible to add, though it will likely require some thinking. **Annotation** It might be useful to allow people to annotate functions and variables with longer descriptions, maybe Markdown. This could very much help interpretation/analysis of these items. -**Randomness Seeds** +**Randomness seeds** Right now, Monte Carlo simulations are totally random. It would be nicer to be able to enter a seed somehow in order to control the randomness. Or, with the same seed, the function should always return the same values. This would make debugging and similar easier. -**Caching/Memoization** +**Caching/memoization** There are many performance improvements that Squiggle could have. We'll get to some of them eventually. diff --git a/packages/website/docs/Discussions/Gallery.md b/packages/website/docs/Discussions/Gallery.md index c9498ca0..ad06b550 100644 --- a/packages/website/docs/Discussions/Gallery.md +++ b/packages/website/docs/Discussions/Gallery.md @@ -3,7 +3,8 @@ sidebar_position: 2 title: Gallery --- -- [Adjusting probabilities for the passage of time](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3/p/j8o6sgRerE3tqNWdj) by Nuño Sempere -- [GiveWell's GiveDirectly cost effectiveness analysis](https://observablehq.com/@hazelfire/givewells-givedirectly-cost-effectiveness-analysis) by Sam Nolan -- [List of QURI Squiggle Models](https://github.com/quantified-uncertainty/squiggle-models) by Nuño Sempere, Sam Nolan, and Ozzie Gooen -- [Astronomical Waste](https://observablehq.com/@quinn-dougherty/waste) +* [GiveWell's GiveDirectly cost effectiveness analysis](https://observablehq.com/@hazelfire/givewells-givedirectly-cost-effectiveness-analysis) by Sam Nolan +* [A Critical Review of Open Philanthropy’s Bet On Criminal Justice Reform](https://forum.effectivealtruism.org/posts/h2N9qEbvQ6RHABcae/a-critical-review-of-open-philanthropy-s-bet-on-criminal) by Nuño Sempere +* [Samotsvety Nuclear Risk Forecasts — March 2022](https://forum.effectivealtruism.org/posts/KRFXjCqqfGQAYirm5/samotsvety-nuclear-risk-forecasts-march-2022) by Nuño Sempere, Misha Yagudin, Eli Lifland +* [Adjusting probabilities for the passage of time](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3/p/j8o6sgRerE3tqNWdj) by Nuño Sempere +* [List of QURI Squiggle Models](https://github.com/quantified-uncertainty/squiggle-models) by Nuño Sempere, Sam Nolan, and Ozzie Gooen \ No newline at end of file diff --git a/packages/website/docs/Discussions/Three-Formats-Of-Distributions.md b/packages/website/docs/Discussions/Three-Formats-Of-Distributions.md index e844f6c6..13379146 100644 --- a/packages/website/docs/Discussions/Three-Formats-Of-Distributions.md +++ b/packages/website/docs/Discussions/Three-Formats-Of-Distributions.md @@ -5,17 +5,17 @@ author: Ozzie Gooen date: 02-19-2022 --- -Probability distributions have several subtle possible formats. Three important ones that we deal with in Squiggle are symbolic, sample set, and graph formats. +Probability distributions have several subtle possible formats. Three important ones that we deal with in Squiggle are symbolic, sample set, and point set formats. _Symbolic_ formats are just the math equations. `normal(5,3)` is the symbolic representation of a normal distribution. When you sample distributions (usually starting with symbolic formats), you get lists of samples. Monte Carlo techniques return lists of samples. Let’s call this the “_Sample Set_” format. -Lastly is what I’ll refer to as the _Graph_ format. It describes the coordinates, or the shape, of the distribution. You can save these formats in JSON, for instance, like, `{xs: [1, 2, 3, 4, …], ys: [.0001, .0003, .002, …]}`. +Lastly is what I’ll refer to as the _Point Set_ format. It describes the coordinates, or the shape, of the distribution. You can save these formats in JSON, for instance, like, `{xs: [1, 2, 3, 4, …], ys: [.0001, .0003, .002, …]}`. -Symbolic, Sample Set, and Graph formats all have very different advantages and disadvantages. +Symbolic, Sample Set, and Point Set formats all have very different advantages and disadvantages. -Note that the name "Symbolic" is fairly standard, but I haven't found common names for what I'm referring to as "Sample Set" and "Graph" formats. The formats aren't often specifically referred to for these purposes, from what I can tell. +Note that the name "Symbolic" is fairly standard, but I haven't found common names for what I'm referring to as "Sample Set" and "Point Set" formats. The formats aren't often specifically referred to for these purposes, from what I can tell. ## Symbolic Formats @@ -40,7 +40,7 @@ To perform calculations of symbolic systems, you need to find analytical solutio - It’s often either impossible or computationally infeasible to find analytical solutions to most symbolic equations. - Solving symbolic equations requires very specialized tooling that’s very rare. There are a few small symbolic solver libraries out there, but not many. Wolfram Research is the main group that seems very strong here, and their work is mostly closed source + expensive. -**Converting to Graph Formats** +**Converting to Point Set Formats** - Very easy. Choose X points such that you capture most of the distribution (you can set a threshold, like 99.9%). For each X point, calculate the pdf, and save as the Y points. @@ -49,23 +49,23 @@ To perform calculations of symbolic systems, you need to find analytical solutio - Very easy. Just sample a bunch of times. The regular way is to randomly sample (This is trivial to do for all distributions with inverse-cdf functions.) If you want to get more fancy, you could provide extra samples from the tails, that would be weighted lower. Or, you could take samples in equal distances (of probability mass) along the entire distribution, then optionally shuffle it. (In the latter case, these would not be random samples, but sometimes that’s fine.) **How to Visualize** -Convert to graph, then display that. (Optionally, you can also convert to samples, then display those using a histogram, but this is often worse you have both options.) +Convert to point set, then display that. (Optionally, you can also convert to samples, then display those using a histogram, but this is often worse you have both options.) **Bonus: The Metalog Distribution** The Metalog distribution seems like it can represent almost any reasonable distribution. It’s symbolic. This is great for storage, but it’s not clear if it helps with calculation. My impression is that we don’t have symbolic ways of doing most functions (addition, multiplication, etc) on metalog distributions. Also, note that it can take a fair bit of computation to fit a shape to the Metalog distribution. -## Graph Formats +## Point Set Formats **TL;DR** -Lists of the x-y coordinates of the shape of a distribution. (Usually the pdf, which is more compressed than the cdf). Some key functions (like pdf, cdf) and manipulations can work on almost any graphically-described distribution. +Lists of the x-y coordinates of the shape of a distribution. (Usually the pdf, which is more compressed than the cdf). Some key functions (like pdf, cdf) and manipulations can work on almost any point set distribution. **Alternative Names:** Grid, Mesh, Graph, Vector, Pdf, PdfCoords/PdfPoints, Discretised, Bezier, Curve See [this facebook thread](https://www.facebook.com/ozzie.gooen/posts/10165936265785363?notif_id=1644937423623638¬if_t=feedback_reaction_generic&ref=notif). **How to Do Computation** -Use graph techniques. These can be fairly computationally-intensive (particularly finding integrals, which take a whole lot of adding). In the case that you want to multiply independent distributions, you can try convolution, but it’s pretty expensive. +Use point set techniques. These can be fairly computationally-intensive (particularly finding integrals, which take a whole lot of adding). In the case that you want to multiply independent distributions, you can try convolution, but it’s pretty expensive. **Examples** `{xs: [1, 2, 3, 4…], ys: [.0001, .0003, .002, .04, ...]} ` @@ -74,18 +74,18 @@ Use graph techniques. These can be fairly computationally-intensive (particularl **Advantages** - Much more compressed than Sample List formats, but much less compressed than Symbolic formats. -- Many functions (pdf, cdf, percentiles, mean, integration, etc) and manipulations (truncation, scaling horizontally or vertically), are possible on essentially all graph distributions. +- Many functions (pdf, cdf, percentiles, mean, integration, etc) and manipulations (truncation, scaling horizontally or vertically), are possible on essentially all point set distributions. **Disadvantages** -- Most calculations are infeasible/impossible to perform graphically. In these cases, you need to use sampling. +- Most calculations are infeasible/impossible to perform using point sets formats. In these cases, you need to use sampling. - Not as accurate or fast as symbolic methods, where the symbolic methods are applicable. -- The tails get cut off, which is subideal. It’s assumed that the value of the pdf outside of the bounded range is exactly 0, which is not correct. (Note: If you have ideas on how to store graph formats that don’t cut off tails, let me know) +- The tails get cut off, which is subideal. It’s assumed that the value of the pdf outside of the bounded range is exactly 0, which is not correct. (Note: If you have ideas on how to store point set formats that don’t cut off tails, let me know) **Converting to Symbolic Formats** - Okay, if you are okay with a Metalog approximation or similar. Metaculus uses an additive combination of up to [Logistic distributions](https://www.metaculus.com/help/faq/); you could also fit this. Fitting takes a little time (it requires several attempts and some optimization), can be arbitrarily accurate. -- If you want to be very fancy, you could try to fit graph distributions into normal / lognormal / etc. but this seems like a lot of work for little gain. +- If you want to be very fancy, you could try to fit point set distributions into normal / lognormal / etc. but this seems like a lot of work for little gain. **Converting to Sample List Formats** diff --git a/packages/website/docs/Guides/Gotchas.mdx b/packages/website/docs/Guides/Gotchas.mdx new file mode 100644 index 00000000..f4034aaa --- /dev/null +++ b/packages/website/docs/Guides/Gotchas.mdx @@ -0,0 +1,34 @@ +--- +title: Gotchas +sidebar_position: 8 +--- + +import { SquiggleEditor } from "../../src/components/SquiggleEditor"; +import Admonition from "@theme/Admonition"; + +## Point Set Distributions Conversions +Point Set conversions are done with [kernel density estimation](https://en.wikipedia.org/wiki/Kernel_density_estimation), which is lossy. This might be particularly noticeable in cases where distributions should be entirely above zero. + +In this example, we see that the median of this (highly skewed) distribution is positive when it's in a Sample Set format, but negative when it's converted to a Point Set format. + + + +--- +This can be particularly confusing for visualizations. Visualizations automatically convert distributions into Point Set formats. Therefore, they might often show negative values, even if the underlying distribution is fully positive. + +We plan to later support more configuration of kernel density estimation, and for visualiations of Sample Set distributions to instead use histograms. + +## Sample Set Correlations +Correlations with Sample Set distributions are a bit complicated. Monte Carlo generations with Squiggle are ordered. The first sample in one Sample Set distribution will correspond to the first sample in a distribution that comes from a resulting Monte Carlo generation. Therefore, Sample Set distributions in a chain of Monte Carlo generations are likely to all be correlated with each other. This connection breaks if any node changes to the Point Set or Symbolic format. + +In this example, we subtract all three types of distributions by themselves. Notice that the Sample Set distribution returns 1. The other two return the result of subtracting one normal distribution from a separate uncorrelated distribution. These results are clearly very different to each other. + + SampleSet.fromDist +sampleSetDistToPointSet = sampleSetDist |> PointSet.fromDist +symbolicDist = normal(5,2) +[sampleSetDist-sampleSetDist, sampleSetDistToPointSet-sampleSetDistToPointSet, symbolicDist-symbolicDist]`} /> \ No newline at end of file diff --git a/packages/website/docs/Integrations.md b/packages/website/docs/Integrations.md new file mode 100644 index 00000000..2ec5b148 --- /dev/null +++ b/packages/website/docs/Integrations.md @@ -0,0 +1,29 @@ +--- +sidebar_position: 4 +title: "Integrations" +--- + +## Node Packages +There are two JavaScript packages currently available for Squiggle: + +- [`@quri/squiggle-lang`](https://www.npmjs.com/package/@quri/squiggle-lang) +- [`@quri/squiggle-components`](https://www.npmjs.com/package/@quri/squiggle-components) + +Types are available for both packages. + +## [Squiggle Language](https://www.npmjs.com/package/@quri/squiggle-lang) ![npm version](https://badge.fury.io/js/@quri%2Fsquiggle-lang.svg) +[_See `README.md` in Github_](https://github.com/quantified-uncertainty/squiggle/tree/develop/packages/squiggle-lang#use-the-npm-package) + +## [Squiggle Components](https://www.npmjs.com/package/@quri/squiggle-components) ![npm version](https://badge.fury.io/js/@quri%2Fsquiggle-components.svg) +[_See `README.md` in Github_](https://github.com/quantified-uncertainty/squiggle/tree/develop/packages/components#usage-in-a-react-project) + +This documentation uses `@quri/squiggle-components` frequently. + +We host [a storybook](https://squiggle-components.netlify.app/) with details +and usage of each of the components made available. + +## [Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) ![npm version](https://vsmarketplacebadge.apphb.com/version/QURI.vscode-squiggle.svg) +This extention allows you to run and visualize Squiggle code. + +## [Observable Library](https://observablehq.com/@hazelfire/squiggle) +An exportable [Observable Notebook](https://observablehq.com/@hazelfire/squiggle) of the key components that you can directly import and use in Observable notebooks. \ No newline at end of file diff --git a/packages/website/docs/Node-Packages.md b/packages/website/docs/Node-Packages.md deleted file mode 100644 index b405627a..00000000 --- a/packages/website/docs/Node-Packages.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_position: 4 -title: Node Packages ---- - -There are two JavaScript packages currently available for Squiggle: - -- [`@quri/squiggle-lang`](https://www.npmjs.com/package/@quri/squiggle-lang) ![npm version](https://badge.fury.io/js/@quri%2Fsquiggle-lang.svg) -- [`@quri/squiggle-components`](https://www.npmjs.com/package/@quri/squiggle-components) ![npm version](https://badge.fury.io/js/@quri%2Fsquiggle-components.svg) - -Types are available for both packages. - -## Squiggle Language - -[_See `README.md` in Github_](https://github.com/quantified-uncertainty/squiggle/tree/develop/packages/squiggle-lang#use-the-npm-package) - -## Squiggle Components - -[_See `README.md` in Github_](https://github.com/quantified-uncertainty/squiggle/tree/develop/packages/components#usage-in-a-react-project) - -This documentation uses `@quri/squiggle-components` frequently. - -We host [a storybook](https://squiggle-components.netlify.app/) with details -and usage of each of the components made available. diff --git a/packages/website/sidebars.js b/packages/website/sidebars.js index 5c33d56c..85c644a4 100644 --- a/packages/website/sidebars.js +++ b/packages/website/sidebars.js @@ -28,8 +28,8 @@ const sidebars = { }, { type: "doc", - id: "Node-Packages", - label: "Node Packages", + id: "Integrations", + label: "Integrations", }, { type: "category", From 209ecafb22b18e5e2a1d7fbdd35397f2bc47ed04 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 29 Jul 2022 10:25:27 -0700 Subject: [PATCH 139/203] Updating to version 0.3.0 --- .../src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res b/packages/squiggle-lang/src/rescript/SquiggleLibrary/SquiggleLibrary_Versions.res index 55d1e5b7..91e9959c 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.2.12")), + ("System.version", ReducerInterface_InternalExpressionValue.IEvString("0.3.0")), ]->Bindings.fromArray let makeBindings = (previousBindings: Bindings.t): Bindings.t => From fa1ec55e754f4dfbed1de732ddd0740723d8d0f6 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 29 Jul 2022 10:25:38 -0700 Subject: [PATCH 140/203] Minor fix --- packages/website/docs/Api/DistSampleSet.mdx | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/website/docs/Api/DistSampleSet.mdx b/packages/website/docs/Api/DistSampleSet.mdx index 168ee397..eaed6942 100644 --- a/packages/website/docs/Api/DistSampleSet.mdx +++ b/packages/website/docs/Api/DistSampleSet.mdx @@ -3,9 +3,6 @@ sidebar_position: 5 title: Sample Set Distribution --- -import { SquiggleEditor } from "../../src/components/SquiggleEditor"; -import Admonition from "@theme/Admonition"; - Sample set distributions are one of the three distribution formats. Internally, they are stored as a list of numbers. It's useful to distinguish point set distributions from arbitrary lists of numbers to make it clear which functions are applicable. Monte Carlo calculations typically result in sample set distributions. From c4bc4a2832989e80ebae90c372a0bab529732e55 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 29 Jul 2022 10:26:14 -0700 Subject: [PATCH 141/203] Formatting --- packages/website/docs/Api/List.md | 3 ++- packages/website/docs/Discussions/Gallery.md | 10 +++++----- packages/website/docs/Guides/Gotchas.mdx | 15 +++++++++++---- packages/website/docs/Integrations.md | 15 ++++++++++----- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md index 26c7c555..137cdf5e 100644 --- a/packages/website/docs/Api/List.md +++ b/packages/website/docs/Api/List.md @@ -78,6 +78,7 @@ See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/b ``` filter: (list<'a>, 'a => bool) => list<'a> ``` + See [Rescript implementation of keep](https://rescript-lang.org/docs/manual/latest/api/belt/array#keep), which is functionally equivalent. ### reduce @@ -104,4 +105,4 @@ reduceReverse: (list<'b>, 'a, ('a, 'b) => 'a) => 'a Works like `reduce`, but the function is applied to each item from the last back to the first. -See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reducereverse). \ No newline at end of file +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reducereverse). diff --git a/packages/website/docs/Discussions/Gallery.md b/packages/website/docs/Discussions/Gallery.md index ad06b550..be7f143b 100644 --- a/packages/website/docs/Discussions/Gallery.md +++ b/packages/website/docs/Discussions/Gallery.md @@ -3,8 +3,8 @@ sidebar_position: 2 title: Gallery --- -* [GiveWell's GiveDirectly cost effectiveness analysis](https://observablehq.com/@hazelfire/givewells-givedirectly-cost-effectiveness-analysis) by Sam Nolan -* [A Critical Review of Open Philanthropy’s Bet On Criminal Justice Reform](https://forum.effectivealtruism.org/posts/h2N9qEbvQ6RHABcae/a-critical-review-of-open-philanthropy-s-bet-on-criminal) by Nuño Sempere -* [Samotsvety Nuclear Risk Forecasts — March 2022](https://forum.effectivealtruism.org/posts/KRFXjCqqfGQAYirm5/samotsvety-nuclear-risk-forecasts-march-2022) by Nuño Sempere, Misha Yagudin, Eli Lifland -* [Adjusting probabilities for the passage of time](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3/p/j8o6sgRerE3tqNWdj) by Nuño Sempere -* [List of QURI Squiggle Models](https://github.com/quantified-uncertainty/squiggle-models) by Nuño Sempere, Sam Nolan, and Ozzie Gooen \ No newline at end of file +- [GiveWell's GiveDirectly cost effectiveness analysis](https://observablehq.com/@hazelfire/givewells-givedirectly-cost-effectiveness-analysis) by Sam Nolan +- [A Critical Review of Open Philanthropy’s Bet On Criminal Justice Reform](https://forum.effectivealtruism.org/posts/h2N9qEbvQ6RHABcae/a-critical-review-of-open-philanthropy-s-bet-on-criminal) by Nuño Sempere +- [Samotsvety Nuclear Risk Forecasts — March 2022](https://forum.effectivealtruism.org/posts/KRFXjCqqfGQAYirm5/samotsvety-nuclear-risk-forecasts-march-2022) by Nuño Sempere, Misha Yagudin, Eli Lifland +- [Adjusting probabilities for the passage of time](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3/p/j8o6sgRerE3tqNWdj) by Nuño Sempere +- [List of QURI Squiggle Models](https://github.com/quantified-uncertainty/squiggle-models) by Nuño Sempere, Sam Nolan, and Ozzie Gooen diff --git a/packages/website/docs/Guides/Gotchas.mdx b/packages/website/docs/Guides/Gotchas.mdx index f4034aaa..2c7f5b0f 100644 --- a/packages/website/docs/Guides/Gotchas.mdx +++ b/packages/website/docs/Guides/Gotchas.mdx @@ -7,28 +7,35 @@ import { SquiggleEditor } from "../../src/components/SquiggleEditor"; import Admonition from "@theme/Admonition"; ## Point Set Distributions Conversions + Point Set conversions are done with [kernel density estimation](https://en.wikipedia.org/wiki/Kernel_density_estimation), which is lossy. This might be particularly noticeable in cases where distributions should be entirely above zero. In this example, we see that the median of this (highly skewed) distribution is positive when it's in a Sample Set format, but negative when it's converted to a Point Set format. - +}`} +/> --- + This can be particularly confusing for visualizations. Visualizations automatically convert distributions into Point Set formats. Therefore, they might often show negative values, even if the underlying distribution is fully positive. We plan to later support more configuration of kernel density estimation, and for visualiations of Sample Set distributions to instead use histograms. ## Sample Set Correlations + Correlations with Sample Set distributions are a bit complicated. Monte Carlo generations with Squiggle are ordered. The first sample in one Sample Set distribution will correspond to the first sample in a distribution that comes from a resulting Monte Carlo generation. Therefore, Sample Set distributions in a chain of Monte Carlo generations are likely to all be correlated with each other. This connection breaks if any node changes to the Point Set or Symbolic format. In this example, we subtract all three types of distributions by themselves. Notice that the Sample Set distribution returns 1. The other two return the result of subtracting one normal distribution from a separate uncorrelated distribution. These results are clearly very different to each other. - SampleSet.fromDist + SampleSet.fromDist sampleSetDistToPointSet = sampleSetDist |> PointSet.fromDist symbolicDist = normal(5,2) -[sampleSetDist-sampleSetDist, sampleSetDistToPointSet-sampleSetDistToPointSet, symbolicDist-symbolicDist]`} /> \ No newline at end of file +[sampleSetDist-sampleSetDist, sampleSetDistToPointSet-sampleSetDistToPointSet, symbolicDist-symbolicDist]`} +/> diff --git a/packages/website/docs/Integrations.md b/packages/website/docs/Integrations.md index 2ec5b148..c2aa16e7 100644 --- a/packages/website/docs/Integrations.md +++ b/packages/website/docs/Integrations.md @@ -4,6 +4,7 @@ title: "Integrations" --- ## Node Packages + There are two JavaScript packages currently available for Squiggle: - [`@quri/squiggle-lang`](https://www.npmjs.com/package/@quri/squiggle-lang) @@ -11,10 +12,12 @@ There are two JavaScript packages currently available for Squiggle: Types are available for both packages. -## [Squiggle Language](https://www.npmjs.com/package/@quri/squiggle-lang) ![npm version](https://badge.fury.io/js/@quri%2Fsquiggle-lang.svg) +## [Squiggle Language](https://www.npmjs.com/package/@quri/squiggle-lang) ![npm version](https://badge.fury.io/js/@quri%2Fsquiggle-lang.svg) + [_See `README.md` in Github_](https://github.com/quantified-uncertainty/squiggle/tree/develop/packages/squiggle-lang#use-the-npm-package) -## [Squiggle Components](https://www.npmjs.com/package/@quri/squiggle-components) ![npm version](https://badge.fury.io/js/@quri%2Fsquiggle-components.svg) +## [Squiggle Components](https://www.npmjs.com/package/@quri/squiggle-components) ![npm version](https://badge.fury.io/js/@quri%2Fsquiggle-components.svg) + [_See `README.md` in Github_](https://github.com/quantified-uncertainty/squiggle/tree/develop/packages/components#usage-in-a-react-project) This documentation uses `@quri/squiggle-components` frequently. @@ -22,8 +25,10 @@ This documentation uses `@quri/squiggle-components` frequently. We host [a storybook](https://squiggle-components.netlify.app/) with details and usage of each of the components made available. -## [Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) ![npm version](https://vsmarketplacebadge.apphb.com/version/QURI.vscode-squiggle.svg) -This extention allows you to run and visualize Squiggle code. +## [Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) ![npm version](https://vsmarketplacebadge.apphb.com/version/QURI.vscode-squiggle.svg) + +This extention allows you to run and visualize Squiggle code. ## [Observable Library](https://observablehq.com/@hazelfire/squiggle) -An exportable [Observable Notebook](https://observablehq.com/@hazelfire/squiggle) of the key components that you can directly import and use in Observable notebooks. \ No newline at end of file + +An exportable [Observable Notebook](https://observablehq.com/@hazelfire/squiggle) of the key components that you can directly import and use in Observable notebooks. From 1642aa5fce910e46473cc3403fbe02df8f73c552 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Thu, 28 Jul 2022 00:03:41 +0400 Subject: [PATCH 142/203] bump vscode ext version --- 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 dd4f56c3..35511f70 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -3,7 +3,7 @@ "displayName": "Squiggle", "description": "Squiggle language support", "license": "MIT", - "version": "0.2.0", + "version": "0.3.0", "publisher": "QURI", "repository": { "type": "git", @@ -11,7 +11,7 @@ }, "icon": "media/vendor/icon.png", "engines": { - "vscode": "^1.68.0" + "vscode": "^1.69.0" }, "categories": [ "Programming Languages", From 9188dc19f0c50c416b1eca9b7fa68e28598e9eb5 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 29 Jul 2022 23:12:13 +0400 Subject: [PATCH 143/203] update ext icon --- packages/vscode-ext/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 35511f70..cce74215 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -117,7 +117,7 @@ "vscode:prepublish": "yarn run compile", "compile:tsc": "tsc -b", "compile:grammar": "js-yaml syntaxes/squiggle.tmLanguage.yaml >syntaxes/squiggle.tmLanguage.json", - "compile:vendor": "(cd ../squiggle-lang && yarn run build) && (cd ../components && yarn run bundle && yarn run build:css) && mkdir -p media/vendor && cp ../components/dist/bundle.js media/vendor/components.js && cp ../components/dist/main.css media/vendor/components.css && cp ../../node_modules/react/umd/react.production.min.js media/vendor/react.js && cp ../../node_modules/react-dom/umd/react-dom.production.min.js media/vendor/react-dom.js && cp ../website/static/img/quri-logo.png media/vendor/icon.png", + "compile:vendor": "(cd ../squiggle-lang && yarn run build) && (cd ../components && yarn run bundle && yarn run build:css) && mkdir -p media/vendor && cp ../components/dist/bundle.js media/vendor/components.js && cp ../components/dist/main.css media/vendor/components.css && cp ../../node_modules/react/umd/react.production.min.js media/vendor/react.js && cp ../../node_modules/react-dom/umd/react-dom.production.min.js media/vendor/react-dom.js && cp ../website/static/img/squiggle-logo.png media/vendor/icon.png", "compile": "yarn run compile:vendor && yarn run compile:grammar && yarn run compile:tsc", "watch": "tsc -b -watch", "pretest": "yarn run compile && yarn run lint", From 482ceb76dc0f77c5e5003e963ed1525cec57305e Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 29 Jul 2022 23:19:55 +0400 Subject: [PATCH 144/203] check expression type in viewer to mitigate the void bug --- .../SquiggleViewer/ExpressionViewer.tsx | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx b/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx index 1417fb28..9a3e266e 100644 --- a/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx +++ b/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx @@ -59,6 +59,13 @@ export const ExpressionViewer: React.FC = ({ expression, width, }) => { + if (typeof expression !== "object") { + return ( + + {() => `Unknown expression: ${expression}`} + + ); + } switch (expression.tag) { case "number": return ( @@ -281,10 +288,16 @@ export const ExpressionViewer: React.FC = ({ ); default: { return ( -
- No display for type: {" "} - {expression.tag} -
+ + {() => ( +
+ No display for type: {" "} + + {expression.tag} + +
+ )} +
); } } From 52bee6a0e36527b53394bd281247431f162095d1 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 29 Jul 2022 23:35:11 +0400 Subject: [PATCH 145/203] fix EvVoid ts conversion --- packages/squiggle-lang/src/js/rescript_interop.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/squiggle-lang/src/js/rescript_interop.ts b/packages/squiggle-lang/src/js/rescript_interop.ts index 80548a7f..3dca8165 100644 --- a/packages/squiggle-lang/src/js/rescript_interop.ts +++ b/packages/squiggle-lang/src/js/rescript_interop.ts @@ -18,6 +18,7 @@ import { tagged, tag } from "./types"; // Raw rescript types. export type rescriptExport = + | 0 // EvVoid | { TAG: 0; // EvArray _0: rescriptExport[]; @@ -140,6 +141,10 @@ export function convertRawToTypescript( result: rescriptExport, environment: environment ): squiggleExpression { + if (typeof result === "number") { + // EvVoid + return tag("void", ""); + } switch (result.TAG) { case 0: // EvArray return tag( From 17c3fe9dd8e77cd056d308fa4f3d1a9e0afcb09d Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Sat, 30 Jul 2022 16:58:45 +0200 Subject: [PATCH 146/203] hiddenNameSpace --- ...ducerInterface_ExternalExpressionValue.res | 5 ++- ...ducerInterface_InternalExpressionValue.res | 37 +++++++++++++------ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res index a4d6e713..bf698735 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res @@ -7,6 +7,9 @@ module ErrorValue = Reducer_ErrorValue @genType.opaque type internalCode = Object +@genType.opaque +type hiddenNameSpace = Object + @genType type rec externalExpressionValue = | EvArray(array) @@ -30,7 +33,7 @@ and record = Js.Dict.t and externalBindings = record and lambdaValue = { parameters: array, - context: externalBindings, + context: hiddenNameSpace, body: internalCode, } and lambdaDeclaration = Declaration.declaration diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res index 3805d790..86718b64 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_InternalExpressionValue.res @@ -37,6 +37,29 @@ type internalExpressionValue = t type functionCall = (string, array) +module Internal = { + module NameSpace = { + external castNameSpaceToHidden: nameSpace => ExternalExpressionValue.hiddenNameSpace = + "%identity" + external castHiddenToNameSpace: ExternalExpressionValue.hiddenNameSpace => nameSpace = + "%identity" + } + module Lambda = { + let toInternal = (v: ExternalExpressionValue.lambdaValue): lambdaValue => { + let p = v.parameters + let c = v.context->NameSpace.castHiddenToNameSpace + let b = v.body + {parameters: p, context: c, body: b} + } + and toExternal = (v: lambdaValue): ExternalExpressionValue.lambdaValue => { + let p = v.parameters + let c = v.context->NameSpace.castNameSpaceToHidden + let b = v.body + {parameters: p, context: c, body: b} + } + } +} + let rec toString = aValue => switch aValue { | IEvArray(anArray) => { @@ -244,12 +267,7 @@ let rec toExternal = (iev: t): ExternalExpressionValue.t => { } and mapToExternal = v => v->Belt.Map.String.map(e => toExternal(e))->Belt.Map.String.toArray->Js.Dict.fromArray -and lambdaValueToExternal = v => { - let p = v.parameters - let c = v.context->nameSpaceToTypeScriptBindings - let b = v.body - {parameters: p, context: c, body: b} -} +and lambdaValueToExternal = Internal.Lambda.toExternal and nameSpaceToTypeScriptBindings = ( nameSpace: nameSpace, ): ReducerInterface_ExternalExpressionValue.externalBindings => { @@ -284,12 +302,7 @@ let rec toInternal = (ev: ExternalExpressionValue.t): t => { } and recordToInternal = v => v->Js.Dict.entries->Belt.Map.String.fromArray->Belt.Map.String.map(e => toInternal(e)) -and lambdaValueToInternal = v => { - let p = v.parameters - let c = v.context->nameSpaceFromTypeScriptBindings - let b = v.body - {parameters: p, context: c, body: b} -} +and lambdaValueToInternal = Internal.Lambda.toInternal and nameSpaceFromTypeScriptBindings = ( r: ReducerInterface_ExternalExpressionValue.externalBindings, ): nameSpace => From 4c21aa902e43e515c07c881285f9a1fbf3ae0d85 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Sat, 30 Jul 2022 22:14:16 +0200 Subject: [PATCH 147/203] the last property of a record can have a following comma --- .../squiggle-lang/__tests__/Reducer/Reducer_test.res | 9 +++++++++ .../Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_test.res index 39f387a1..dc403e7d 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_test.res @@ -27,6 +27,15 @@ describe("eval", () => { test("index", () => expectEvalToBe("r = {a: 1}; r.a", "Ok(1)")) test("index", () => expectEvalToBe("r = {a: 1}; r.b", "Error(Record property not found: b)")) testEvalError("{a: 1}.b") // invalid syntax + test("always the same property ending", () => + expectEvalToBe( + `{ + a: 1, + b: 2, + }`, + "Ok({a: 1,b: 2})", + ) + ) }) describe("multi-line", () => { 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 dfd3eb45..15837da4 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 @@ -277,9 +277,13 @@ arrayConstructor 'array' { return [head, ...tail]; } recordConstructor 'record' - = '{' _nl args:array_recordArguments _nl '}' + = '{' _nl args:array_recordArguments _nl end_of_record { return h.constructRecord(args); } + end_of_record + = '}' + / ',' _nl '}' + array_recordArguments = head:keyValuePair tail:(_ ',' _nl @keyValuePair)* { return [head, ...tail]; } From 5d744fe2d06c293ea864ba636db1a880c09f9ad5 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sun, 31 Jul 2022 00:20:51 +0400 Subject: [PATCH 148/203] fix genType --- .../ReducerInterface_ExternalExpressionValue.res | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res index bf698735..d613ceb8 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_ExternalExpressionValue.res @@ -30,7 +30,6 @@ type rec externalExpressionValue = | EvType(record) | EvVoid and record = Js.Dict.t -and externalBindings = record and lambdaValue = { parameters: array, context: hiddenNameSpace, @@ -38,6 +37,9 @@ and lambdaValue = { } and lambdaDeclaration = Declaration.declaration +@genType +type externalBindings = record + @genType type t = externalExpressionValue From a313dd61eb135208a82ecf0cf747929f81617ed6 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Sun, 31 Jul 2022 00:53:59 +0400 Subject: [PATCH 149/203] vscode ext 0.3.1 --- packages/vscode-ext/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index cce74215..abc928e9 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -3,7 +3,7 @@ "displayName": "Squiggle", "description": "Squiggle language support", "license": "MIT", - "version": "0.3.0", + "version": "0.3.1", "publisher": "QURI", "repository": { "type": "git", From c569dee224588c45e5e5c1efc03f25d51d1b6852 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:28:47 +0000 Subject: [PATCH 150/203] :arrow_up: Bump @floating-ui/react-dom from 0.7.2 to 1.0.0 Bumps [@floating-ui/react-dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/react-dom) from 0.7.2 to 1.0.0. - [Release notes](https://github.com/floating-ui/floating-ui/releases) - [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/react-dom@1.0.0/packages/react-dom) --- updated-dependencies: - dependency-name: "@floating-ui/react-dom" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/components/package.json b/packages/components/package.json index 24d2fa85..4ab4c7db 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -3,7 +3,7 @@ "version": "0.2.24", "license": "MIT", "dependencies": { - "@floating-ui/react-dom": "^0.7.2", + "@floating-ui/react-dom": "^1.0.0", "@floating-ui/react-dom-interactions": "^0.6.6", "@headlessui/react": "^1.6.6", "@heroicons/react": "^1.0.6", diff --git a/yarn.lock b/yarn.lock index a6b3e864..e7753a6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2195,6 +2195,11 @@ 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" @@ -2202,6 +2207,13 @@ 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" + integrity sha512-PMqJvY5Fae8HVQgUqM+lidprS6p9LSvB0AUhCdYKqr3YCaV+WaWCeVNBtXPRY2YIdrgcsL2+vd5F07FxgihHUw== + 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" @@ -2219,6 +2231,13 @@ "@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" + integrity sha512-uiOalFKPG937UCLm42RxjESTWUVpbbatvlphQAU6bsv+ence6IoVG8JOUZcy8eW81NkU+Idiwvx10WFLmR4MIg== + dependencies: + "@floating-ui/dom" "^1.0.0" + "@gar/promisify@^1.0.1": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" From 636d8c1b53b0a6e520e996b32f1e526b7fabc7ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:29:37 +0000 Subject: [PATCH 151/203] :arrow_up: Bump tailwindcss from 3.1.6 to 3.1.7 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.1.6 to 3.1.7. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.1.6...v3.1.7) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 24d2fa85..bd5a06b3 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -51,7 +51,7 @@ "react": "^18.1.0", "react-scripts": "^5.0.1", "style-loader": "^3.3.1", - "tailwindcss": "^3.1.6", + "tailwindcss": "^3.1.7", "ts-loader": "^9.3.0", "tsconfig-paths-webpack-plugin": "^3.5.2", "typescript": "^4.7.4", diff --git a/yarn.lock b/yarn.lock index a6b3e864..63005116 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12148,10 +12148,10 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lilconfig@^2.0.3, lilconfig@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.5.tgz#19e57fd06ccc3848fd1891655b5a447092225b25" - integrity sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg== +lilconfig@^2.0.3, lilconfig@^2.0.5, lilconfig@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.6.tgz#32a384558bd58af3d4c6e077dd1ad1d397bc69d4" + integrity sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg== lines-and-columns@^1.1.6: version "1.2.4" @@ -17011,10 +17011,10 @@ synchronous-promise@^2.0.15: resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.15.tgz#07ca1822b9de0001f5ff73595f3d08c4f720eb8e" integrity sha512-k8uzYIkIVwmT+TcglpdN50pS2y1BDcUnBPK9iJeGu0Pl1lOI8pD6wtzgw91Pjpe+RxtTncw32tLxs/R0yNL2Mg== -tailwindcss@^3.0.2, tailwindcss@^3.1.6: - version "3.1.6" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.1.6.tgz#bcb719357776c39e6376a8d84e9834b2b19a49f1" - integrity sha512-7skAOY56erZAFQssT1xkpk+kWt2NrO45kORlxFPXUt3CiGsVPhH1smuH5XoDH6sGPXLyBv+zgCKA2HWBsgCytg== +tailwindcss@^3.0.2, tailwindcss@^3.1.7: + version "3.1.7" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.1.7.tgz#ce99425f30a74e01457a2e6a724463b0df3159ac" + integrity sha512-r7mgumZ3k0InfVPpGWcX8X/Ut4xBfv+1O/+C73ar/m01LxGVzWvPxF/w6xIUPEztrCoz7axfx0SMdh8FH8ZvRQ== dependencies: arg "^5.0.2" chokidar "^3.5.3" @@ -17025,7 +17025,7 @@ tailwindcss@^3.0.2, tailwindcss@^3.1.6: fast-glob "^3.2.11" glob-parent "^6.0.2" is-glob "^4.0.3" - lilconfig "^2.0.5" + lilconfig "^2.0.6" normalize-path "^3.0.0" object-hash "^3.0.0" picocolors "^1.0.0" From 1462422e35e4c4a66595750aedb202b50dee5dd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:30:27 +0000 Subject: [PATCH 152/203] :arrow_up: Bump tsconfig-paths-webpack-plugin from 3.5.2 to 4.0.0 Bumps [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin) from 3.5.2 to 4.0.0. - [Release notes](https://github.com/dividab/tsconfig-paths-webpack-plugin/releases) - [Changelog](https://github.com/dividab/tsconfig-paths-webpack-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/v3.5.2...v4.0.0) --- updated-dependencies: - dependency-name: tsconfig-paths-webpack-plugin dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 24d2fa85..f8add78c 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -53,7 +53,7 @@ "style-loader": "^3.3.1", "tailwindcss": "^3.1.6", "ts-loader": "^9.3.0", - "tsconfig-paths-webpack-plugin": "^3.5.2", + "tsconfig-paths-webpack-plugin": "^4.0.0", "typescript": "^4.7.4", "web-vitals": "^2.1.4", "webpack": "^5.74.0", diff --git a/yarn.lock b/yarn.lock index a6b3e864..06506a2e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17435,16 +17435,16 @@ ts-pnp@^1.1.6: resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92" integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw== -tsconfig-paths-webpack-plugin@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-3.5.2.tgz#01aafff59130c04a8c4ebc96a3045c43c376449a" - integrity sha512-EhnfjHbzm5IYI9YPNVIxx1moxMI4bpHD2e0zTXeDNQcwjjRaGepP7IhTHJkyDBG0CAOoxRfe7jCG630Ou+C6Pw== +tsconfig-paths-webpack-plugin@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.0.0.tgz#84008fc3e3e0658fdb0262758b07b4da6265ff1a" + integrity sha512-fw/7265mIWukrSHd0i+wSwx64kYUSAKPfxRDksjKIYTxSAp9W9/xcZVBF4Kl0eqQd5eBpAQ/oQrc5RyM/0c1GQ== dependencies: chalk "^4.1.0" enhanced-resolve "^5.7.0" - tsconfig-paths "^3.9.0" + tsconfig-paths "^4.0.0" -tsconfig-paths@^3.14.1, tsconfig-paths@^3.9.0: +tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== @@ -17454,6 +17454,15 @@ tsconfig-paths@^3.14.1, tsconfig-paths@^3.9.0: minimist "^1.2.6" strip-bom "^3.0.0" +tsconfig-paths@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.0.0.tgz#1082f5d99fd127b72397eef4809e4dd06d229b64" + integrity sha512-SLBg2GBKlR6bVtMgJJlud/o3waplKtL7skmLkExomIiaAtLGtVsoXIqP3SYdjbcH9lq/KVv7pMZeCBpLYOit6Q== + dependencies: + json5 "^2.2.1" + minimist "^1.2.6" + strip-bom "^3.0.0" + tslib@^1.0.0, tslib@^1.8.1: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" From 2783da37b75b472d1326fcc5919a3baa2ec1181b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:31:04 +0000 Subject: [PATCH 153/203] :arrow_up: Bump eslint from 8.20.0 to 8.21.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.20.0 to 8.21.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.20.0...v8.21.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 | 49 ++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index abc928e9..b0e3ca2d 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -131,7 +131,7 @@ "@types/vscode": "^1.69.0", "@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/parser": "^5.30.7", - "eslint": "^8.20.0", + "eslint": "^8.21.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", "typescript": "^4.7.4", diff --git a/yarn.lock b/yarn.lock index a6b3e864..4cef0427 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2259,15 +2259,20 @@ resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.6.tgz#db4277a96d1817d94169108167014926d8a10398" integrity sha512-f4VxF8w9rdX0WsDCk3FW1dGPj/Sj8+1Ulcgtm5ymgWEpbA/fjY+NUDh+L9hftmxDgP8+EJFtF+qFK4gPEXVrVQ== -"@humanwhocodes/config-array@^0.9.2": - version "0.9.5" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" - integrity sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw== +"@humanwhocodes/config-array@^0.10.4": + version "0.10.4" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.4.tgz#01e7366e57d2ad104feea63e72248f22015c520c" + integrity sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" minimatch "^3.0.4" +"@humanwhocodes/gitignore-to-minimatch@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d" + integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA== + "@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" @@ -5502,6 +5507,11 @@ acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== +acorn@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== + address@^1.0.1, address@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/address/-/address-1.2.0.tgz#d352a62c92fee90f89a693eccd2a8b2139ab02d9" @@ -8970,13 +8980,14 @@ eslint-webpack-plugin@^3.1.1: normalize-path "^3.0.0" schema-utils "^3.1.1" -eslint@^8.20.0, eslint@^8.3.0: - version "8.20.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.20.0.tgz#048ac56aa18529967da8354a478be4ec0a2bc81b" - integrity sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA== +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== dependencies: "@eslint/eslintrc" "^1.3.0" - "@humanwhocodes/config-array" "^0.9.2" + "@humanwhocodes/config-array" "^0.10.4" + "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -8986,14 +8997,17 @@ eslint@^8.20.0, eslint@^8.3.0: eslint-scope "^7.1.1" eslint-utils "^3.0.0" eslint-visitor-keys "^3.3.0" - espree "^9.3.2" + espree "^9.3.3" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" + find-up "^5.0.0" functional-red-black-tree "^1.0.1" glob-parent "^6.0.1" globals "^13.15.0" + globby "^11.1.0" + grapheme-splitter "^1.0.4" ignore "^5.2.0" import-fresh "^3.0.0" imurmurhash "^0.1.4" @@ -9011,12 +9025,12 @@ eslint@^8.20.0, eslint@^8.3.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^9.3.2: - version "9.3.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.2.tgz#f58f77bd334731182801ced3380a8cc859091596" - integrity sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA== +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== dependencies: - acorn "^8.7.1" + acorn "^8.8.0" acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" @@ -10033,6 +10047,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + gray-matter@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798" From f638baedd3b1c74e112b7d3be63f1a1ea5167908 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:31:49 +0000 Subject: [PATCH 154/203] :arrow_up: Bump @hookform/resolvers from 2.9.6 to 2.9.7 Bumps [@hookform/resolvers](https://github.com/react-hook-form/resolvers) from 2.9.6 to 2.9.7. - [Release notes](https://github.com/react-hook-form/resolvers/releases) - [Commits](https://github.com/react-hook-form/resolvers/compare/v2.9.6...v2.9.7) --- updated-dependencies: - dependency-name: "@hookform/resolvers" 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 24d2fa85..cae010d2 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -7,7 +7,7 @@ "@floating-ui/react-dom-interactions": "^0.6.6", "@headlessui/react": "^1.6.6", "@heroicons/react": "^1.0.6", - "@hookform/resolvers": "^2.9.6", + "@hookform/resolvers": "^2.9.7", "@quri/squiggle-lang": "^0.2.8", "@react-hook/size": "^2.1.2", "clsx": "^1.2.1", diff --git a/yarn.lock b/yarn.lock index a6b3e864..c32dd709 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2254,10 +2254,10 @@ resolved "https://registry.yarnpkg.com/@heroicons/react/-/react-1.0.6.tgz#35dd26987228b39ef2316db3b1245c42eb19e324" integrity sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ== -"@hookform/resolvers@^2.9.6": - version "2.9.6" - resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.6.tgz#db4277a96d1817d94169108167014926d8a10398" - integrity sha512-f4VxF8w9rdX0WsDCk3FW1dGPj/Sj8+1Ulcgtm5ymgWEpbA/fjY+NUDh+L9hftmxDgP8+EJFtF+qFK4gPEXVrVQ== +"@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== "@humanwhocodes/config-array@^0.9.2": version "0.9.5" From 871fc8c3c9965ff62f08d8ded47e3b3dc01e391a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:47:04 +0000 Subject: [PATCH 155/203] :arrow_up: Bump @types/node from 18.6.1 to 18.6.3 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.6.1 to 18.6.3. - [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 | 4 ++-- yarn.lock | 27 +++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 24d2fa85..907886e3 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -3,7 +3,7 @@ "version": "0.2.24", "license": "MIT", "dependencies": { - "@floating-ui/react-dom": "^0.7.2", + "@floating-ui/react-dom": "^1.0.0", "@floating-ui/react-dom-interactions": "^0.6.6", "@headlessui/react": "^1.6.6", "@heroicons/react": "^1.0.6", @@ -39,7 +39,7 @@ "@testing-library/user-event": "^14.3.0", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.182", - "@types/node": "^18.6.1", + "@types/node": "^18.6.3", "@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 a6b3e864..ffbcf20b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2195,6 +2195,11 @@ 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" @@ -2202,6 +2207,13 @@ 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" + integrity sha512-PMqJvY5Fae8HVQgUqM+lidprS6p9LSvB0AUhCdYKqr3YCaV+WaWCeVNBtXPRY2YIdrgcsL2+vd5F07FxgihHUw== + 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" @@ -2219,6 +2231,13 @@ "@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" + integrity sha512-uiOalFKPG937UCLm42RxjESTWUVpbbatvlphQAU6bsv+ence6IoVG8JOUZcy8eW81NkU+Idiwvx10WFLmR4MIg== + dependencies: + "@floating-ui/dom" "^1.0.0" + "@gar/promisify@^1.0.1": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" @@ -4715,10 +4734,10 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@18.x", "@types/node@^18.6.1": - version "18.6.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.1.tgz#828e4785ccca13f44e2fb6852ae0ef11e3e20ba5" - integrity sha512-z+2vB6yDt1fNwKOeGbckpmirO+VBDuQqecXkgeIqDlaOtmKn6hPR/viQ8cxCfqLU4fTlvM3+YjM367TukWdxpg== +"@types/node@*", "@types/node@18.x", "@types/node@^18.6.3": + version "18.6.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.3.tgz#4e4a95b6fe44014563ceb514b2598b3e623d1c98" + integrity sha512-6qKpDtoaYLM+5+AFChLhHermMQxc3TOEFIDzrZLPRGHPrLEwqFkkT5Kx3ju05g6X7uDPazz3jHbKPX0KzCjntg== "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0": version "16.11.41" From eff4756762b6a8fcd13064e5bb7bb3ba91740c82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:49:03 +0000 Subject: [PATCH 156/203] :arrow_up: Bump @docusaurus/preset-classic from 2.0.0-rc.1 to 2.0.1 Bumps [@docusaurus/preset-classic](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus-preset-classic) from 2.0.0-rc.1 to 2.0.1. - [Release notes](https://github.com/facebook/docusaurus/releases) - [Changelog](https://github.com/facebook/docusaurus/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/docusaurus/commits/v2.0.1/packages/docusaurus-preset-classic) --- updated-dependencies: - dependency-name: "@docusaurus/preset-classic" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/website/package.json | 2 +- yarn.lock | 432 ++++++++++++++++++++++++---------- 2 files changed, 305 insertions(+), 129 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index 11e83791..35d60a13 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@docusaurus/core": "2.0.0-rc.1", - "@docusaurus/preset-classic": "2.0.0-rc.1", + "@docusaurus/preset-classic": "2.0.1", "@heroicons/react": "^1.0.6", "@quri/squiggle-components": "^0.2.23", "base64-js": "^1.5.1", diff --git a/yarn.lock b/yarn.lock index a6b3e864..550b6b8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1843,6 +1843,83 @@ webpack-merge "^5.8.0" webpackbar "^5.0.2" +"@docusaurus/core@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/core/-/core-2.0.1.tgz#a2b0d653e8f18eacddda4778a46b638dd1f0f45c" + integrity sha512-Prd46TtZdiixlTl8a+h9bI5HegkfREjSNkrX2rVEwJZeziSz4ya+l7QDnbnCB2XbxEG8cveFo/F9q5lixolDtQ== + dependencies: + "@babel/core" "^7.18.6" + "@babel/generator" "^7.18.7" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-transform-runtime" "^7.18.6" + "@babel/preset-env" "^7.18.6" + "@babel/preset-react" "^7.18.6" + "@babel/preset-typescript" "^7.18.6" + "@babel/runtime" "^7.18.6" + "@babel/runtime-corejs3" "^7.18.6" + "@babel/traverse" "^7.18.8" + "@docusaurus/cssnano-preset" "2.0.1" + "@docusaurus/logger" "2.0.1" + "@docusaurus/mdx-loader" "2.0.1" + "@docusaurus/react-loadable" "5.5.2" + "@docusaurus/utils" "2.0.1" + "@docusaurus/utils-common" "2.0.1" + "@docusaurus/utils-validation" "2.0.1" + "@slorber/static-site-generator-webpack-plugin" "^4.0.7" + "@svgr/webpack" "^6.2.1" + autoprefixer "^10.4.7" + babel-loader "^8.2.5" + babel-plugin-dynamic-import-node "^2.3.3" + boxen "^6.2.1" + chalk "^4.1.2" + chokidar "^3.5.3" + clean-css "^5.3.0" + cli-table3 "^0.6.2" + combine-promises "^1.1.0" + commander "^5.1.0" + copy-webpack-plugin "^11.0.0" + core-js "^3.23.3" + css-loader "^6.7.1" + css-minimizer-webpack-plugin "^4.0.0" + cssnano "^5.1.12" + del "^6.1.1" + detect-port "^1.3.0" + escape-html "^1.0.3" + eta "^1.12.3" + file-loader "^6.2.0" + fs-extra "^10.1.0" + html-minifier-terser "^6.1.0" + html-tags "^3.2.0" + html-webpack-plugin "^5.5.0" + import-fresh "^3.3.0" + leven "^3.1.0" + lodash "^4.17.21" + mini-css-extract-plugin "^2.6.1" + postcss "^8.4.14" + postcss-loader "^7.0.0" + prompts "^2.4.2" + react-dev-utils "^12.0.1" + react-helmet-async "^1.3.0" + react-loadable "npm:@docusaurus/react-loadable@5.5.2" + react-loadable-ssr-addon-v5-slorber "^1.0.1" + react-router "^5.3.3" + react-router-config "^5.1.1" + react-router-dom "^5.3.3" + rtl-detect "^1.0.4" + semver "^7.3.7" + serve-handler "^6.1.3" + shelljs "^0.8.5" + terser-webpack-plugin "^5.3.3" + tslib "^2.4.0" + update-notifier "^5.1.0" + url-loader "^4.1.1" + wait-on "^6.0.1" + webpack "^5.73.0" + webpack-bundle-analyzer "^4.5.0" + webpack-dev-server "^4.9.3" + webpack-merge "^5.8.0" + webpackbar "^5.0.2" + "@docusaurus/cssnano-preset@2.0.0-rc.1": version "2.0.0-rc.1" resolved "https://registry.yarnpkg.com/@docusaurus/cssnano-preset/-/cssnano-preset-2.0.0-rc.1.tgz#76bbd7f6912779a0667f8f2fd8fc1a05618a6148" @@ -1853,6 +1930,16 @@ postcss-sort-media-queries "^4.2.1" tslib "^2.4.0" +"@docusaurus/cssnano-preset@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/cssnano-preset/-/cssnano-preset-2.0.1.tgz#4d0c49338cf3aa88c5bd7cffbf77654db8e1e3b2" + integrity sha512-MCJ6rRmlqLmlCsZIoIxOxDb0rYzIPEm9PYpsBW+CGNnbk+x8xK+11hnrxzvXHqDRNpxrq3Kq2jYUmg/DkqE6vg== + dependencies: + cssnano-preset-advanced "^5.3.8" + postcss "^8.4.14" + postcss-sort-media-queries "^4.2.1" + tslib "^2.4.0" + "@docusaurus/logger@2.0.0-rc.1": version "2.0.0-rc.1" resolved "https://registry.yarnpkg.com/@docusaurus/logger/-/logger-2.0.0-rc.1.tgz#db95e9b15bc243695830a5b791c0eff705ef1b54" @@ -1861,6 +1948,14 @@ chalk "^4.1.2" tslib "^2.4.0" +"@docusaurus/logger@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/logger/-/logger-2.0.1.tgz#78a940a333d2f654fd9dea24db2c962034d4b1ff" + integrity sha512-wIWseCKko1w/WARcDjO3N/XoJ0q/VE42AthP0eNAfEazDjJ94NXbaI6wuUsuY/bMg6hTKGVIpphjj2LoX3g6dA== + dependencies: + chalk "^4.1.2" + tslib "^2.4.0" + "@docusaurus/mdx-loader@2.0.0-rc.1": version "2.0.0-rc.1" resolved "https://registry.yarnpkg.com/@docusaurus/mdx-loader/-/mdx-loader-2.0.0-rc.1.tgz#e78d7d416aacc289f2427c5ccdb9145820acb0cb" @@ -1884,13 +1979,36 @@ url-loader "^4.1.1" webpack "^5.73.0" -"@docusaurus/module-type-aliases@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/module-type-aliases/-/module-type-aliases-2.0.0-rc.1.tgz#c7839ac15b7712a8d86353a3253918f63ffbea09" - integrity sha512-la7D8ggFP8I5nOp/Epl6NqTeDWcbofPVMOaVisRxQbx5iuF9Al+AITbaDgm4CXpFLJACsqhsXD5W4BnKX8ZxfA== +"@docusaurus/mdx-loader@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/mdx-loader/-/mdx-loader-2.0.1.tgz#cc73690ca5d356687d9e75740560b4159cd5cdb5" + integrity sha512-tdNeljdilXCmhbaEND3SAgsqaw/oh7v9onT5yrIrL26OSk2AFwd+MIi4R8jt8vq33M0R4rz2wpknm0fQIkDdvQ== + dependencies: + "@babel/parser" "^7.18.8" + "@babel/traverse" "^7.18.8" + "@docusaurus/logger" "2.0.1" + "@docusaurus/utils" "2.0.1" + "@mdx-js/mdx" "^1.6.22" + escape-html "^1.0.3" + file-loader "^6.2.0" + fs-extra "^10.1.0" + image-size "^1.0.1" + mdast-util-to-string "^2.0.0" + remark-emoji "^2.2.0" + stringify-object "^3.3.0" + tslib "^2.4.0" + unified "^9.2.2" + unist-util-visit "^2.0.3" + url-loader "^4.1.1" + webpack "^5.73.0" + +"@docusaurus/module-type-aliases@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/module-type-aliases/-/module-type-aliases-2.0.1.tgz#44d7132297bedae0890695b0e7ebbe14a73e26d1" + integrity sha512-f888ylnxHAM/3T8p1lx08+lTc6/g7AweSRfRuZvrVhHXj3Tz/nTTxaP6gPTGkJK7WLqTagpar/IGP6/74IBbkg== dependencies: "@docusaurus/react-loadable" "5.5.2" - "@docusaurus/types" "2.0.0-rc.1" + "@docusaurus/types" "2.0.1" "@types/history" "^4.7.11" "@types/react" "*" "@types/react-router-config" "*" @@ -1898,18 +2016,18 @@ react-helmet-async "*" react-loadable "npm:@docusaurus/react-loadable@5.5.2" -"@docusaurus/plugin-content-blog@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.0.0-rc.1.tgz#8ae5d5ec2da08c583a057bf2754a5b9278b3eb08" - integrity sha512-BVVrAGZujpjS/0rarY2o24rlylRRh2NZuM65kg0JNkkViF79SeEHsepog7IuHyoqGWPm1N/I7LpEp7k+gowZzQ== +"@docusaurus/plugin-content-blog@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.0.1.tgz#a37065e18ffd26e022ffb16a21ff28199140729e" + integrity sha512-/4ua3iFYcpwgpeYgHnhVGROB/ybnauLH2+rICb4vz/+Gn1hjAmGXVYq1fk8g49zGs3uxx5nc0H5bL9P0g977IQ== dependencies: - "@docusaurus/core" "2.0.0-rc.1" - "@docusaurus/logger" "2.0.0-rc.1" - "@docusaurus/mdx-loader" "2.0.0-rc.1" - "@docusaurus/types" "2.0.0-rc.1" - "@docusaurus/utils" "2.0.0-rc.1" - "@docusaurus/utils-common" "2.0.0-rc.1" - "@docusaurus/utils-validation" "2.0.0-rc.1" + "@docusaurus/core" "2.0.1" + "@docusaurus/logger" "2.0.1" + "@docusaurus/mdx-loader" "2.0.1" + "@docusaurus/types" "2.0.1" + "@docusaurus/utils" "2.0.1" + "@docusaurus/utils-common" "2.0.1" + "@docusaurus/utils-validation" "2.0.1" cheerio "^1.0.0-rc.12" feed "^4.2.2" fs-extra "^10.1.0" @@ -1920,18 +2038,18 @@ utility-types "^3.10.0" webpack "^5.73.0" -"@docusaurus/plugin-content-docs@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.0.0-rc.1.tgz#2dda88166bf21b0eeb3821ef748059b20c8c49f7" - integrity sha512-Yk5Hu6uaw3tRplzJnbDygwRhmZ3PCzEXD4SJpBA6cPC73ylfqOEh6qhiU+BWhMTtDXNhY+athk5Kycfk3DW1aQ== +"@docusaurus/plugin-content-docs@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.0.1.tgz#4059591b4bff617e744e856ca680674b27c0b98a" + integrity sha512-2qeBWRy1EjgnXdwAO6/csDIS1UVNmhmtk/bQ2s9jqjpwM8YVgZ8QVdkxFAMWXgZWDQdwWwdP1rnmoEelE4HknQ== dependencies: - "@docusaurus/core" "2.0.0-rc.1" - "@docusaurus/logger" "2.0.0-rc.1" - "@docusaurus/mdx-loader" "2.0.0-rc.1" - "@docusaurus/module-type-aliases" "2.0.0-rc.1" - "@docusaurus/types" "2.0.0-rc.1" - "@docusaurus/utils" "2.0.0-rc.1" - "@docusaurus/utils-validation" "2.0.0-rc.1" + "@docusaurus/core" "2.0.1" + "@docusaurus/logger" "2.0.1" + "@docusaurus/mdx-loader" "2.0.1" + "@docusaurus/module-type-aliases" "2.0.1" + "@docusaurus/types" "2.0.1" + "@docusaurus/utils" "2.0.1" + "@docusaurus/utils-validation" "2.0.1" "@types/react-router-config" "^5.0.6" combine-promises "^1.1.0" fs-extra "^10.1.0" @@ -1942,84 +2060,84 @@ utility-types "^3.10.0" webpack "^5.73.0" -"@docusaurus/plugin-content-pages@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-pages/-/plugin-content-pages-2.0.0-rc.1.tgz#2be82f53d6c77e6aa66787726c30dc60b210e6f8" - integrity sha512-FdO79WC5hfWDQu3/CTFLRQzTNc0e5n+HNzavm2MNkSzGV08BFJ6RAkbPbtra5CWef+6iXZav6D/tzv2jDPvLzA== +"@docusaurus/plugin-content-pages@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-pages/-/plugin-content-pages-2.0.1.tgz#013f2e66f80d19b5c95a2d941d67c7cdb67b7191" + integrity sha512-6apSVeJENnNecAH5cm5VnRqR103M6qSI6IuiP7tVfD5H4AWrfDNkvJQV2+R2PIq3bGrwmX4fcXl1x4g0oo7iwA== dependencies: - "@docusaurus/core" "2.0.0-rc.1" - "@docusaurus/mdx-loader" "2.0.0-rc.1" - "@docusaurus/types" "2.0.0-rc.1" - "@docusaurus/utils" "2.0.0-rc.1" - "@docusaurus/utils-validation" "2.0.0-rc.1" + "@docusaurus/core" "2.0.1" + "@docusaurus/mdx-loader" "2.0.1" + "@docusaurus/types" "2.0.1" + "@docusaurus/utils" "2.0.1" + "@docusaurus/utils-validation" "2.0.1" fs-extra "^10.1.0" tslib "^2.4.0" webpack "^5.73.0" -"@docusaurus/plugin-debug@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-debug/-/plugin-debug-2.0.0-rc.1.tgz#73c06ad08d66810941e456d50b07be008f5235cb" - integrity sha512-aOsyYrPMbnsyqHwsVZ+0frrMRtnYqm4eaJpG4sC/6LYAJ07IDRQ9j3GOku2dKr5GsFK1Vx7VlE6ZLwe0MaGstg== +"@docusaurus/plugin-debug@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-debug/-/plugin-debug-2.0.1.tgz#2b2a473f8e01fd356e32236f753665b48209bcd4" + integrity sha512-jpZBT5HK7SWx1LRQyv9d14i44vSsKXGZsSPA2ndth5HykHJsiAj9Fwl1AtzmtGYuBmI+iXQyOd4MAMHd4ZZ1tg== dependencies: - "@docusaurus/core" "2.0.0-rc.1" - "@docusaurus/types" "2.0.0-rc.1" - "@docusaurus/utils" "2.0.0-rc.1" + "@docusaurus/core" "2.0.1" + "@docusaurus/types" "2.0.1" + "@docusaurus/utils" "2.0.1" fs-extra "^10.1.0" react-json-view "^1.21.3" tslib "^2.4.0" -"@docusaurus/plugin-google-analytics@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-2.0.0-rc.1.tgz#0136cc7534573ca56e023178ec2bda5c1e89ce71" - integrity sha512-f+G8z5OJWfg5QqWDLIdcN2SDoK5J5Gg8HMrqCI6Pfl+rxPb5I1niA+/UkAM+kMCpnekvhSt5AWz2fgkRenkPLA== +"@docusaurus/plugin-google-analytics@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-2.0.1.tgz#e3b84237aad2e94dcd1cf1810c1c9bc3d94f186d" + integrity sha512-d5qb+ZeQcg1Czoxc+RacETjLdp2sN/TAd7PGN/GrvtijCdgNmvVAtZ9QgajBTG0YbJFVPTeZ39ad2bpoOexX0w== dependencies: - "@docusaurus/core" "2.0.0-rc.1" - "@docusaurus/types" "2.0.0-rc.1" - "@docusaurus/utils-validation" "2.0.0-rc.1" + "@docusaurus/core" "2.0.1" + "@docusaurus/types" "2.0.1" + "@docusaurus/utils-validation" "2.0.1" tslib "^2.4.0" -"@docusaurus/plugin-google-gtag@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.0.0-rc.1.tgz#61698fdc41a4ace912fb8f6c834efd288edad3c0" - integrity sha512-yE1Et9hhhX9qMRnMJzpNq0854qIYiSEc2dZaXNk537HN7Q0rKkr/YONUHz2iqNYwPX2hGOY4LdpTxlMP88uVhA== +"@docusaurus/plugin-google-gtag@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.0.1.tgz#4cbcf9d520f7ec8124679fbe00867f2299a2f6bb" + integrity sha512-qiRufJe2FvIyzICbkjm4VbVCI1hyEju/CebfDKkKh2ZtV4q6DM1WZG7D6VoQSXL8MrMFB895gipOM4BwdM8VsQ== dependencies: - "@docusaurus/core" "2.0.0-rc.1" - "@docusaurus/types" "2.0.0-rc.1" - "@docusaurus/utils-validation" "2.0.0-rc.1" + "@docusaurus/core" "2.0.1" + "@docusaurus/types" "2.0.1" + "@docusaurus/utils-validation" "2.0.1" tslib "^2.4.0" -"@docusaurus/plugin-sitemap@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.0.0-rc.1.tgz#0b638e774b253d90e9f2d11663e961250f557bc4" - integrity sha512-5JmbNpssUF03odFM4ArvIsrO9bv7HnAJ0VtefXhh0WBpaFs8NgI3rTkCTFimvtRQjDR9U2bh23fXz2vjQQz6oA== +"@docusaurus/plugin-sitemap@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.0.1.tgz#6f8edb82b745b040d6b1495e2798396f63e50289" + integrity sha512-KcYuIUIp2JPzUf+Xa7W2BSsjLgN1/0h+VAz7D/C3RYjAgC5ApPX8wO+TECmGfunl/m7WKGUmLabfOon/as64kQ== dependencies: - "@docusaurus/core" "2.0.0-rc.1" - "@docusaurus/logger" "2.0.0-rc.1" - "@docusaurus/types" "2.0.0-rc.1" - "@docusaurus/utils" "2.0.0-rc.1" - "@docusaurus/utils-common" "2.0.0-rc.1" - "@docusaurus/utils-validation" "2.0.0-rc.1" + "@docusaurus/core" "2.0.1" + "@docusaurus/logger" "2.0.1" + "@docusaurus/types" "2.0.1" + "@docusaurus/utils" "2.0.1" + "@docusaurus/utils-common" "2.0.1" + "@docusaurus/utils-validation" "2.0.1" fs-extra "^10.1.0" sitemap "^7.1.1" tslib "^2.4.0" -"@docusaurus/preset-classic@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/preset-classic/-/preset-classic-2.0.0-rc.1.tgz#5e5b1cf80b3dd4e2c3f824c78a111f105858d853" - integrity sha512-5jjTVZkhArjyoNHwCI9x4PSG0zPmBJILjZLVrxPcHpm/K0ltkYcp6J3GxYpf5EbMuOh5+yCWM63cSshGcNOo3Q== +"@docusaurus/preset-classic@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/preset-classic/-/preset-classic-2.0.1.tgz#21a806e16b61026d2a0efa6ca97e17397065d894" + integrity sha512-nOoniTg46My1qdDlLWeFs55uEmxOJ+9WMF8KKG8KMCu5LAvpemMi7rQd4x8Tw+xiPHZ/sQzH9JmPTMPRE4QGPw== dependencies: - "@docusaurus/core" "2.0.0-rc.1" - "@docusaurus/plugin-content-blog" "2.0.0-rc.1" - "@docusaurus/plugin-content-docs" "2.0.0-rc.1" - "@docusaurus/plugin-content-pages" "2.0.0-rc.1" - "@docusaurus/plugin-debug" "2.0.0-rc.1" - "@docusaurus/plugin-google-analytics" "2.0.0-rc.1" - "@docusaurus/plugin-google-gtag" "2.0.0-rc.1" - "@docusaurus/plugin-sitemap" "2.0.0-rc.1" - "@docusaurus/theme-classic" "2.0.0-rc.1" - "@docusaurus/theme-common" "2.0.0-rc.1" - "@docusaurus/theme-search-algolia" "2.0.0-rc.1" - "@docusaurus/types" "2.0.0-rc.1" + "@docusaurus/core" "2.0.1" + "@docusaurus/plugin-content-blog" "2.0.1" + "@docusaurus/plugin-content-docs" "2.0.1" + "@docusaurus/plugin-content-pages" "2.0.1" + "@docusaurus/plugin-debug" "2.0.1" + "@docusaurus/plugin-google-analytics" "2.0.1" + "@docusaurus/plugin-google-gtag" "2.0.1" + "@docusaurus/plugin-sitemap" "2.0.1" + "@docusaurus/theme-classic" "2.0.1" + "@docusaurus/theme-common" "2.0.1" + "@docusaurus/theme-search-algolia" "2.0.1" + "@docusaurus/types" "2.0.1" "@docusaurus/react-loadable@5.5.2", "react-loadable@npm:@docusaurus/react-loadable@5.5.2": version "5.5.2" @@ -2029,23 +2147,23 @@ "@types/react" "*" prop-types "^15.6.2" -"@docusaurus/theme-classic@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/theme-classic/-/theme-classic-2.0.0-rc.1.tgz#4ab30745e6b03b0f277837debae786a0a83aee6a" - integrity sha512-qNiz7ieeq3AC+V8TbW6S63pWLJph1CbzWDDPTqxDLHgA8VQaNaSmJM8S92pH+yKALRb9u14ogjjYYc75Nj2JmQ== +"@docusaurus/theme-classic@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/theme-classic/-/theme-classic-2.0.1.tgz#043b6fcd2ecb2aecd134419b198c9f519029d5e7" + integrity sha512-0jfigiqkUwIuKOw7Me5tqUM9BBvoQX7qqeevx7v4tkYQexPhk3VYSZo7aRuoJ9oyW5makCTPX551PMJzmq7+sw== dependencies: - "@docusaurus/core" "2.0.0-rc.1" - "@docusaurus/mdx-loader" "2.0.0-rc.1" - "@docusaurus/module-type-aliases" "2.0.0-rc.1" - "@docusaurus/plugin-content-blog" "2.0.0-rc.1" - "@docusaurus/plugin-content-docs" "2.0.0-rc.1" - "@docusaurus/plugin-content-pages" "2.0.0-rc.1" - "@docusaurus/theme-common" "2.0.0-rc.1" - "@docusaurus/theme-translations" "2.0.0-rc.1" - "@docusaurus/types" "2.0.0-rc.1" - "@docusaurus/utils" "2.0.0-rc.1" - "@docusaurus/utils-common" "2.0.0-rc.1" - "@docusaurus/utils-validation" "2.0.0-rc.1" + "@docusaurus/core" "2.0.1" + "@docusaurus/mdx-loader" "2.0.1" + "@docusaurus/module-type-aliases" "2.0.1" + "@docusaurus/plugin-content-blog" "2.0.1" + "@docusaurus/plugin-content-docs" "2.0.1" + "@docusaurus/plugin-content-pages" "2.0.1" + "@docusaurus/theme-common" "2.0.1" + "@docusaurus/theme-translations" "2.0.1" + "@docusaurus/types" "2.0.1" + "@docusaurus/utils" "2.0.1" + "@docusaurus/utils-common" "2.0.1" + "@docusaurus/utils-validation" "2.0.1" "@mdx-js/react" "^1.6.22" clsx "^1.2.1" copy-text-to-clipboard "^3.0.1" @@ -2060,17 +2178,17 @@ tslib "^2.4.0" utility-types "^3.10.0" -"@docusaurus/theme-common@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/theme-common/-/theme-common-2.0.0-rc.1.tgz#ea5d9732a16b03b488555e50107161bfa2abad98" - integrity sha512-1r9ZLKD9SeoCYVzWzcdR79Dia4ANlrlRjNl6uzETOEybjK6FF7yEa9Yra8EJcOCbi3coyYz5xFh/r1YHFTFHug== +"@docusaurus/theme-common@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/theme-common/-/theme-common-2.0.1.tgz#9594d58fbef11fe480967b5ce4cdbb3cd78d9ca3" + integrity sha512-I3b6e/ryiTQMsbES40cP0DRGnfr0E2qghVq+XecyMKjBPejISoSFEDn0MsnbW8Q26k1Dh/0qDH8QKDqaZZgLhA== dependencies: - "@docusaurus/mdx-loader" "2.0.0-rc.1" - "@docusaurus/module-type-aliases" "2.0.0-rc.1" - "@docusaurus/plugin-content-blog" "2.0.0-rc.1" - "@docusaurus/plugin-content-docs" "2.0.0-rc.1" - "@docusaurus/plugin-content-pages" "2.0.0-rc.1" - "@docusaurus/utils" "2.0.0-rc.1" + "@docusaurus/mdx-loader" "2.0.1" + "@docusaurus/module-type-aliases" "2.0.1" + "@docusaurus/plugin-content-blog" "2.0.1" + "@docusaurus/plugin-content-docs" "2.0.1" + "@docusaurus/plugin-content-pages" "2.0.1" + "@docusaurus/utils" "2.0.1" "@types/history" "^4.7.11" "@types/react" "*" "@types/react-router-config" "*" @@ -2080,19 +2198,19 @@ tslib "^2.4.0" utility-types "^3.10.0" -"@docusaurus/theme-search-algolia@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/theme-search-algolia/-/theme-search-algolia-2.0.0-rc.1.tgz#e78c0aeaea6a3717ae3a6ecd75a8652bd7c8e974" - integrity sha512-H5yq6V/B4qo6GZrDKMbeSpk3T9e9K2MliDzLonRu0w3QHW9orVGe0c/lZvRbGlDZjnsOo7XGddhXXIDWGwnpaA== +"@docusaurus/theme-search-algolia@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/theme-search-algolia/-/theme-search-algolia-2.0.1.tgz#0aab8407b2163f67eb4c48f1de33944e1695fa74" + integrity sha512-cw3NaOSKbYlsY6uNj4PgO+5mwyQ3aEWre5RlmvjStaz2cbD15Nr69VG8Rd/F6Q5VsCT8BvSdkPDdDG5d/ACexg== dependencies: "@docsearch/react" "^3.1.1" - "@docusaurus/core" "2.0.0-rc.1" - "@docusaurus/logger" "2.0.0-rc.1" - "@docusaurus/plugin-content-docs" "2.0.0-rc.1" - "@docusaurus/theme-common" "2.0.0-rc.1" - "@docusaurus/theme-translations" "2.0.0-rc.1" - "@docusaurus/utils" "2.0.0-rc.1" - "@docusaurus/utils-validation" "2.0.0-rc.1" + "@docusaurus/core" "2.0.1" + "@docusaurus/logger" "2.0.1" + "@docusaurus/plugin-content-docs" "2.0.1" + "@docusaurus/theme-common" "2.0.1" + "@docusaurus/theme-translations" "2.0.1" + "@docusaurus/utils" "2.0.1" + "@docusaurus/utils-validation" "2.0.1" algoliasearch "^4.13.1" algoliasearch-helper "^3.10.0" clsx "^1.2.1" @@ -2102,18 +2220,18 @@ tslib "^2.4.0" utility-types "^3.10.0" -"@docusaurus/theme-translations@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/theme-translations/-/theme-translations-2.0.0-rc.1.tgz#bd647f78c741ee7f6c6d2cbbd3e3f282ef2f89ad" - integrity sha512-JLhNdlnbQhxVQzOnLyiCaTzKFa1lpVrM3nCrkGQKscoG2rY6ARGYMgMN2DkoH6hm7TflQ8+PE1S5MzzASeLs4Q== +"@docusaurus/theme-translations@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/theme-translations/-/theme-translations-2.0.1.tgz#955a687c974265a811bfc743d98ef3eab0379100" + integrity sha512-v1MYYlbsdX+rtKnXFcIAn9ar0Z6K0yjqnCYS0p/KLCLrfJwfJ8A3oRJw2HiaIb8jQfk1WMY2h5Qi1p4vHOekQw== dependencies: fs-extra "^10.1.0" tslib "^2.4.0" -"@docusaurus/types@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/types/-/types-2.0.0-rc.1.tgz#032f8afde6b4878e37f984b9949a96b150103c21" - integrity sha512-wX25FOZa/aKnCGA5ljWPaDpMW3TuTbs0BtjQ8WTC557p8zDvuz4r+g2/FPHsgWE0TKwUMf4usQU1m3XpJLPN+g== +"@docusaurus/types@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/types/-/types-2.0.1.tgz#8696a70e85c4b9be80b38ac592d520f6fe72618b" + integrity sha512-o+4hAFWkj3sBszVnRTAnNqtAIuIW0bNaYyDwQhQ6bdz3RAPEq9cDKZxMpajsj4z2nRty8XjzhyufAAjxFTyrfg== dependencies: "@types/history" "^4.7.11" "@types/react" "*" @@ -2131,6 +2249,13 @@ dependencies: tslib "^2.4.0" +"@docusaurus/utils-common@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/utils-common/-/utils-common-2.0.1.tgz#b6f2b029547f739e1431ec84abd16974edf495e0" + integrity sha512-kajCCDCXRd1HFH5EUW31MPaQcsyNlGakpkDoTBtBvpa4EIPvWaSKy7TIqYKHrZjX4tnJ0YbEJvaXfjjgdq5xSg== + dependencies: + tslib "^2.4.0" + "@docusaurus/utils-validation@2.0.0-rc.1": version "2.0.0-rc.1" resolved "https://registry.yarnpkg.com/@docusaurus/utils-validation/-/utils-validation-2.0.0-rc.1.tgz#dded12f036cda8a54a19e01694b35859fe0cf1d5" @@ -2142,6 +2267,17 @@ js-yaml "^4.1.0" tslib "^2.4.0" +"@docusaurus/utils-validation@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/utils-validation/-/utils-validation-2.0.1.tgz#69f7d4944288d71f00fdba6dde10f05008f04308" + integrity sha512-f14AnwFBy4/1A19zWthK+Ii80YDz+4qt8oPpK3julywXsheSxPBqgsND3LVBBvB2p3rJHvbo2m3HyB9Tco1JRw== + dependencies: + "@docusaurus/logger" "2.0.1" + "@docusaurus/utils" "2.0.1" + joi "^17.6.0" + js-yaml "^4.1.0" + tslib "^2.4.0" + "@docusaurus/utils@2.0.0-rc.1": version "2.0.0-rc.1" resolved "https://registry.yarnpkg.com/@docusaurus/utils/-/utils-2.0.0-rc.1.tgz#53584b800df9e13864d5ef1a76aa7655a90ec86e" @@ -2163,6 +2299,27 @@ url-loader "^4.1.1" webpack "^5.73.0" +"@docusaurus/utils@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@docusaurus/utils/-/utils-2.0.1.tgz#37b4b42e29175e5d2d811fcbf9f93bffeca7c353" + integrity sha512-u2Vdl/eoVwMfUjDCkg7FjxoiwFs/XhVVtNxQEw8cvB+qaw6QWyT73m96VZzWtUb1fDOefHoZ+bZ0ObFeKk9lMQ== + dependencies: + "@docusaurus/logger" "2.0.1" + "@svgr/webpack" "^6.2.1" + file-loader "^6.2.0" + fs-extra "^10.1.0" + github-slugger "^1.4.0" + globby "^11.1.0" + gray-matter "^4.0.3" + js-yaml "^4.1.0" + lodash "^4.17.21" + micromatch "^4.0.5" + resolve-pathname "^3.0.0" + shelljs "^0.8.5" + tslib "^2.4.0" + url-loader "^4.1.1" + webpack "^5.73.0" + "@emotion/is-prop-valid@^0.8.2": version "0.8.8" resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz#db28b1c4368a259b60a97311d6a952d4fd01ac1a" @@ -2195,6 +2352,11 @@ 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" @@ -2202,6 +2364,13 @@ 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" + integrity sha512-PMqJvY5Fae8HVQgUqM+lidprS6p9LSvB0AUhCdYKqr3YCaV+WaWCeVNBtXPRY2YIdrgcsL2+vd5F07FxgihHUw== + 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" @@ -2219,6 +2388,13 @@ "@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" + integrity sha512-uiOalFKPG937UCLm42RxjESTWUVpbbatvlphQAU6bsv+ence6IoVG8JOUZcy8eW81NkU+Idiwvx10WFLmR4MIg== + dependencies: + "@floating-ui/dom" "^1.0.0" + "@gar/promisify@^1.0.1": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" From 49c1881d291ecbb13a8d125c2f6779c847d6d64d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:49:59 +0000 Subject: [PATCH 157/203] :arrow_up: Bump @typescript-eslint/eslint-plugin from 5.30.7 to 5.31.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.30.7 to 5.31.0. - [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.31.0/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 | 91 +++++++++++++++++++++++++------- 2 files changed, 73 insertions(+), 20 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index abc928e9..9b4e348b 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.69.0", - "@typescript-eslint/eslint-plugin": "^5.30.7", + "@typescript-eslint/eslint-plugin": "^5.31.0", "@typescript-eslint/parser": "^5.30.7", "eslint": "^8.20.0", "glob": "^8.0.3", diff --git a/yarn.lock b/yarn.lock index a6b3e864..45776a8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2195,6 +2195,11 @@ 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" @@ -2202,6 +2207,13 @@ 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" + integrity sha512-PMqJvY5Fae8HVQgUqM+lidprS6p9LSvB0AUhCdYKqr3YCaV+WaWCeVNBtXPRY2YIdrgcsL2+vd5F07FxgihHUw== + 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" @@ -2219,6 +2231,13 @@ "@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" + integrity sha512-uiOalFKPG937UCLm42RxjESTWUVpbbatvlphQAU6bsv+ence6IoVG8JOUZcy8eW81NkU+Idiwvx10WFLmR4MIg== + dependencies: + "@floating-ui/dom" "^1.0.0" + "@gar/promisify@^1.0.1": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" @@ -5001,14 +5020,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.30.7", "@typescript-eslint/eslint-plugin@^5.5.0": - version "5.30.7" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.7.tgz#1621dabc1ae4084310e19e9efc80dfdbb97e7493" - integrity sha512-l4L6Do+tfeM2OK0GJsU7TUcM/1oN/N25xHm3Jb4z3OiDU4Lj8dIuxX9LpVMS9riSXQs42D1ieX7b85/r16H9Fw== +"@typescript-eslint/eslint-plugin@^5.31.0", "@typescript-eslint/eslint-plugin@^5.5.0": + version "5.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.31.0.tgz#cae1967b1e569e6171bbc6bec2afa4e0c8efccfe" + integrity sha512-VKW4JPHzG5yhYQrQ1AzXgVgX8ZAJEvCz0QI6mLRX4tf7rnFfh5D8SKm0Pq6w5PyNfAWJk6sv313+nEt3ohWMBQ== dependencies: - "@typescript-eslint/scope-manager" "5.30.7" - "@typescript-eslint/type-utils" "5.30.7" - "@typescript-eslint/utils" "5.30.7" + "@typescript-eslint/scope-manager" "5.31.0" + "@typescript-eslint/type-utils" "5.31.0" + "@typescript-eslint/utils" "5.31.0" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -5049,12 +5068,20 @@ "@typescript-eslint/types" "5.30.7" "@typescript-eslint/visitor-keys" "5.30.7" -"@typescript-eslint/type-utils@5.30.7": - version "5.30.7" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.30.7.tgz#5693dc3db6f313f302764282d614cfdbc8a9fcfd" - integrity sha512-nD5qAE2aJX/YLyKMvOU5jvJyku4QN5XBVsoTynFrjQZaDgDV6i7QHFiYCx10wvn7hFvfuqIRNBtsgaLe0DbWhw== +"@typescript-eslint/scope-manager@5.31.0": + version "5.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.31.0.tgz#f47a794ba84d9b818ab7f8f44fff55a61016c606" + integrity sha512-8jfEzBYDBG88rcXFxajdVavGxb5/XKXyvWgvD8Qix3EEJLCFIdVloJw+r9ww0wbyNLOTYyBsR+4ALNGdlalLLg== dependencies: - "@typescript-eslint/utils" "5.30.7" + "@typescript-eslint/types" "5.31.0" + "@typescript-eslint/visitor-keys" "5.31.0" + +"@typescript-eslint/type-utils@5.31.0": + version "5.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.31.0.tgz#70a0b7201360b5adbddb0c36080495aa08f6f3d9" + integrity sha512-7ZYqFbvEvYXFn9ax02GsPcEOmuWNg+14HIf4q+oUuLnMbpJ6eHAivCg7tZMVwzrIuzX3QCeAOqKoyMZCv5xe+w== + dependencies: + "@typescript-eslint/utils" "5.31.0" debug "^4.3.4" tsutils "^3.21.0" @@ -5068,6 +5095,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.30.7.tgz#18331487cc92d0f1fb1a6f580c8ec832528079d0" integrity sha512-ocVkETUs82+U+HowkovV6uxf1AnVRKCmDRNUBUUo46/5SQv1owC/EBFkiu4MOHeZqhKz2ktZ3kvJJ1uFqQ8QPg== +"@typescript-eslint/types@5.31.0": + version "5.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.31.0.tgz#7aa389122b64b18e473c1672fb3b8310e5f07a9a" + integrity sha512-/f/rMaEseux+I4wmR6mfpM2wvtNZb1p9hAV77hWfuKc3pmaANp5dLAZSiE3/8oXTYTt3uV9KW5yZKJsMievp6g== + "@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" @@ -5094,6 +5126,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.31.0": + version "5.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.31.0.tgz#eb92970c9d6e3946690d50c346fb9b1d745ee882" + integrity sha512-3S625TMcARX71wBc2qubHaoUwMEn+l9TCsaIzYI/ET31Xm2c9YQ+zhGgpydjorwQO9pLfR/6peTzS/0G3J/hDw== + dependencies: + "@typescript-eslint/types" "5.31.0" + "@typescript-eslint/visitor-keys" "5.31.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" @@ -5106,15 +5151,15 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/utils@5.30.7", "@typescript-eslint/utils@^5.13.0": - version "5.30.7" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.30.7.tgz#7135be070349e9f7caa262b0ca59dc96123351bb" - integrity sha512-Z3pHdbFw+ftZiGUnm1GZhkJgVqsDL5CYW2yj+TB2mfXDFOMqtbzQi2dNJIyPqPbx9mv2kUxS1gU+r2gKlKi1rQ== +"@typescript-eslint/utils@5.31.0", "@typescript-eslint/utils@^5.13.0": + version "5.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.31.0.tgz#e146fa00dca948bfe547d665b2138a2dc1b79acd" + integrity sha512-kcVPdQS6VIpVTQ7QnGNKMFtdJdvnStkqS5LeALr4rcwx11G6OWb2HB17NMPnlRHvaZP38hL9iK8DdE9Fne7NYg== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.30.7" - "@typescript-eslint/types" "5.30.7" - "@typescript-eslint/typescript-estree" "5.30.7" + "@typescript-eslint/scope-manager" "5.31.0" + "@typescript-eslint/types" "5.31.0" + "@typescript-eslint/typescript-estree" "5.31.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -5134,6 +5179,14 @@ "@typescript-eslint/types" "5.30.7" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.31.0": + version "5.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.31.0.tgz#b0eca264df01ce85dceb76aebff3784629258f54" + integrity sha512-ZK0jVxSjS4gnPirpVjXHz7mgdOsZUHzNYSfTw2yPa3agfbt9YfqaBiBZFSSxeBWnpWkzCxTfUpnzA3Vily/CSg== + dependencies: + "@typescript-eslint/types" "5.31.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 f60da1d5a144f0828dac2afcdaffcea522983076 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:53:30 +0000 Subject: [PATCH 158/203] :arrow_up: Bump react-hook-form from 7.33.1 to 7.34.0 Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.33.1 to 7.34.0. - [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.33.1...v7.34.0) --- updated-dependencies: - dependency-name: react-hook-form dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 4 ++-- yarn.lock | 27 +++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 24d2fa85..aa9ef707 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -3,7 +3,7 @@ "version": "0.2.24", "license": "MIT", "dependencies": { - "@floating-ui/react-dom": "^0.7.2", + "@floating-ui/react-dom": "^1.0.0", "@floating-ui/react-dom-interactions": "^0.6.6", "@headlessui/react": "^1.6.6", "@heroicons/react": "^1.0.6", @@ -15,7 +15,7 @@ "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", - "react-hook-form": "^7.33.1", + "react-hook-form": "^7.34.0", "react-use": "^17.4.0", "react-vega": "^7.6.0", "vega": "^5.22.1", diff --git a/yarn.lock b/yarn.lock index a6b3e864..cecae749 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2195,6 +2195,11 @@ 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" @@ -2202,6 +2207,13 @@ 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" + integrity sha512-PMqJvY5Fae8HVQgUqM+lidprS6p9LSvB0AUhCdYKqr3YCaV+WaWCeVNBtXPRY2YIdrgcsL2+vd5F07FxgihHUw== + 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" @@ -2219,6 +2231,13 @@ "@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" + integrity sha512-uiOalFKPG937UCLm42RxjESTWUVpbbatvlphQAU6bsv+ence6IoVG8JOUZcy8eW81NkU+Idiwvx10WFLmR4MIg== + dependencies: + "@floating-ui/dom" "^1.0.0" + "@gar/promisify@^1.0.1": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" @@ -15059,10 +15078,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: - version "7.33.1" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.33.1.tgz#8c4410e3420788d3b804d62cc4c142915c2e46d0" - integrity sha512-ydTfTxEJdvgjCZBj5DDXRc58oTEfnFupEwwTAQ9FSKzykEJkX+3CiAkGtAMiZG7IPWHuzgT6AOBfogiKhUvKgg== +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-inspector@^5.1.0: version "5.1.1" From 05c2743ac18ffc4c7de994af8b5d89c433dbd3cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:57:42 +0000 Subject: [PATCH 159/203] :arrow_up: Bump @docusaurus/core from 2.0.0-rc.1 to 2.0.1 Bumps [@docusaurus/core](https://github.com/facebook/docusaurus/tree/HEAD/packages/docusaurus) from 2.0.0-rc.1 to 2.0.1. - [Release notes](https://github.com/facebook/docusaurus/releases) - [Changelog](https://github.com/facebook/docusaurus/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/docusaurus/commits/v2.0.1/packages/docusaurus) --- updated-dependencies: - dependency-name: "@docusaurus/core" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/website/package.json | 2 +- yarn.lock | 157 ---------------------------------- 2 files changed, 1 insertion(+), 158 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index 35d60a13..ddb162b6 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -12,7 +12,7 @@ "format": "prettier --write ." }, "dependencies": { - "@docusaurus/core": "2.0.0-rc.1", + "@docusaurus/core": "2.0.1", "@docusaurus/preset-classic": "2.0.1", "@heroicons/react": "^1.0.6", "@quri/squiggle-components": "^0.2.23", diff --git a/yarn.lock b/yarn.lock index c367b5ff..c705dde4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1766,83 +1766,6 @@ "@docsearch/css" "3.1.1" algoliasearch "^4.0.0" -"@docusaurus/core@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/core/-/core-2.0.0-rc.1.tgz#828d93d241171565d8947a9ab404091e04759141" - integrity sha512-b9FX0Z+EddfQ6wAiNh+Wx4fysKfcvEcWJrZ5USROn3C+EVU5P4luaa8mwWK//O+hTwD9ur7/A44IZ/tWCTAoLQ== - dependencies: - "@babel/core" "^7.18.6" - "@babel/generator" "^7.18.7" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-transform-runtime" "^7.18.6" - "@babel/preset-env" "^7.18.6" - "@babel/preset-react" "^7.18.6" - "@babel/preset-typescript" "^7.18.6" - "@babel/runtime" "^7.18.6" - "@babel/runtime-corejs3" "^7.18.6" - "@babel/traverse" "^7.18.8" - "@docusaurus/cssnano-preset" "2.0.0-rc.1" - "@docusaurus/logger" "2.0.0-rc.1" - "@docusaurus/mdx-loader" "2.0.0-rc.1" - "@docusaurus/react-loadable" "5.5.2" - "@docusaurus/utils" "2.0.0-rc.1" - "@docusaurus/utils-common" "2.0.0-rc.1" - "@docusaurus/utils-validation" "2.0.0-rc.1" - "@slorber/static-site-generator-webpack-plugin" "^4.0.7" - "@svgr/webpack" "^6.2.1" - autoprefixer "^10.4.7" - babel-loader "^8.2.5" - babel-plugin-dynamic-import-node "^2.3.3" - boxen "^6.2.1" - chalk "^4.1.2" - chokidar "^3.5.3" - clean-css "^5.3.0" - cli-table3 "^0.6.2" - combine-promises "^1.1.0" - commander "^5.1.0" - copy-webpack-plugin "^11.0.0" - core-js "^3.23.3" - css-loader "^6.7.1" - css-minimizer-webpack-plugin "^4.0.0" - cssnano "^5.1.12" - del "^6.1.1" - detect-port "^1.3.0" - escape-html "^1.0.3" - eta "^1.12.3" - file-loader "^6.2.0" - fs-extra "^10.1.0" - html-minifier-terser "^6.1.0" - html-tags "^3.2.0" - html-webpack-plugin "^5.5.0" - import-fresh "^3.3.0" - leven "^3.1.0" - lodash "^4.17.21" - mini-css-extract-plugin "^2.6.1" - postcss "^8.4.14" - postcss-loader "^7.0.0" - prompts "^2.4.2" - react-dev-utils "^12.0.1" - react-helmet-async "^1.3.0" - react-loadable "npm:@docusaurus/react-loadable@5.5.2" - react-loadable-ssr-addon-v5-slorber "^1.0.1" - react-router "^5.3.3" - react-router-config "^5.1.1" - react-router-dom "^5.3.3" - rtl-detect "^1.0.4" - semver "^7.3.7" - serve-handler "^6.1.3" - shelljs "^0.8.5" - terser-webpack-plugin "^5.3.3" - tslib "^2.4.0" - update-notifier "^5.1.0" - url-loader "^4.1.1" - wait-on "^6.0.1" - webpack "^5.73.0" - webpack-bundle-analyzer "^4.5.0" - webpack-dev-server "^4.9.3" - webpack-merge "^5.8.0" - webpackbar "^5.0.2" - "@docusaurus/core@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@docusaurus/core/-/core-2.0.1.tgz#a2b0d653e8f18eacddda4778a46b638dd1f0f45c" @@ -1920,16 +1843,6 @@ webpack-merge "^5.8.0" webpackbar "^5.0.2" -"@docusaurus/cssnano-preset@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/cssnano-preset/-/cssnano-preset-2.0.0-rc.1.tgz#76bbd7f6912779a0667f8f2fd8fc1a05618a6148" - integrity sha512-9/KmQvF+eTlMqUqG6UcXbRgxbGed/8bQInXuKEs+95/jI6jO/3xSzuRwuHHHP0naUvSVWjnNI9jngPrQerXE5w== - dependencies: - cssnano-preset-advanced "^5.3.8" - postcss "^8.4.14" - postcss-sort-media-queries "^4.2.1" - tslib "^2.4.0" - "@docusaurus/cssnano-preset@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@docusaurus/cssnano-preset/-/cssnano-preset-2.0.1.tgz#4d0c49338cf3aa88c5bd7cffbf77654db8e1e3b2" @@ -1940,14 +1853,6 @@ postcss-sort-media-queries "^4.2.1" tslib "^2.4.0" -"@docusaurus/logger@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/logger/-/logger-2.0.0-rc.1.tgz#db95e9b15bc243695830a5b791c0eff705ef1b54" - integrity sha512-daa3g+SXuO9K60PVMiSUmDEK9Vro+Ed7i7uF8CH6QQJLcNZy/zJc0Xz62eH7ip1x77fmeb6Rg4Us1TqTFc9AbQ== - dependencies: - chalk "^4.1.2" - tslib "^2.4.0" - "@docusaurus/logger@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@docusaurus/logger/-/logger-2.0.1.tgz#78a940a333d2f654fd9dea24db2c962034d4b1ff" @@ -1956,29 +1861,6 @@ chalk "^4.1.2" tslib "^2.4.0" -"@docusaurus/mdx-loader@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/mdx-loader/-/mdx-loader-2.0.0-rc.1.tgz#e78d7d416aacc289f2427c5ccdb9145820acb0cb" - integrity sha512-8Fg0c/ceu39knmr7w0dutm7gq3YxKYCqWVS2cB/cPATzChCCNH/AGLfBT6sz/Z4tjVXE+NyREq2pfOFvkhjVXg== - dependencies: - "@babel/parser" "^7.18.8" - "@babel/traverse" "^7.18.8" - "@docusaurus/logger" "2.0.0-rc.1" - "@docusaurus/utils" "2.0.0-rc.1" - "@mdx-js/mdx" "^1.6.22" - escape-html "^1.0.3" - file-loader "^6.2.0" - fs-extra "^10.1.0" - image-size "^1.0.1" - mdast-util-to-string "^2.0.0" - remark-emoji "^2.2.0" - stringify-object "^3.3.0" - tslib "^2.4.0" - unified "^9.2.2" - unist-util-visit "^2.0.3" - url-loader "^4.1.1" - webpack "^5.73.0" - "@docusaurus/mdx-loader@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@docusaurus/mdx-loader/-/mdx-loader-2.0.1.tgz#cc73690ca5d356687d9e75740560b4159cd5cdb5" @@ -2242,13 +2124,6 @@ webpack "^5.73.0" webpack-merge "^5.8.0" -"@docusaurus/utils-common@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/utils-common/-/utils-common-2.0.0-rc.1.tgz#3e233a28794325d5d9d3af3f7b1c22b59aa8b847" - integrity sha512-+iZICpeFPZJ9oGJXuG92WTWee6WRnVx5BdzlcfuKf/f5KQX8PvwXR2tDME78FGGhShB8zr+vjuNEXuLvXT7j2A== - dependencies: - tslib "^2.4.0" - "@docusaurus/utils-common@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@docusaurus/utils-common/-/utils-common-2.0.1.tgz#b6f2b029547f739e1431ec84abd16974edf495e0" @@ -2256,17 +2131,6 @@ dependencies: tslib "^2.4.0" -"@docusaurus/utils-validation@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/utils-validation/-/utils-validation-2.0.0-rc.1.tgz#dded12f036cda8a54a19e01694b35859fe0cf1d5" - integrity sha512-lj36gm9Ksu4tt/EUeLDWoMbXe3sfBxeIPIUUdqYcBYkF/rpQkh+uL/dncjNGiw6uvBOqXhOfsFVP045HtgShVw== - dependencies: - "@docusaurus/logger" "2.0.0-rc.1" - "@docusaurus/utils" "2.0.0-rc.1" - joi "^17.6.0" - js-yaml "^4.1.0" - tslib "^2.4.0" - "@docusaurus/utils-validation@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@docusaurus/utils-validation/-/utils-validation-2.0.1.tgz#69f7d4944288d71f00fdba6dde10f05008f04308" @@ -2278,27 +2142,6 @@ js-yaml "^4.1.0" tslib "^2.4.0" -"@docusaurus/utils@2.0.0-rc.1": - version "2.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@docusaurus/utils/-/utils-2.0.0-rc.1.tgz#53584b800df9e13864d5ef1a76aa7655a90ec86e" - integrity sha512-ym9I1OwIYbKs1LGaUajaA/vDG8VweJj/6YoZjHp+eDQHhTRIrHXiYoGDqorafRhftKwnA1EnyomuXpNd9bq8Gg== - dependencies: - "@docusaurus/logger" "2.0.0-rc.1" - "@svgr/webpack" "^6.2.1" - file-loader "^6.2.0" - fs-extra "^10.1.0" - github-slugger "^1.4.0" - globby "^11.1.0" - gray-matter "^4.0.3" - js-yaml "^4.1.0" - lodash "^4.17.21" - micromatch "^4.0.5" - resolve-pathname "^3.0.0" - shelljs "^0.8.5" - tslib "^2.4.0" - url-loader "^4.1.1" - webpack "^5.73.0" - "@docusaurus/utils@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@docusaurus/utils/-/utils-2.0.1.tgz#37b4b42e29175e5d2d811fcbf9f93bffeca7c353" From 77fb3b14a0f7b0a56eedb47c338d0e2857185c70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 15:03:42 +0000 Subject: [PATCH 160/203] :arrow_up: Bump @typescript-eslint/parser from 5.30.7 to 5.31.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.30.7 to 5.31.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.31.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, 8 insertions(+), 42 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index b485ed54..0defda40 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -130,7 +130,7 @@ "@types/node": "18.x", "@types/vscode": "^1.69.0", "@typescript-eslint/eslint-plugin": "^5.31.0", - "@typescript-eslint/parser": "^5.30.7", + "@typescript-eslint/parser": "^5.31.0", "eslint": "^8.21.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index 7c985149..feb6846a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5204,14 +5204,14 @@ dependencies: "@typescript-eslint/utils" "5.29.0" -"@typescript-eslint/parser@^5.30.7", "@typescript-eslint/parser@^5.5.0": - version "5.30.7" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.30.7.tgz#99d09729392aec9e64b1de45cd63cb81a4ddd980" - integrity sha512-Rg5xwznHWWSy7v2o0cdho6n+xLhK2gntImp0rJroVVFkcYFYQ8C8UJTSuTw/3CnExBmPjycjmUJkxVmjXsld6A== +"@typescript-eslint/parser@^5.31.0", "@typescript-eslint/parser@^5.5.0": + version "5.31.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.31.0.tgz#7f42d7dcc68a0a6d80a0f3d9a65063aee7bb8d2c" + integrity sha512-UStjQiZ9OFTFReTrN+iGrC6O/ko9LVDhreEK5S3edmXgR396JGq7CoX2TWIptqt/ESzU2iRKXAHfSF2WJFcWHw== dependencies: - "@typescript-eslint/scope-manager" "5.30.7" - "@typescript-eslint/types" "5.30.7" - "@typescript-eslint/typescript-estree" "5.30.7" + "@typescript-eslint/scope-manager" "5.31.0" + "@typescript-eslint/types" "5.31.0" + "@typescript-eslint/typescript-estree" "5.31.0" debug "^4.3.4" "@typescript-eslint/scope-manager@5.29.0": @@ -5222,14 +5222,6 @@ "@typescript-eslint/types" "5.29.0" "@typescript-eslint/visitor-keys" "5.29.0" -"@typescript-eslint/scope-manager@5.30.7": - version "5.30.7" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz#8269a931ef1e5ae68b5eb80743cc515c4ffe3dd7" - integrity sha512-7BM1bwvdF1UUvt+b9smhqdc/eniOnCKxQT/kj3oXtj3LqnTWCAM0qHRHfyzCzhEfWX0zrW7KqXXeE4DlchZBKw== - dependencies: - "@typescript-eslint/types" "5.30.7" - "@typescript-eslint/visitor-keys" "5.30.7" - "@typescript-eslint/scope-manager@5.31.0": version "5.31.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.31.0.tgz#f47a794ba84d9b818ab7f8f44fff55a61016c606" @@ -5252,11 +5244,6 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== -"@typescript-eslint/types@5.30.7": - version "5.30.7" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.30.7.tgz#18331487cc92d0f1fb1a6f580c8ec832528079d0" - integrity sha512-ocVkETUs82+U+HowkovV6uxf1AnVRKCmDRNUBUUo46/5SQv1owC/EBFkiu4MOHeZqhKz2ktZ3kvJJ1uFqQ8QPg== - "@typescript-eslint/types@5.31.0": version "5.31.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.31.0.tgz#7aa389122b64b18e473c1672fb3b8310e5f07a9a" @@ -5275,19 +5262,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.30.7": - version "5.30.7" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz#05da9f1b281985bfedcf62349847f8d168eecc07" - integrity sha512-tNslqXI1ZdmXXrHER83TJ8OTYl4epUzJC0aj2i4DMDT4iU+UqLT3EJeGQvJ17BMbm31x5scSwo3hPM0nqQ1AEA== - dependencies: - "@typescript-eslint/types" "5.30.7" - "@typescript-eslint/visitor-keys" "5.30.7" - 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.31.0": version "5.31.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.31.0.tgz#eb92970c9d6e3946690d50c346fb9b1d745ee882" @@ -5333,14 +5307,6 @@ "@typescript-eslint/types" "5.29.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@5.30.7": - version "5.30.7" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz#c093abae75b4fd822bfbad9fc337f38a7a14909a" - integrity sha512-KrRXf8nnjvcpxDFOKej4xkD7657+PClJs5cJVSG7NNoCNnjEdc46juNAQt7AyuWctuCgs6mVRc1xGctEqrjxWw== - dependencies: - "@typescript-eslint/types" "5.30.7" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.31.0": version "5.31.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.31.0.tgz#b0eca264df01ce85dceb76aebff3784629258f54" From 079d8304ef12c4037a4ca2d6ac2b3db5cd3a7c53 Mon Sep 17 00:00:00 2001 From: Quinn Date: Mon, 1 Aug 2022 11:07:19 -0400 Subject: [PATCH 161/203] Update `dependabot.yml`: `open-pull-request-limit`: 100 --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 53e50bd6..e5293308 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,3 +11,5 @@ updates: interval: "weekly" commit-message: prefix: "⬆️" + open-pull-requests-limit: 100 + From bf90427bfa6ada4c3b63cafa0fc67938fcd26e5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 15:13:32 +0000 Subject: [PATCH 162/203] :arrow_up: Bump fast-check from 3.1.0 to 3.1.1 Bumps [fast-check](https://github.com/dubzzz/fast-check/tree/HEAD/packages/fast-check) from 3.1.0 to 3.1.1. - [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.1/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 d46513fd..bdedfd6e 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.0", + "fast-check": "^3.1.1", "gentype": "^4.5.0", "jest": "^27.5.1", "moduleserve": "^0.9.1", diff --git a/yarn.lock b/yarn.lock index 122ce829..ce86d901 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9276,10 +9276,10 @@ fast-check@^2.17.0: dependencies: pure-rand "^5.0.1" -fast-check@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-3.1.0.tgz#0c958b6592f45fb66ea291a0bd1be2e7045f7e57" - integrity sha512-LHM6ZiznfQ5ZxReDUZnlKzSI/nlwCdfwaQ6qrCYBIkuWT6PfI3GOK/O2Xj50DF9oC0HIP22vbbHA8v4itAiyGA== +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== dependencies: pure-rand "^5.0.1" From 8b124376b21d51564d3b997e05fb2bff41d0bd9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 15:15:57 +0000 Subject: [PATCH 163/203] :arrow_up: Bump vega-lite from 5.3.0 to 5.4.0 Bumps [vega-lite](https://github.com/vega/vega-lite) from 5.3.0 to 5.4.0. - [Release notes](https://github.com/vega/vega-lite/releases) - [Changelog](https://github.com/vega/vega-lite/blob/v5.4.0/CHANGELOG.md) - [Commits](https://github.com/vega/vega-lite/compare/v5.3.0...v5.4.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 0978adb7..0b71cd46 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.3.0", + "vega-lite": "^5.4.0", "vscode-uri": "^3.0.3", "yup": "^0.32.11" }, diff --git a/yarn.lock b/yarn.lock index 122ce829..d0bbfe7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18188,10 +18188,10 @@ vega-label@~1.2.0: vega-scenegraph "^4.9.2" vega-util "^1.15.2" -vega-lite@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.3.0.tgz#b9b9ecd80e869e823e6848c67d0a8ad94954bdee" - integrity sha512-6giodZ/bJnWyLq6Gj4OyiDt7EndoGyC9f5xDQjo82yPpUiO4MuG9iiPMqR1SPKmG9/qPBf+klWQR0v/7Mgju0Q== +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== dependencies: "@types/clone" "~2.1.1" array-flat-polyfill "^1.0.1" From e7369b61fa3c5ed86ffcc0e929de3b342396a4db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 15:16:15 +0000 Subject: [PATCH 164/203] :arrow_up: Bump @floating-ui/react-dom-interactions from 0.6.6 to 0.9.1 Bumps [@floating-ui/react-dom-interactions](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/react-dom-interactions) from 0.6.6 to 0.9.1. - [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.1/packages/react-dom-interactions) --- updated-dependencies: - dependency-name: "@floating-ui/react-dom-interactions" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 31 +++++-------------------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 0978adb7..e422f52c 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.6.6", + "@floating-ui/react-dom-interactions": "^0.9.1", "@headlessui/react": "^1.6.6", "@heroicons/react": "^1.0.6", "@hookform/resolvers": "^2.9.7", diff --git a/yarn.lock b/yarn.lock index 122ce829..73478b47 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2190,23 +2190,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" @@ -2214,22 +2202,13 @@ 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== +"@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== dependencies: - "@floating-ui/react-dom" "^0.7.2" + "@floating-ui/react-dom" "^1.0.0" aria-hidden "^1.1.3" - use-isomorphic-layout-effect "^1.1.1" - -"@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" From ab518a067eabe97b0a7588fec3e0156ed9312b6d Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 12:59:21 -0400 Subject: [PATCH 165/203] init release please --- .github/workflows/release-please.yml | 28 + .release-please-manifest.json | 1 + package.json | 3 +- release-please-config.json | 15 + yarn.lock | 753 +++++++++++++++++++++++++-- 5 files changed, 769 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..abdd0510 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,28 @@ +name: Run Release Please + +on: + push: + branches: + - develop + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v2 + id: release + with: + command: manifest + token: ${{secrets.GITHUB_TOKEN}} + default-branch: develop + + # The logic below handles the npm publication: + - name: Checkout Repository + if: ${{ steps.release.outputs.releases_created }} + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v1 + if: ${{ steps.release.outputs.releases_created }} + with: + node-version: 16 + registry-url: 'https://registry.yarnpkg.com/' diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1 @@ +{} diff --git a/package.json b/package.json index dcab983e..eff2b0f1 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "lint:all": "prettier --check . && cd packages/squiggle-lang && yarn lint:rescript" }, "devDependencies": { - "prettier": "^2.7.1" + "prettier": "^2.7.1", + "release-please": "^13.19.6" }, "workspaces": [ "packages/*" diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..1d97b366 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,15 @@ +{ + "bootstrap-sha": "6a2584d800a4274da4ef3d792067e9cb83ea775b", + "bump-patch-for-minor-pre-major": true, + "release-type": "node", + "packages": { + "packages/squiggle-lang": {}, + "packages/components": {}, + "packages/website": {}, + "packages/vscode-ext": {}, + "packages/cli": {} + }, + "skip-github-release": true, + "commit-search-depth": 50, + "plugins": ["node-workspace"] +} diff --git a/yarn.lock b/yarn.lock index e866737c..bb24de81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1642,6 +1642,14 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== +"@conventional-commits/parser@^0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@conventional-commits/parser/-/parser-0.4.1.tgz#213717b25b7ff85260d295466c282226ffe094f2" + integrity sha512-H2ZmUVt6q+KBccXfMBhbBF14NlANeqHTXL4qCL6QGbMzrc4HDXyzWuxPxPNbz71f/5UkR5DrycP5VO9u7crahg== + dependencies: + unist-util-visit "^2.0.3" + unist-util-visit-parents "^3.1.1" + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -2276,6 +2284,11 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@iarna/toml@^2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c" + integrity sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -2621,6 +2634,83 @@ resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== +"@lerna/child-process@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-4.0.0.tgz#341b96a57dffbd9705646d316e231df6fa4df6e1" + integrity sha512-XtCnmCT9eyVsUUHx6y/CTBYdV9g2Cr/VxyseTWBgfIur92/YKClfEtJTbOh94jRT62hlKLqSvux/UhxXVh613Q== + dependencies: + chalk "^4.1.0" + execa "^5.0.0" + strong-log-transformer "^2.1.0" + +"@lerna/collect-updates@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-4.0.0.tgz#8e208b1bafd98a372ff1177f7a5e288f6bea8041" + integrity sha512-bnNGpaj4zuxsEkyaCZLka9s7nMs58uZoxrRIPJ+nrmrZYp1V5rrd+7/NYTuunOhY2ug1sTBvTAxj3NZQ+JKnOw== + dependencies: + "@lerna/child-process" "4.0.0" + "@lerna/describe-ref" "4.0.0" + minimatch "^3.0.4" + npmlog "^4.1.2" + slash "^3.0.0" + +"@lerna/describe-ref@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-4.0.0.tgz#53c53b4ea65fdceffa072a62bfebe6772c45d9ec" + integrity sha512-eTU5+xC4C5Gcgz+Ey4Qiw9nV2B4JJbMulsYJMW8QjGcGh8zudib7Sduj6urgZXUYNyhYpRs+teci9M2J8u+UvQ== + dependencies: + "@lerna/child-process" "4.0.0" + npmlog "^4.1.2" + +"@lerna/package-graph@4.0.0", "@lerna/package-graph@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-4.0.0.tgz#16a00253a8ac810f72041481cb46bcee8d8123dd" + integrity sha512-QED2ZCTkfXMKFoTGoccwUzjHtZMSf3UKX14A4/kYyBms9xfFsesCZ6SLI5YeySEgcul8iuIWfQFZqRw+Qrjraw== + dependencies: + "@lerna/prerelease-id-from-version" "4.0.0" + "@lerna/validation-error" "4.0.0" + npm-package-arg "^8.1.0" + npmlog "^4.1.2" + semver "^7.3.4" + +"@lerna/package@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@lerna/package/-/package-4.0.0.tgz#1b4c259c4bcff45c876ee1d591a043aacbc0d6b7" + integrity sha512-l0M/izok6FlyyitxiQKr+gZLVFnvxRQdNhzmQ6nRnN9dvBJWn+IxxpM+cLqGACatTnyo9LDzNTOj2Db3+s0s8Q== + dependencies: + load-json-file "^6.2.0" + npm-package-arg "^8.1.0" + write-pkg "^4.0.0" + +"@lerna/prerelease-id-from-version@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-4.0.0.tgz#c7e0676fcee1950d85630e108eddecdd5b48c916" + integrity sha512-GQqguzETdsYRxOSmdFZ6zDBXDErIETWOqomLERRY54f4p+tk4aJjoVdd9xKwehC9TBfIFvlRbL1V9uQGHh1opg== + dependencies: + semver "^7.3.4" + +"@lerna/query-graph@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-4.0.0.tgz#09dd1c819ac5ee3f38db23931143701f8a6eef63" + integrity sha512-YlP6yI3tM4WbBmL9GCmNDoeQyzcyg1e4W96y/PKMZa5GbyUvkS2+Jc2kwPD+5KcXou3wQZxSPzR3Te5OenaDdg== + dependencies: + "@lerna/package-graph" "4.0.0" + +"@lerna/run-topologically@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-4.0.0.tgz#af846eeee1a09b0c2be0d1bfb5ef0f7b04bb1827" + integrity sha512-EVZw9hGwo+5yp+VL94+NXRYisqgAlj0jWKWtAIynDCpghRxCE5GMO3xrQLmQgqkpUl9ZxQFpICgYv5DW4DksQA== + dependencies: + "@lerna/query-graph" "4.0.0" + p-queue "^6.6.2" + +"@lerna/validation-error@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@lerna/validation-error/-/validation-error-4.0.0.tgz#af9d62fe8304eaa2eb9a6ba1394f9aa807026d35" + integrity sha512-1rBOM5/koiVWlRi3V6dB863E1YzJS8v41UtsHgMr6gB2ncJ2LsQtMKlJpi3voqcgh41H8UsPXR58RrrpPpufyw== + dependencies: + npmlog "^4.1.2" + "@mdx-js/mdx@^1.6.22": version "1.6.22" resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.6.22.tgz#8a723157bf90e78f17dc0f27995398e6c731f1ba" @@ -2759,6 +2849,107 @@ mkdirp "^1.0.4" rimraf "^3.0.2" +"@octokit/auth-token@^2.4.4": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" + integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== + dependencies: + "@octokit/types" "^6.0.3" + +"@octokit/core@^3.5.1": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085" + integrity sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q== + dependencies: + "@octokit/auth-token" "^2.4.4" + "@octokit/graphql" "^4.5.8" + "@octokit/request" "^5.6.3" + "@octokit/request-error" "^2.0.5" + "@octokit/types" "^6.0.3" + before-after-hook "^2.2.0" + universal-user-agent "^6.0.0" + +"@octokit/endpoint@^6.0.1": + version "6.0.12" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658" + integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== + dependencies: + "@octokit/types" "^6.0.3" + is-plain-object "^5.0.0" + universal-user-agent "^6.0.0" + +"@octokit/graphql@^4.3.1", "@octokit/graphql@^4.5.8": + version "4.8.0" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3" + integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== + dependencies: + "@octokit/request" "^5.6.0" + "@octokit/types" "^6.0.3" + universal-user-agent "^6.0.0" + +"@octokit/openapi-types@^12.11.0": + version "12.11.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.11.0.tgz#da5638d64f2b919bca89ce6602d059f1b52d3ef0" + integrity sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ== + +"@octokit/plugin-paginate-rest@^2.16.8": + version "2.21.3" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz#7f12532797775640dbb8224da577da7dc210c87e" + integrity sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw== + dependencies: + "@octokit/types" "^6.40.0" + +"@octokit/plugin-request-log@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" + integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== + +"@octokit/plugin-rest-endpoint-methods@^5.12.0": + version "5.16.2" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz#7ee8bf586df97dd6868cf68f641354e908c25342" + integrity sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw== + dependencies: + "@octokit/types" "^6.39.0" + deprecation "^2.3.1" + +"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" + integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== + dependencies: + "@octokit/types" "^6.0.3" + deprecation "^2.0.0" + once "^1.4.0" + +"@octokit/request@^5.6.0", "@octokit/request@^5.6.3": + version "5.6.3" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0" + integrity sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A== + dependencies: + "@octokit/endpoint" "^6.0.1" + "@octokit/request-error" "^2.1.0" + "@octokit/types" "^6.16.1" + is-plain-object "^5.0.0" + node-fetch "^2.6.7" + universal-user-agent "^6.0.0" + +"@octokit/rest@^18.12.0", "@octokit/rest@^18.3.5": + version "18.12.0" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.12.0.tgz#f06bc4952fc87130308d810ca9d00e79f6988881" + integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== + dependencies: + "@octokit/core" "^3.5.1" + "@octokit/plugin-paginate-rest" "^2.16.8" + "@octokit/plugin-request-log" "^1.0.4" + "@octokit/plugin-rest-endpoint-methods" "^5.12.0" + +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.39.0", "@octokit/types@^6.40.0": + version "6.41.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04" + integrity sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg== + dependencies: + "@octokit/openapi-types" "^12.11.0" + "@pmmmwh/react-refresh-webpack-plugin@^0.5.1", "@pmmmwh/react-refresh-webpack-plugin@^0.5.3": version "0.5.7" resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.7.tgz#58f8217ba70069cc6a73f5d7e05e85b458c150e2" @@ -4710,6 +4901,11 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== +"@types/minimist@^1.2.0": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" + integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== + "@types/node-fetch@^2.5.7": version "2.6.2" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da" @@ -4738,6 +4934,11 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== +"@types/npm-package-arg@^6.1.0": + version "6.1.1" + resolved "https://registry.yarnpkg.com/@types/npm-package-arg/-/npm-package-arg-6.1.1.tgz#9e2d8adc04d39824a3d9f36f738010a3f7da3c1a" + integrity sha512-452/1Kp9IdM/oR10AyqAgZOxUt7eLbm+EMJ194L6oarMYdZNiFIFAOJ7IIr0OrZXTySgfHjJezh2oiyk2kc3ag== + "@types/npmlog@^4.1.2": version "4.1.4" resolved "https://registry.yarnpkg.com/@types/npmlog/-/npmlog-4.1.4.tgz#30eb872153c7ead3e8688c476054ddca004115f6" @@ -5420,6 +5621,11 @@ resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== +"@xmldom/xmldom@^0.8.2": + version "0.8.2" + resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.2.tgz#b695ff674e8216efa632a3d36ad51ae9843380c0" + integrity sha512-+R0juSseERyoPvnBQ/cZih6bpF7IpCXlWbHRoCRzYzqpz6gWHOgf8o4MOEf6KBVuOyqU+gCNLkCWVIJAro8XyQ== + "@xobotyi/scrollbar-width@^1.9.5": version "1.9.5" resolved "https://registry.yarnpkg.com/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.5.tgz#80224a6919272f405b87913ca13b92929bdf3c4d" @@ -5735,16 +5941,16 @@ append-transform@^2.0.0: dependencies: default-require-extensions "^3.0.0" +aproba@^1.0.3, aproba@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + "aproba@^1.0.3 || ^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== -aproba@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - archy@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" @@ -5758,6 +5964,14 @@ are-we-there-yet@^2.0.0: delegates "^1.0.0" readable-stream "^3.6.0" +are-we-there-yet@~1.1.2: + version "1.1.7" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146" + integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + arg@^4.1.0: version "4.1.3" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" @@ -5840,6 +6054,11 @@ array-flatten@^2.1.2: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== +array-ify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" + integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng== + array-includes@^3.0.3, array-includes@^3.1.4, array-includes@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.5.tgz#2c320010db8d31031fd2a5f6b3bbd4b1aad31bdb" @@ -5915,6 +6134,11 @@ array.prototype.reduce@^1.0.4: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" +arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== + arrify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" @@ -5965,6 +6189,13 @@ async-each@^1.0.1: resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== +async-retry@^1.3.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" + integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== + dependencies: + retry "0.13.1" + async@^3.2.3: version "3.2.4" resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" @@ -6343,6 +6574,11 @@ batch@0.6.1: resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" integrity sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw== +before-after-hook@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e" + integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ== + better-opn@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/better-opn/-/better-opn-2.1.1.tgz#94a55b4695dc79288f31d7d0e5f658320759f7c6" @@ -6647,6 +6883,11 @@ builtin-status-codes@^3.0.0: resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" integrity sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ== +builtins@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" + integrity sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ== + bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -6797,6 +7038,15 @@ camelcase-keys@^2.0.0: camelcase "^2.0.0" map-obj "^1.0.0" +camelcase-keys@^6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-6.2.2.tgz#5e755d6ba51aa223ec7d3d52f25778210f9dc3c0" + integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== + dependencies: + camelcase "^5.3.1" + map-obj "^4.0.0" + quick-lru "^4.0.1" + camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -7137,6 +7387,24 @@ coa@^2.0.2: chalk "^2.4.1" q "^1.1.2" +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== + +code-suggester@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/code-suggester/-/code-suggester-3.0.0.tgz#b0b04f1167099cbe0875703e422e1900f8e1242d" + integrity sha512-DoTVTaMgU1VygKF84sZ4v6qCsb4yd0wDHVJFp+BywDr1+GUCTe0b3QL+GFB4a+RcTP9HQOYDDS59lVXRGcy3SA== + dependencies: + "@octokit/rest" "^18.3.5" + "@types/yargs" "^16.0.0" + async-retry "^1.3.1" + diff "^5.0.0" + glob "^7.1.6" + parse-diff "^0.9.0" + yargs "^16.0.0" + codecov@^3.8.3: version "3.8.3" resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.8.3.tgz#9c3e364b8a700c597346ae98418d09880a3fdbe7" @@ -7277,6 +7545,14 @@ commondir@^1.0.1: resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== +compare-func@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" + integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA== + dependencies: + array-ify "^1.0.0" + dot-prop "^5.1.0" + complex.js@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/complex.js/-/complex.js-2.1.1.tgz#0675dac8e464ec431fb2ab7d30f41d889fb25c31" @@ -7354,7 +7630,7 @@ console-browserify@^1.1.0: resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== -console-control-strings@^1.0.0, console-control-strings@^1.1.0: +console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== @@ -7381,6 +7657,38 @@ content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +conventional-changelog-conventionalcommits@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-5.0.0.tgz#41bdce54eb65a848a4a3ffdca93e92fa22b64a86" + integrity sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw== + dependencies: + compare-func "^2.0.0" + lodash "^4.17.15" + q "^1.5.1" + +conventional-changelog-writer@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz#e0757072f045fe03d91da6343c843029e702f359" + integrity sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ== + dependencies: + conventional-commits-filter "^2.0.7" + dateformat "^3.0.0" + handlebars "^4.7.7" + json-stringify-safe "^5.0.1" + lodash "^4.17.15" + meow "^8.0.0" + semver "^6.0.0" + split "^1.0.0" + through2 "^4.0.0" + +conventional-commits-filter@^2.0.2, conventional-commits-filter@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz#f8d9b4f182fce00c9af7139da49365b136c8a0b3" + integrity sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA== + dependencies: + lodash.ismatch "^4.4.0" + modify-values "^1.0.0" + convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.8.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" @@ -7726,7 +8034,7 @@ css-select@^2.0.0: domutils "^1.7.0" nth-check "^1.0.2" -css-select@^4.1.3: +css-select@^4.1.3, css-select@^4.2.1: version "4.3.0" resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== @@ -8043,6 +8351,11 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" +dateformat@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" + integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== + debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -8064,7 +8377,15 @@ debug@^3.0.0, debug@^3.2.7: dependencies: ms "^2.1.1" -decamelize@^1.1.2, decamelize@^1.2.0: +decamelize-keys@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" + integrity sha512-ocLWuYzRPoS9bfiSdDd3cxvrzovVMZnRDVEzAs+hWIVXGDbHxWMECij2OBuyB/An0FFW/nLuq6Kv1i/YC5Qfzg== + dependencies: + decamelize "^1.1.0" + map-obj "^1.0.0" + +decamelize@^1.1.0, decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== @@ -8225,6 +8546,11 @@ dependency-graph@^0.11.0: resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.11.0.tgz#ac0ce7ed68a54da22165a85e97a01d53f5eb2e27" integrity sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg== +deprecation@^2.0.0, deprecation@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" + integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + des.js@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" @@ -8250,6 +8576,16 @@ detab@2.0.4: dependencies: repeat-string "^1.5.4" +detect-indent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + integrity sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g== + +detect-indent@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" + integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== + detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" @@ -8317,6 +8653,11 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +diff@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" + integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -8484,7 +8825,7 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" -dot-prop@^5.2.0: +dot-prop@^5.1.0, dot-prop@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== @@ -8511,7 +8852,7 @@ duplexer3@^0.1.4: resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" integrity sha512-CEj8FwwNA4cVH2uFCoHUrmojhYh1vmCdOaneKJXwkeY1i9jnlslVo9dx+hQ5Hl9GnH/Bwy/IjxAyOePyPKYnzA== -duplexer@^0.1.2: +duplexer@^0.1.1, duplexer@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== @@ -8794,6 +9135,18 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escodegen@^1.8.1: + version "1.14.3" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== + dependencies: + esprima "^4.0.1" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + escodegen@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" @@ -9032,6 +9385,11 @@ espree@^9.3.2, espree@^9.3.3: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" +esprima@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.2.2.tgz#76a0fd66fcfe154fd292667dc264019750b1657b" + integrity sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A== + esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" @@ -9051,7 +9409,7 @@ esrecurse@^4.1.0, esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: +estraverse@^4.1.1, estraverse@^4.2.0: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -9098,7 +9456,7 @@ eval@^0.1.8: "@types/node" "*" require-like ">= 0.1.1" -eventemitter3@^4.0.0: +eventemitter3@^4.0.0, eventemitter3@^4.0.4: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== @@ -9409,6 +9767,13 @@ figgy-pudding@^3.5.1: resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== +figures@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" + integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== + dependencies: + escape-string-regexp "^1.0.5" + file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -9788,6 +10153,20 @@ gauge@^3.0.0: strip-ansi "^6.0.1" wide-align "^1.1.2" +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg== + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -10084,6 +10463,11 @@ handlebars@^4.7.7: optionalDependencies: uglify-js "^3.1.4" +hard-rejection@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" + integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== + harmony-reflect@^1.4.6: version "1.6.2" resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.6.2.tgz#31ecbd32e648a34d030d86adb67d4d47547fe710" @@ -10137,7 +10521,7 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.2" -has-unicode@^2.0.1: +has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== @@ -10300,7 +10684,7 @@ hastscript@^6.0.0: property-information "^5.0.0" space-separated-tokens "^1.0.0" -he@^1.2.0: +he@1.2.0, he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -10353,6 +10737,13 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== +hosted-git-info@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" + integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== + dependencies: + lru-cache "^6.0.0" + hpack.js@^2.1.6: version "2.1.6" resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" @@ -10878,7 +11269,7 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.8.1, is-core-module@^2.9.0: +is-core-module@^2.5.0, is-core-module@^2.8.1, is-core-module@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== @@ -10964,6 +11355,13 @@ is-finite@^1.0.0: resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== + dependencies: + number-is-nan "^1.0.0" + is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -11070,6 +11468,11 @@ is-path-inside@^3.0.2: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== +is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== + is-plain-obj@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" @@ -11080,7 +11483,7 @@ is-plain-obj@^3.0.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== -is-plain-object@5.0.0: +is-plain-object@5.0.0, is-plain-object@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== @@ -11932,7 +12335,7 @@ js-yaml@3.14.1, js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.1.0: +js-yaml@^4.0.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== @@ -12022,6 +12425,11 @@ json-stringify-pretty-compact@^3.0.0, json-stringify-pretty-compact@~3.0.0: resolved "https://registry.yarnpkg.com/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz#f71ef9d82ef16483a407869556588e91b681d9ab" integrity sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA== +json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + json5@2.x, json5@^2.1.2, json5@^2.1.3, json5@^2.2.0, json5@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" @@ -12043,6 +12451,15 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +jsonpath@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/jsonpath/-/jsonpath-1.1.1.tgz#0ca1ed8fb65bb3309248cc9d5466d12d5b0b9901" + integrity sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w== + dependencies: + esprima "1.2.2" + static-eval "2.0.2" + underscore "1.12.1" + jsonpointer@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.0.tgz#f802669a524ec4805fa7389eadbc9921d5dc8072" @@ -12099,7 +12516,7 @@ kind-of@^5.0.0: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== -kind-of@^6.0.0, kind-of@^6.0.2: +kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -12193,6 +12610,16 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" +load-json-file@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-6.2.0.tgz#5c7770b42cafa97074ca2848707c61662f4251a1" + integrity sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ== + dependencies: + graceful-fs "^4.1.15" + parse-json "^5.0.0" + strip-bom "^4.0.0" + type-fest "^0.6.0" + loader-runner@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" @@ -12291,6 +12718,11 @@ lodash.isequal@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== +lodash.ismatch@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" + integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g== + lodash.memoize@4.x, lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -12426,6 +12858,11 @@ map-obj@^1.0.0, map-obj@^1.0.1: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== +map-obj@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" + integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== + map-or-similar@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/map-or-similar/-/map-or-similar-1.5.0.tgz#6de2653174adfb5d9edc33c69d3e92a1b76faf08" @@ -12590,6 +13027,23 @@ meow@^3.1.0: redent "^1.0.0" trim-newlines "^1.0.0" +meow@^8.0.0: + version "8.1.2" + resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" + integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== + dependencies: + "@types/minimist" "^1.2.0" + camelcase-keys "^6.2.2" + decamelize-keys "^1.1.0" + hard-rejection "^2.1.0" + minimist-options "4.1.0" + normalize-package-data "^3.0.0" + read-pkg-up "^7.0.1" + redent "^3.0.0" + trim-newlines "^3.0.0" + type-fest "^0.18.0" + yargs-parser "^20.2.3" + merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" @@ -12757,6 +13211,15 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" +minimist-options@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" + integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== + dependencies: + arrify "^1.0.1" + is-plain-obj "^1.1.0" + kind-of "^6.0.3" + minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" @@ -12834,6 +13297,11 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +modify-values@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" + integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== + moduleserve@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/moduleserve/-/moduleserve-0.9.1.tgz#11bad4337ea248d7eaf10d2c7f8649a8c3b9c1f8" @@ -12997,6 +13465,14 @@ node-forge@^1: resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== +node-html-parser@^5.0.0: + version "5.3.3" + resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-5.3.3.tgz#2845704f3a7331a610e0e551bf5fa02b266341b6" + integrity sha512-ncg1033CaX9UexbyA7e1N0aAoAYRDiV8jkTvzEnfd1GDvzFdrsXLzR4p4ik8mwLgnaKP/jyUFWDy9q3jvRT2Jw== + dependencies: + css-select "^4.2.1" + he "1.2.0" + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -13053,6 +13529,16 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package- semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" +normalize-package-data@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" + integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== + dependencies: + hosted-git-info "^4.0.1" + is-core-module "^2.5.0" + semver "^7.3.4" + validate-npm-package-license "^3.0.1" + normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -13080,6 +13566,15 @@ normalize-url@^6.0.1: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== +npm-package-arg@^8.1.0: + version "8.1.5" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.5.tgz#3369b2d5fe8fdc674baa7f1786514ddc15466e44" + integrity sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q== + dependencies: + hosted-git-info "^4.0.1" + semver "^7.3.4" + validate-npm-package-name "^3.0.0" + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -13094,6 +13589,16 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" +npmlog@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + npmlog@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-5.0.1.tgz#f06678e80e29419ad67ab964e0fa69959c1eb8b0" @@ -13128,6 +13633,11 @@ num2fraction@^1.2.2: resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" integrity sha512-Y1wZESM7VUThYY+4W+X4ySH2maqcA+p7UR+w8VWNWVAd6lwuXXWz/w/Cz43J/dI2I+PS6wD5N+bJUF+gjWvIqg== +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== + nwsapi@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" @@ -13485,6 +13995,14 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" +p-queue@^6.6.2: + version "6.6.2" + resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" + integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== + dependencies: + eventemitter3 "^4.0.4" + p-timeout "^3.2.0" + p-retry@^4.5.0: version "4.6.2" resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.6.2.tgz#9baae7184057edd4e17231cee04264106e092a16" @@ -13493,7 +14011,7 @@ p-retry@^4.5.0: "@types/retry" "0.12.0" retry "^0.13.1" -p-timeout@^3.1.0: +p-timeout@^3.1.0, p-timeout@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== @@ -13575,6 +14093,11 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" +parse-diff@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/parse-diff/-/parse-diff-0.9.0.tgz#2e71b5dc5d8f4b9c19c471fd6325646dc9f21724" + integrity sha512-Jn+VZORAezkfOXR6B40EZcXxdJBamtgBpfeoFH6hxD+p0e74nVaCL9SWlQj1ggc8b6AexgPKlDiiE0CMMZDSbQ== + parse-entities@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" @@ -13587,6 +14110,11 @@ parse-entities@^2.0.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" +parse-github-repo-url@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" + integrity sha512-bSWyzBKqcSL4RrncTpGsEKoJ7H8a4L3++ifTAbTFeMHyq2wRV+42DGmQcHIrJIvdcacjIOxEuKH/w4tthF17gg== + parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" @@ -14833,7 +15361,7 @@ pure-rand@^5.0.1: resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-5.0.1.tgz#97a287b4b4960b2a3448c0932bf28f2405cac51d" integrity sha512-ksWccjmXOHU2gJBnH0cK1lSYdvSZ0zLoCMSz/nTGh6hDvCSgcRxDyIcOBD6KNxFz3xhMPm/T267Tbe2JRymKEQ== -q@^1.1.2: +q@^1.1.2, q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== @@ -14879,6 +15407,11 @@ queue@6.0.2: dependencies: inherits "~2.0.3" +quick-lru@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" + integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== + quick-lru@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" @@ -15335,7 +15868,7 @@ read@^1.0.7: dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -15348,7 +15881,7 @@ read@^1.0.7: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.0.6, readable-stream@^3.6.0: +readable-stream@3, readable-stream@^3.0.6, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -15560,6 +16093,43 @@ relateurl@^0.2.7: resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog== +release-please@^13.19.6: + version "13.19.6" + resolved "https://registry.yarnpkg.com/release-please/-/release-please-13.19.6.tgz#e6e8b111f88d3f5f8796e0962a095094e445943e" + integrity sha512-HcqxhwwyIqCBQ9wVmbLPPq1Q/MG2FDZIRH+5HCiD2ZI9zSOi+C723gY0RY60/afF+R7zxb1k+jZwyHbtCwdG7w== + dependencies: + "@conventional-commits/parser" "^0.4.1" + "@iarna/toml" "^2.2.5" + "@lerna/collect-updates" "^4.0.0" + "@lerna/package" "^4.0.0" + "@lerna/package-graph" "^4.0.0" + "@lerna/run-topologically" "^4.0.0" + "@octokit/graphql" "^4.3.1" + "@octokit/request" "^5.6.0" + "@octokit/request-error" "^2.1.0" + "@octokit/rest" "^18.12.0" + "@types/npm-package-arg" "^6.1.0" + "@xmldom/xmldom" "^0.8.2" + chalk "^4.0.0" + code-suggester "^3.0.0" + conventional-changelog-conventionalcommits "^5.0.0" + conventional-changelog-writer "^5.0.0" + conventional-commits-filter "^2.0.2" + detect-indent "^6.1.0" + diff "^5.0.0" + figures "^3.0.0" + js-yaml "^4.0.0" + jsonpath "^1.1.1" + node-html-parser "^5.0.0" + parse-github-repo-url "^1.4.1" + semver "^7.0.0" + type-fest "^2.0.0" + typescript "^4.6.4" + unist-util-visit "^2.0.3" + unist-util-visit-parents "^3.1.1" + xpath "^0.0.32" + yargs "^17.0.0" + release-zalgo@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" @@ -15808,7 +16378,7 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -retry@^0.13.1: +retry@0.13.1, retry@^0.13.1: version "0.13.1" resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== @@ -16082,7 +16652,7 @@ semver@7.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@7.x, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: +semver@7.x, semver@^7.0.0, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: version "7.3.7" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== @@ -16201,7 +16771,7 @@ serve-static@1.15.0, serve-static@^1.14.1: parseurl "~1.3.3" send "0.18.0" -set-blocking@^2.0.0: +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== @@ -16391,6 +16961,13 @@ sort-css-media-queries@2.0.4: resolved "https://registry.yarnpkg.com/sort-css-media-queries/-/sort-css-media-queries-2.0.4.tgz#b2badfa519cb4a938acbc6d3aaa913d4949dc908" integrity sha512-PAIsEK/XupCQwitjv7XxoMvYhT7EAfyzI3hsy/MyDgTvc+Ft55ctdkctJLOy6cQejaIC+zjpUL4djFVm2ivOOw== +sort-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + integrity sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg== + dependencies: + is-plain-obj "^1.0.0" + source-list-map@^2.0.0, source-list-map@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" @@ -16552,6 +17129,13 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" +split@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" + integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== + dependencies: + through "2" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -16617,6 +17201,13 @@ state-toggle@^1.0.0: resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.3.tgz#e123b16a88e143139b09c6852221bc9815917dfe" integrity sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ== +static-eval@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.2.tgz#2d1759306b1befa688938454c546b7871f806a42" + integrity sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg== + dependencies: + escodegen "^1.8.1" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -16705,6 +17296,15 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -16878,6 +17478,15 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== +strong-log-transformer@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz#0f5ed78d325e0421ac6f90f7f10e691d6ae3ae10" + integrity sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA== + dependencies: + duplexer "^0.1.1" + minimist "^1.2.0" + through "^2.3.4" + stubs@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" @@ -17223,6 +17832,18 @@ through2@^2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" +through2@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" + integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== + dependencies: + readable-stream "3" + +through@2, through@^2.3.4: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + thunky@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" @@ -17374,6 +17995,11 @@ trim-newlines@^1.0.0: resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" integrity sha512-Nm4cF79FhSTzrLKGDMi3I4utBtFv8qKy4sq1enftf2gMdpqI8oVQTAfySkTz5r49giVzDj88SVZXP4CeYQwjaw== +trim-newlines@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" + integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== + trim-trailing-lines@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.4.tgz#bd4abbec7cc880462f10b2c8b5ce1d8d1ec7c2c0" @@ -17531,6 +18157,11 @@ type-fest@^0.16.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.16.0.tgz#3240b891a78b0deae910dbeb86553e552a148860" integrity sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg== +type-fest@^0.18.0: + version "0.18.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" + integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== + type-fest@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" @@ -17541,6 +18172,11 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== +type-fest@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.4.1.tgz#8bdf77743385d8a4f13ba95f610f5ccd68c728f8" + integrity sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw== + type-fest@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" @@ -17551,6 +18187,11 @@ type-fest@^0.8.0, type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== +type-fest@^2.0.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.18.0.tgz#fdef3a74e0a9e68ebe46054836650fb91ac3881e" + integrity sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw== + type-fest@^2.5.0: version "2.13.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.13.1.tgz#621c84220df0e01a8469002594fc005714f0cfba" @@ -17589,7 +18230,7 @@ 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: +typescript@^4.6.4, typescript@^4.7.4: version "4.7.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== @@ -17619,6 +18260,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +underscore@1.12.1: + version "1.12.1" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.12.1.tgz#7bb8cc9b3d397e201cf8553336d262544ead829e" + integrity sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw== + underscore@1.8.3: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" @@ -17763,7 +18409,7 @@ unist-util-stringify-position@^2.0.0: dependencies: "@types/unist" "^2.0.2" -unist-util-visit-parents@^3.0.0: +unist-util-visit-parents@^3.0.0, unist-util-visit-parents@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== @@ -17780,6 +18426,11 @@ unist-util-visit@2.0.3, unist-util-visit@^2.0.0, unist-util-visit@^2.0.3: unist-util-is "^4.0.0" unist-util-visit-parents "^3.0.0" +universal-user-agent@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" + integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== + universalify@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -18021,6 +18672,13 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +validate-npm-package-name@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" + integrity sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw== + dependencies: + builtins "^1.0.3" + value-equal@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c" @@ -18921,7 +19579,7 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wide-align@^1.1.2: +wide-align@^1.1.0, wide-align@^1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== @@ -19172,6 +19830,15 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +write-file-atomic@^2.4.2: + version "2.4.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" + integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + write-file-atomic@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" @@ -19182,6 +19849,27 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" +write-json-file@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-3.2.0.tgz#65bbdc9ecd8a1458e15952770ccbadfcff5fe62a" + integrity sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ== + dependencies: + detect-indent "^5.0.0" + graceful-fs "^4.1.15" + make-dir "^2.1.0" + pify "^4.0.1" + sort-keys "^2.0.0" + write-file-atomic "^2.4.2" + +write-pkg@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-4.0.0.tgz#675cc04ef6c11faacbbc7771b24c0abbf2a20039" + integrity sha512-v2UQ+50TNf2rNHJ8NyWttfm/EJUBWMJcx6ZTYZr6Qp52uuegWw/lBkCtCbnYZEmPRNL61m+u67dAmGxo+HTULA== + dependencies: + sort-keys "^2.0.0" + type-fest "^0.4.1" + write-json-file "^3.2.0" + ws@^7.3.1, ws@^7.4.6: version "7.5.8" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.8.tgz#ac2729881ab9e7cbaf8787fe3469a48c5c7f636a" @@ -19221,6 +19909,11 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== +xpath@^0.0.32: + version "0.0.32" + resolved "https://registry.yarnpkg.com/xpath/-/xpath-0.0.32.tgz#1b73d3351af736e17ec078d6da4b8175405c48af" + integrity sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw== + xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" @@ -19256,7 +19949,7 @@ yaml@^2.1.1: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.1.1.tgz#1e06fb4ca46e60d9da07e4f786ea370ed3c3cfec" integrity sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw== -yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.9: +yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== @@ -19291,7 +19984,7 @@ yargs@^15.0.2: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.2.0: +yargs@^16.0.0, yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== From 29144335c1a8fac432ff6106c6e9656d05fd6aff Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 12:59:43 -0400 Subject: [PATCH 166/203] init release please (rm npm publishing) --- .github/workflows/release-please.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index abdd0510..ec8b1943 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -12,17 +12,5 @@ jobs: - uses: google-github-actions/release-please-action@v2 id: release with: - command: manifest token: ${{secrets.GITHUB_TOKEN}} default-branch: develop - - # The logic below handles the npm publication: - - name: Checkout Repository - if: ${{ steps.release.outputs.releases_created }} - uses: actions/checkout@v2 - - name: Setup Node - uses: actions/setup-node@v1 - if: ${{ steps.release.outputs.releases_created }} - with: - node-version: 16 - registry-url: 'https://registry.yarnpkg.com/' From 2abe92cf427546d32828941ec1992747f9981014 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 13:13:29 -0400 Subject: [PATCH 167/203] added json updater to `.release-please-manifest.json` --- .release-please-manifest.json | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0967ef42..79c05f8e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1,29 @@ -{} +{ + "extra-files": [ + { + "type": "json", + "path": "packages/squiggle-lang/package.json", + "jsonpath": "$.json.version" + }, + { + "type": "json", + "path": "packages/components/package.json", + "jsonpath": "$.json.version" + }, + { + "type": "json", + "path": "packages/vscode-ext/package.json", + "jsonpath": "$.json.version" + }, + { + "type": "json", + "path": "packages/website/package.json", + "jsonpath": "$.json.version" + }, + { + "type": "json", + "path": "packages/cli/package.json", + "jsonpath": "$.json.version" + } + ] +} From 155f03dc094331d4e7a73f748b9b829982db524c Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 13:41:13 -0400 Subject: [PATCH 168/203] fixed `release-please.yml` --- .github/workflows/release-please.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index ec8b1943..9a3df9a8 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -13,4 +13,4 @@ jobs: id: release with: token: ${{secrets.GITHUB_TOKEN}} - default-branch: develop + command: manifest From b1cbce1aaacc9cbc2914ce388c01bc072b2fd8e0 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 13:46:28 -0400 Subject: [PATCH 170/203] perhaps a proper `.release-please-manifest.json` now --- .release-please-manifest.json | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 79c05f8e..0967ef42 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,29 +1 @@ -{ - "extra-files": [ - { - "type": "json", - "path": "packages/squiggle-lang/package.json", - "jsonpath": "$.json.version" - }, - { - "type": "json", - "path": "packages/components/package.json", - "jsonpath": "$.json.version" - }, - { - "type": "json", - "path": "packages/vscode-ext/package.json", - "jsonpath": "$.json.version" - }, - { - "type": "json", - "path": "packages/website/package.json", - "jsonpath": "$.json.version" - }, - { - "type": "json", - "path": "packages/cli/package.json", - "jsonpath": "$.json.version" - } - ] -} +{} From ae9e99fab84f74e632e97f75dd25cb43c454f715 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 13:59:04 -0400 Subject: [PATCH 171/203] fix: (for triggering releaes-please) should_skip_action material is now written in `release-please.yml` --- .github/workflows/release-please.yml | 96 ++++++++++++++++++++++++++-- release-please-config.json | 2 +- 2 files changed, 93 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 9a3df9a8..cb54fff5 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -6,11 +6,99 @@ on: - develop jobs: - release-please: + pre_check: + name: Precheck for skipping redundant jobs runs-on: ubuntu-latest + outputs: + should_skip_lang: ${{ steps.skip_lang_check.outputs.should_skip }} + should_skip_components: ${{ steps.skip_components_check.outputs.should_skip }} + should_skip_website: ${{ steps.skip_website_check.outputs.should_skip }} + should_skip_vscodeext: ${{ steps.skip_vscodeext_check.outputs.should_skip }} + should_skip_cli: ${{ steps.skip_cli_check.outputs.should_skip }} steps: - - uses: google-github-actions/release-please-action@v2 - id: release + - id: skip_lang_check + name: Check if the changes are about squiggle-lang src files + uses: fkirc/skip-duplicate-actions@v3.4.1 + with: + paths: '["packages/squiggle-lang/**"]' + - id: skip_components_check + name: Check if the changes are about components src files + uses: fkirc/skip-duplicate-actions@v3.4.1 + with: + paths: '["packages/components/**"]' + - id: skip_website_check + name: Check if the changes are about website src files + uses: fkirc/skip-duplicate-actions@v3.4.1 + with: + paths: '["packages/website/**"]' + - id: skip_vscodeext_check + name: Check if the changes are about vscode extension src files + uses: fkirc/skip-duplicate-actions@v3.4.1 + with: + paths: '["packages/vscode-ext/**"]' + - id: skip_cli_check + name: Check if the changes are about cli src files + uses: fkirc/skip-duplicate-actions@v3.4.1 + with: + paths: '["packages/cli/**"]' + + relplz-lang: + name: for squiggle-lang + runs-on: ubuntu-latest + needs: pre_check + if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} + steps: + - name: Action (squiggle-lang) + uses: google-github-actions/release-please-action@v2 with: token: ${{secrets.GITHUB_TOKEN}} - command: manifest + command: manifest-pr + path: packages/squiggle-lang + relplz-components: + name: for components + runs-on: ubuntu-latest + needs: pre_check + if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }} + steps: + - name: Action (components) + uses: google-github-actions/release-please-action@v2 + with: + token: ${{secrets.GITHUB_TOKEN}} + command: manifest-pr + path: packages/components + relplz-website: + name: for website + runs-on: ubuntu-latest + needs: pre_check + if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }} + steps: + - name: Action (website) + uses: google-github-actions/release-please-action@v2 + with: + token: ${{secrets.GITHUB_TOKEN}} + command: manifest-pr + path: packages/website + relplz-vscodeext: + name: for vscode-ext + runs-on: ubuntu-latest + needs: pre_check + if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }} + steps: + - name: Action (vscode-ext) + uses: google-github-actions/release-please-action@v2 + with: + token: ${{secrets.GITHUB_TOKEN}} + command: manifest-pr + path: packages/vscode-ext + relplz-cl: + name: for cli + runs-on: ubuntu-latest + needs: pre_check + if: ${{ needs.pre_check.outputs.should_skip_cli != 'true' }} + steps: + - name: Action (cli) + uses: google-github-actions/release-please-action@v2 + with: + token: ${{secrets.GITHUB_TOKEN}} + command: manifest-pr + path: packages/cli diff --git a/release-please-config.json b/release-please-config.json index 1d97b366..2e7cf7db 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,5 +1,5 @@ { - "bootstrap-sha": "6a2584d800a4274da4ef3d792067e9cb83ea775b", + "bootstrap-sha": "b1cbce1aaacc9cbc2914ce388c01bc072b2fd8e0", "bump-patch-for-minor-pre-major": true, "release-type": "node", "packages": { From 7ea95225b2fa3bd638b75a23bfd2d55ea1b7d595 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 14:06:29 -0400 Subject: [PATCH 172/203] fix: added NextJS starter to `Integrations.md` --- packages/website/docs/Integrations.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/website/docs/Integrations.md b/packages/website/docs/Integrations.md index c2aa16e7..d10a7e9a 100644 --- a/packages/website/docs/Integrations.md +++ b/packages/website/docs/Integrations.md @@ -32,3 +32,7 @@ This extention allows you to run and visualize Squiggle code. ## [Observable Library](https://observablehq.com/@hazelfire/squiggle) An exportable [Observable Notebook](https://observablehq.com/@hazelfire/squiggle) of the key components that you can directly import and use in Observable notebooks. + +## [NextJS starter](https://github.com/quantified-uncertainty/next-app-with-squiggle) + +A template for presenting estimates on a nextjs site. From fd411c49b9013ba215ed305ae6ed66850592433b Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 14:18:21 -0400 Subject: [PATCH 173/203] fix: so the PR it opens is proper this time --- .github/workflows/release-please.yml | 15 ++++++++++----- .release-please-manifest.json | 8 +++++++- packages/website/package.json | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index cb54fff5..6d74d55d 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -48,57 +48,62 @@ jobs: needs: pre_check if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} steps: - - name: Action (squiggle-lang) + - name: Release please (squiggle-lang) uses: google-github-actions/release-please-action@v2 with: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr path: packages/squiggle-lang + bump-patch-for-minor-pre-major: true relplz-components: name: for components runs-on: ubuntu-latest needs: pre_check if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }} steps: - - name: Action (components) + - name: Release please (components) uses: google-github-actions/release-please-action@v2 with: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr path: packages/components + bump-patch-for-minor-pre-major: true relplz-website: name: for website runs-on: ubuntu-latest needs: pre_check if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }} steps: - - name: Action (website) + - name: Release please (website) uses: google-github-actions/release-please-action@v2 with: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr path: packages/website + bump-patch-for-minor-pre-major: true relplz-vscodeext: name: for vscode-ext runs-on: ubuntu-latest needs: pre_check if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }} steps: - - name: Action (vscode-ext) + - name: Release please (vscode-ext) uses: google-github-actions/release-please-action@v2 with: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr path: packages/vscode-ext + bump-patch-for-minor-pre-major: true relplz-cl: name: for cli runs-on: ubuntu-latest needs: pre_check if: ${{ needs.pre_check.outputs.should_skip_cli != 'true' }} steps: - - name: Action (cli) + - name: Release please (cli) uses: google-github-actions/release-please-action@v2 with: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr path: packages/cli + bump-patch-for-minor-pre-major: true diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0967ef42..1bdb33d0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1,7 @@ -{} +{ + "packages/squiggle-lang": "0.2.11", + "packages/website": "0.2.0", + "packages/components": "0.2.24", + "packages/vscode-ext": "0.3.1", + "packages/cli": "0.0.3" +} diff --git a/packages/website/package.json b/packages/website/package.json index ddb162b6..e2ceb9aa 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "squiggle-website", - "version": "0.0.0", + "version": "0.2.0", "private": true, "license": "MIT", "scripts": { From c366476cf7905c946d603bfc470b93fd3deab8c5 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 14:40:01 -0400 Subject: [PATCH 174/203] removed release-please from devDependencies; added skip-github-release to release-please.yml --- .github/workflows/release-please.yml | 31 ++ package.json | 3 +- yarn.lock | 753 ++------------------------- 3 files changed, 62 insertions(+), 725 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6d74d55d..27cc95d6 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -50,11 +50,26 @@ jobs: steps: - name: Release please (squiggle-lang) uses: google-github-actions/release-please-action@v2 + id: release with: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr 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 }} relplz-components: name: for components runs-on: ubuntu-latest @@ -68,6 +83,19 @@ jobs: command: manifest-pr 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}} relplz-website: name: for website runs-on: ubuntu-latest @@ -81,6 +109,7 @@ jobs: command: manifest-pr path: packages/website bump-patch-for-minor-pre-major: true + skip-github-release: true relplz-vscodeext: name: for vscode-ext runs-on: ubuntu-latest @@ -94,6 +123,7 @@ jobs: command: manifest-pr path: packages/vscode-ext bump-patch-for-minor-pre-major: true + skip-github-release: true relplz-cl: name: for cli runs-on: ubuntu-latest @@ -107,3 +137,4 @@ jobs: command: manifest-pr path: packages/cli bump-patch-for-minor-pre-major: true + skip-github-release: true diff --git a/package.json b/package.json index eff2b0f1..dcab983e 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,7 @@ "lint:all": "prettier --check . && cd packages/squiggle-lang && yarn lint:rescript" }, "devDependencies": { - "prettier": "^2.7.1", - "release-please": "^13.19.6" + "prettier": "^2.7.1" }, "workspaces": [ "packages/*" diff --git a/yarn.lock b/yarn.lock index bb24de81..e866737c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1642,14 +1642,6 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== -"@conventional-commits/parser@^0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@conventional-commits/parser/-/parser-0.4.1.tgz#213717b25b7ff85260d295466c282226ffe094f2" - integrity sha512-H2ZmUVt6q+KBccXfMBhbBF14NlANeqHTXL4qCL6QGbMzrc4HDXyzWuxPxPNbz71f/5UkR5DrycP5VO9u7crahg== - dependencies: - unist-util-visit "^2.0.3" - unist-util-visit-parents "^3.1.1" - "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -2284,11 +2276,6 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== -"@iarna/toml@^2.2.5": - version "2.2.5" - resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c" - integrity sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg== - "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -2634,83 +2621,6 @@ resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== -"@lerna/child-process@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-4.0.0.tgz#341b96a57dffbd9705646d316e231df6fa4df6e1" - integrity sha512-XtCnmCT9eyVsUUHx6y/CTBYdV9g2Cr/VxyseTWBgfIur92/YKClfEtJTbOh94jRT62hlKLqSvux/UhxXVh613Q== - dependencies: - chalk "^4.1.0" - execa "^5.0.0" - strong-log-transformer "^2.1.0" - -"@lerna/collect-updates@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-4.0.0.tgz#8e208b1bafd98a372ff1177f7a5e288f6bea8041" - integrity sha512-bnNGpaj4zuxsEkyaCZLka9s7nMs58uZoxrRIPJ+nrmrZYp1V5rrd+7/NYTuunOhY2ug1sTBvTAxj3NZQ+JKnOw== - dependencies: - "@lerna/child-process" "4.0.0" - "@lerna/describe-ref" "4.0.0" - minimatch "^3.0.4" - npmlog "^4.1.2" - slash "^3.0.0" - -"@lerna/describe-ref@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-4.0.0.tgz#53c53b4ea65fdceffa072a62bfebe6772c45d9ec" - integrity sha512-eTU5+xC4C5Gcgz+Ey4Qiw9nV2B4JJbMulsYJMW8QjGcGh8zudib7Sduj6urgZXUYNyhYpRs+teci9M2J8u+UvQ== - dependencies: - "@lerna/child-process" "4.0.0" - npmlog "^4.1.2" - -"@lerna/package-graph@4.0.0", "@lerna/package-graph@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-4.0.0.tgz#16a00253a8ac810f72041481cb46bcee8d8123dd" - integrity sha512-QED2ZCTkfXMKFoTGoccwUzjHtZMSf3UKX14A4/kYyBms9xfFsesCZ6SLI5YeySEgcul8iuIWfQFZqRw+Qrjraw== - dependencies: - "@lerna/prerelease-id-from-version" "4.0.0" - "@lerna/validation-error" "4.0.0" - npm-package-arg "^8.1.0" - npmlog "^4.1.2" - semver "^7.3.4" - -"@lerna/package@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/package/-/package-4.0.0.tgz#1b4c259c4bcff45c876ee1d591a043aacbc0d6b7" - integrity sha512-l0M/izok6FlyyitxiQKr+gZLVFnvxRQdNhzmQ6nRnN9dvBJWn+IxxpM+cLqGACatTnyo9LDzNTOj2Db3+s0s8Q== - dependencies: - load-json-file "^6.2.0" - npm-package-arg "^8.1.0" - write-pkg "^4.0.0" - -"@lerna/prerelease-id-from-version@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-4.0.0.tgz#c7e0676fcee1950d85630e108eddecdd5b48c916" - integrity sha512-GQqguzETdsYRxOSmdFZ6zDBXDErIETWOqomLERRY54f4p+tk4aJjoVdd9xKwehC9TBfIFvlRbL1V9uQGHh1opg== - dependencies: - semver "^7.3.4" - -"@lerna/query-graph@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-4.0.0.tgz#09dd1c819ac5ee3f38db23931143701f8a6eef63" - integrity sha512-YlP6yI3tM4WbBmL9GCmNDoeQyzcyg1e4W96y/PKMZa5GbyUvkS2+Jc2kwPD+5KcXou3wQZxSPzR3Te5OenaDdg== - dependencies: - "@lerna/package-graph" "4.0.0" - -"@lerna/run-topologically@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-4.0.0.tgz#af846eeee1a09b0c2be0d1bfb5ef0f7b04bb1827" - integrity sha512-EVZw9hGwo+5yp+VL94+NXRYisqgAlj0jWKWtAIynDCpghRxCE5GMO3xrQLmQgqkpUl9ZxQFpICgYv5DW4DksQA== - dependencies: - "@lerna/query-graph" "4.0.0" - p-queue "^6.6.2" - -"@lerna/validation-error@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@lerna/validation-error/-/validation-error-4.0.0.tgz#af9d62fe8304eaa2eb9a6ba1394f9aa807026d35" - integrity sha512-1rBOM5/koiVWlRi3V6dB863E1YzJS8v41UtsHgMr6gB2ncJ2LsQtMKlJpi3voqcgh41H8UsPXR58RrrpPpufyw== - dependencies: - npmlog "^4.1.2" - "@mdx-js/mdx@^1.6.22": version "1.6.22" resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.6.22.tgz#8a723157bf90e78f17dc0f27995398e6c731f1ba" @@ -2849,107 +2759,6 @@ mkdirp "^1.0.4" rimraf "^3.0.2" -"@octokit/auth-token@^2.4.4": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" - integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== - dependencies: - "@octokit/types" "^6.0.3" - -"@octokit/core@^3.5.1": - version "3.6.0" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085" - integrity sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q== - dependencies: - "@octokit/auth-token" "^2.4.4" - "@octokit/graphql" "^4.5.8" - "@octokit/request" "^5.6.3" - "@octokit/request-error" "^2.0.5" - "@octokit/types" "^6.0.3" - before-after-hook "^2.2.0" - universal-user-agent "^6.0.0" - -"@octokit/endpoint@^6.0.1": - version "6.0.12" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658" - integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== - dependencies: - "@octokit/types" "^6.0.3" - is-plain-object "^5.0.0" - universal-user-agent "^6.0.0" - -"@octokit/graphql@^4.3.1", "@octokit/graphql@^4.5.8": - version "4.8.0" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3" - integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== - dependencies: - "@octokit/request" "^5.6.0" - "@octokit/types" "^6.0.3" - universal-user-agent "^6.0.0" - -"@octokit/openapi-types@^12.11.0": - version "12.11.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.11.0.tgz#da5638d64f2b919bca89ce6602d059f1b52d3ef0" - integrity sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ== - -"@octokit/plugin-paginate-rest@^2.16.8": - version "2.21.3" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz#7f12532797775640dbb8224da577da7dc210c87e" - integrity sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw== - dependencies: - "@octokit/types" "^6.40.0" - -"@octokit/plugin-request-log@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" - integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== - -"@octokit/plugin-rest-endpoint-methods@^5.12.0": - version "5.16.2" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz#7ee8bf586df97dd6868cf68f641354e908c25342" - integrity sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw== - dependencies: - "@octokit/types" "^6.39.0" - deprecation "^2.3.1" - -"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" - integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== - dependencies: - "@octokit/types" "^6.0.3" - deprecation "^2.0.0" - once "^1.4.0" - -"@octokit/request@^5.6.0", "@octokit/request@^5.6.3": - version "5.6.3" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0" - integrity sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A== - dependencies: - "@octokit/endpoint" "^6.0.1" - "@octokit/request-error" "^2.1.0" - "@octokit/types" "^6.16.1" - is-plain-object "^5.0.0" - node-fetch "^2.6.7" - universal-user-agent "^6.0.0" - -"@octokit/rest@^18.12.0", "@octokit/rest@^18.3.5": - version "18.12.0" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.12.0.tgz#f06bc4952fc87130308d810ca9d00e79f6988881" - integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== - dependencies: - "@octokit/core" "^3.5.1" - "@octokit/plugin-paginate-rest" "^2.16.8" - "@octokit/plugin-request-log" "^1.0.4" - "@octokit/plugin-rest-endpoint-methods" "^5.12.0" - -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.39.0", "@octokit/types@^6.40.0": - version "6.41.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04" - integrity sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg== - dependencies: - "@octokit/openapi-types" "^12.11.0" - "@pmmmwh/react-refresh-webpack-plugin@^0.5.1", "@pmmmwh/react-refresh-webpack-plugin@^0.5.3": version "0.5.7" resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.7.tgz#58f8217ba70069cc6a73f5d7e05e85b458c150e2" @@ -4901,11 +4710,6 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== -"@types/minimist@^1.2.0": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" - integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== - "@types/node-fetch@^2.5.7": version "2.6.2" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da" @@ -4934,11 +4738,6 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== -"@types/npm-package-arg@^6.1.0": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@types/npm-package-arg/-/npm-package-arg-6.1.1.tgz#9e2d8adc04d39824a3d9f36f738010a3f7da3c1a" - integrity sha512-452/1Kp9IdM/oR10AyqAgZOxUt7eLbm+EMJ194L6oarMYdZNiFIFAOJ7IIr0OrZXTySgfHjJezh2oiyk2kc3ag== - "@types/npmlog@^4.1.2": version "4.1.4" resolved "https://registry.yarnpkg.com/@types/npmlog/-/npmlog-4.1.4.tgz#30eb872153c7ead3e8688c476054ddca004115f6" @@ -5621,11 +5420,6 @@ resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== -"@xmldom/xmldom@^0.8.2": - version "0.8.2" - resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.2.tgz#b695ff674e8216efa632a3d36ad51ae9843380c0" - integrity sha512-+R0juSseERyoPvnBQ/cZih6bpF7IpCXlWbHRoCRzYzqpz6gWHOgf8o4MOEf6KBVuOyqU+gCNLkCWVIJAro8XyQ== - "@xobotyi/scrollbar-width@^1.9.5": version "1.9.5" resolved "https://registry.yarnpkg.com/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.5.tgz#80224a6919272f405b87913ca13b92929bdf3c4d" @@ -5941,16 +5735,16 @@ append-transform@^2.0.0: dependencies: default-require-extensions "^3.0.0" -aproba@^1.0.3, aproba@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - "aproba@^1.0.3 || ^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== +aproba@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + archy@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" @@ -5964,14 +5758,6 @@ are-we-there-yet@^2.0.0: delegates "^1.0.0" readable-stream "^3.6.0" -are-we-there-yet@~1.1.2: - version "1.1.7" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146" - integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - arg@^4.1.0: version "4.1.3" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" @@ -6054,11 +5840,6 @@ array-flatten@^2.1.2: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== -array-ify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" - integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng== - array-includes@^3.0.3, array-includes@^3.1.4, array-includes@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.5.tgz#2c320010db8d31031fd2a5f6b3bbd4b1aad31bdb" @@ -6134,11 +5915,6 @@ array.prototype.reduce@^1.0.4: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== - arrify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" @@ -6189,13 +5965,6 @@ async-each@^1.0.1: resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== -async-retry@^1.3.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" - integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== - dependencies: - retry "0.13.1" - async@^3.2.3: version "3.2.4" resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" @@ -6574,11 +6343,6 @@ batch@0.6.1: resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" integrity sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw== -before-after-hook@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e" - integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ== - better-opn@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/better-opn/-/better-opn-2.1.1.tgz#94a55b4695dc79288f31d7d0e5f658320759f7c6" @@ -6883,11 +6647,6 @@ builtin-status-codes@^3.0.0: resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" integrity sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ== -builtins@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" - integrity sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ== - bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -7038,15 +6797,6 @@ camelcase-keys@^2.0.0: camelcase "^2.0.0" map-obj "^1.0.0" -camelcase-keys@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-6.2.2.tgz#5e755d6ba51aa223ec7d3d52f25778210f9dc3c0" - integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== - dependencies: - camelcase "^5.3.1" - map-obj "^4.0.0" - quick-lru "^4.0.1" - camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -7387,24 +7137,6 @@ coa@^2.0.2: chalk "^2.4.1" q "^1.1.2" -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== - -code-suggester@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/code-suggester/-/code-suggester-3.0.0.tgz#b0b04f1167099cbe0875703e422e1900f8e1242d" - integrity sha512-DoTVTaMgU1VygKF84sZ4v6qCsb4yd0wDHVJFp+BywDr1+GUCTe0b3QL+GFB4a+RcTP9HQOYDDS59lVXRGcy3SA== - dependencies: - "@octokit/rest" "^18.3.5" - "@types/yargs" "^16.0.0" - async-retry "^1.3.1" - diff "^5.0.0" - glob "^7.1.6" - parse-diff "^0.9.0" - yargs "^16.0.0" - codecov@^3.8.3: version "3.8.3" resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.8.3.tgz#9c3e364b8a700c597346ae98418d09880a3fdbe7" @@ -7545,14 +7277,6 @@ commondir@^1.0.1: resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== -compare-func@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" - integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA== - dependencies: - array-ify "^1.0.0" - dot-prop "^5.1.0" - complex.js@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/complex.js/-/complex.js-2.1.1.tgz#0675dac8e464ec431fb2ab7d30f41d889fb25c31" @@ -7630,7 +7354,7 @@ console-browserify@^1.1.0: resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== -console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control-strings@~1.1.0: +console-control-strings@^1.0.0, console-control-strings@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== @@ -7657,38 +7381,6 @@ content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== -conventional-changelog-conventionalcommits@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-5.0.0.tgz#41bdce54eb65a848a4a3ffdca93e92fa22b64a86" - integrity sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw== - dependencies: - compare-func "^2.0.0" - lodash "^4.17.15" - q "^1.5.1" - -conventional-changelog-writer@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz#e0757072f045fe03d91da6343c843029e702f359" - integrity sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ== - dependencies: - conventional-commits-filter "^2.0.7" - dateformat "^3.0.0" - handlebars "^4.7.7" - json-stringify-safe "^5.0.1" - lodash "^4.17.15" - meow "^8.0.0" - semver "^6.0.0" - split "^1.0.0" - through2 "^4.0.0" - -conventional-commits-filter@^2.0.2, conventional-commits-filter@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz#f8d9b4f182fce00c9af7139da49365b136c8a0b3" - integrity sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA== - dependencies: - lodash.ismatch "^4.4.0" - modify-values "^1.0.0" - convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.8.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" @@ -8034,7 +7726,7 @@ css-select@^2.0.0: domutils "^1.7.0" nth-check "^1.0.2" -css-select@^4.1.3, css-select@^4.2.1: +css-select@^4.1.3: version "4.3.0" resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.3.0.tgz#db7129b2846662fd8628cfc496abb2b59e41529b" integrity sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ== @@ -8351,11 +8043,6 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -dateformat@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" - integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== - debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -8377,15 +8064,7 @@ debug@^3.0.0, debug@^3.2.7: dependencies: ms "^2.1.1" -decamelize-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" - integrity sha512-ocLWuYzRPoS9bfiSdDd3cxvrzovVMZnRDVEzAs+hWIVXGDbHxWMECij2OBuyB/An0FFW/nLuq6Kv1i/YC5Qfzg== - dependencies: - decamelize "^1.1.0" - map-obj "^1.0.0" - -decamelize@^1.1.0, decamelize@^1.1.2, decamelize@^1.2.0: +decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== @@ -8546,11 +8225,6 @@ dependency-graph@^0.11.0: resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.11.0.tgz#ac0ce7ed68a54da22165a85e97a01d53f5eb2e27" integrity sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg== -deprecation@^2.0.0, deprecation@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" - integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== - des.js@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" @@ -8576,16 +8250,6 @@ detab@2.0.4: dependencies: repeat-string "^1.5.4" -detect-indent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" - integrity sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g== - -detect-indent@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" - integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== - detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" @@ -8653,11 +8317,6 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diff@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" - integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== - diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -8825,7 +8484,7 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" -dot-prop@^5.1.0, dot-prop@^5.2.0: +dot-prop@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== @@ -8852,7 +8511,7 @@ duplexer3@^0.1.4: resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" integrity sha512-CEj8FwwNA4cVH2uFCoHUrmojhYh1vmCdOaneKJXwkeY1i9jnlslVo9dx+hQ5Hl9GnH/Bwy/IjxAyOePyPKYnzA== -duplexer@^0.1.1, duplexer@^0.1.2: +duplexer@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== @@ -9135,18 +8794,6 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escodegen@^1.8.1: - version "1.14.3" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" - integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== - dependencies: - esprima "^4.0.1" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - escodegen@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" @@ -9385,11 +9032,6 @@ espree@^9.3.2, espree@^9.3.3: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" -esprima@1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.2.2.tgz#76a0fd66fcfe154fd292667dc264019750b1657b" - integrity sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A== - esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" @@ -9409,7 +9051,7 @@ esrecurse@^4.1.0, esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.1.1: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -9456,7 +9098,7 @@ eval@^0.1.8: "@types/node" "*" require-like ">= 0.1.1" -eventemitter3@^4.0.0, eventemitter3@^4.0.4: +eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== @@ -9767,13 +9409,6 @@ figgy-pudding@^3.5.1: resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== -figures@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -10153,20 +9788,6 @@ gauge@^3.0.0: strip-ansi "^6.0.1" wide-align "^1.1.2" -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg== - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -10463,11 +10084,6 @@ handlebars@^4.7.7: optionalDependencies: uglify-js "^3.1.4" -hard-rejection@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" - integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== - harmony-reflect@^1.4.6: version "1.6.2" resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.6.2.tgz#31ecbd32e648a34d030d86adb67d4d47547fe710" @@ -10521,7 +10137,7 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.2" -has-unicode@^2.0.0, has-unicode@^2.0.1: +has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== @@ -10684,7 +10300,7 @@ hastscript@^6.0.0: property-information "^5.0.0" space-separated-tokens "^1.0.0" -he@1.2.0, he@^1.2.0: +he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -10737,13 +10353,6 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== -hosted-git-info@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" - integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== - dependencies: - lru-cache "^6.0.0" - hpack.js@^2.1.6: version "2.1.6" resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" @@ -11269,7 +10878,7 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.5.0, is-core-module@^2.8.1, is-core-module@^2.9.0: +is-core-module@^2.8.1, is-core-module@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== @@ -11355,13 +10964,6 @@ is-finite@^1.0.0: resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== - dependencies: - number-is-nan "^1.0.0" - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -11468,11 +11070,6 @@ is-path-inside@^3.0.2: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== -is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== - is-plain-obj@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" @@ -11483,7 +11080,7 @@ is-plain-obj@^3.0.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== -is-plain-object@5.0.0, is-plain-object@^5.0.0: +is-plain-object@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== @@ -12335,7 +11932,7 @@ js-yaml@3.14.1, js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.0.0, js-yaml@^4.1.0: +js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== @@ -12425,11 +12022,6 @@ json-stringify-pretty-compact@^3.0.0, json-stringify-pretty-compact@~3.0.0: resolved "https://registry.yarnpkg.com/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz#f71ef9d82ef16483a407869556588e91b681d9ab" integrity sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA== -json-stringify-safe@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - json5@2.x, json5@^2.1.2, json5@^2.1.3, json5@^2.2.0, json5@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" @@ -12451,15 +12043,6 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -jsonpath@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/jsonpath/-/jsonpath-1.1.1.tgz#0ca1ed8fb65bb3309248cc9d5466d12d5b0b9901" - integrity sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w== - dependencies: - esprima "1.2.2" - static-eval "2.0.2" - underscore "1.12.1" - jsonpointer@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.0.tgz#f802669a524ec4805fa7389eadbc9921d5dc8072" @@ -12516,7 +12099,7 @@ kind-of@^5.0.0: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== -kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -12610,16 +12193,6 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" -load-json-file@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-6.2.0.tgz#5c7770b42cafa97074ca2848707c61662f4251a1" - integrity sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ== - dependencies: - graceful-fs "^4.1.15" - parse-json "^5.0.0" - strip-bom "^4.0.0" - type-fest "^0.6.0" - loader-runner@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" @@ -12718,11 +12291,6 @@ lodash.isequal@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== -lodash.ismatch@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" - integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g== - lodash.memoize@4.x, lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -12858,11 +12426,6 @@ map-obj@^1.0.0, map-obj@^1.0.1: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== -map-obj@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" - integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== - map-or-similar@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/map-or-similar/-/map-or-similar-1.5.0.tgz#6de2653174adfb5d9edc33c69d3e92a1b76faf08" @@ -13027,23 +12590,6 @@ meow@^3.1.0: redent "^1.0.0" trim-newlines "^1.0.0" -meow@^8.0.0: - version "8.1.2" - resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" - integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" - merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" @@ -13211,15 +12757,6 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" -minimist-options@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" - integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== - dependencies: - arrify "^1.0.1" - is-plain-obj "^1.1.0" - kind-of "^6.0.3" - minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" @@ -13297,11 +12834,6 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -modify-values@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" - integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== - moduleserve@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/moduleserve/-/moduleserve-0.9.1.tgz#11bad4337ea248d7eaf10d2c7f8649a8c3b9c1f8" @@ -13465,14 +12997,6 @@ node-forge@^1: resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== -node-html-parser@^5.0.0: - version "5.3.3" - resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-5.3.3.tgz#2845704f3a7331a610e0e551bf5fa02b266341b6" - integrity sha512-ncg1033CaX9UexbyA7e1N0aAoAYRDiV8jkTvzEnfd1GDvzFdrsXLzR4p4ik8mwLgnaKP/jyUFWDy9q3jvRT2Jw== - dependencies: - css-select "^4.2.1" - he "1.2.0" - node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -13529,16 +13053,6 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package- semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-package-data@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" - integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== - dependencies: - hosted-git-info "^4.0.1" - is-core-module "^2.5.0" - semver "^7.3.4" - validate-npm-package-license "^3.0.1" - normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -13566,15 +13080,6 @@ normalize-url@^6.0.1: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== -npm-package-arg@^8.1.0: - version "8.1.5" - resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.5.tgz#3369b2d5fe8fdc674baa7f1786514ddc15466e44" - integrity sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q== - dependencies: - hosted-git-info "^4.0.1" - semver "^7.3.4" - validate-npm-package-name "^3.0.0" - npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -13589,16 +13094,6 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" -npmlog@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - npmlog@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-5.0.1.tgz#f06678e80e29419ad67ab964e0fa69959c1eb8b0" @@ -13633,11 +13128,6 @@ num2fraction@^1.2.2: resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" integrity sha512-Y1wZESM7VUThYY+4W+X4ySH2maqcA+p7UR+w8VWNWVAd6lwuXXWz/w/Cz43J/dI2I+PS6wD5N+bJUF+gjWvIqg== -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== - nwsapi@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" @@ -13995,14 +13485,6 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" -p-queue@^6.6.2: - version "6.6.2" - resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" - integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== - dependencies: - eventemitter3 "^4.0.4" - p-timeout "^3.2.0" - p-retry@^4.5.0: version "4.6.2" resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.6.2.tgz#9baae7184057edd4e17231cee04264106e092a16" @@ -14011,7 +13493,7 @@ p-retry@^4.5.0: "@types/retry" "0.12.0" retry "^0.13.1" -p-timeout@^3.1.0, p-timeout@^3.2.0: +p-timeout@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== @@ -14093,11 +13575,6 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" -parse-diff@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/parse-diff/-/parse-diff-0.9.0.tgz#2e71b5dc5d8f4b9c19c471fd6325646dc9f21724" - integrity sha512-Jn+VZORAezkfOXR6B40EZcXxdJBamtgBpfeoFH6hxD+p0e74nVaCL9SWlQj1ggc8b6AexgPKlDiiE0CMMZDSbQ== - parse-entities@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" @@ -14110,11 +13587,6 @@ parse-entities@^2.0.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" -parse-github-repo-url@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" - integrity sha512-bSWyzBKqcSL4RrncTpGsEKoJ7H8a4L3++ifTAbTFeMHyq2wRV+42DGmQcHIrJIvdcacjIOxEuKH/w4tthF17gg== - parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" @@ -15361,7 +14833,7 @@ pure-rand@^5.0.1: resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-5.0.1.tgz#97a287b4b4960b2a3448c0932bf28f2405cac51d" integrity sha512-ksWccjmXOHU2gJBnH0cK1lSYdvSZ0zLoCMSz/nTGh6hDvCSgcRxDyIcOBD6KNxFz3xhMPm/T267Tbe2JRymKEQ== -q@^1.1.2, q@^1.5.1: +q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== @@ -15407,11 +14879,6 @@ queue@6.0.2: dependencies: inherits "~2.0.3" -quick-lru@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" - integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== - quick-lru@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" @@ -15868,7 +15335,7 @@ read@^1.0.7: dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -15881,7 +15348,7 @@ read@^1.0.7: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@3, readable-stream@^3.0.6, readable-stream@^3.6.0: +readable-stream@^3.0.6, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -16093,43 +15560,6 @@ relateurl@^0.2.7: resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog== -release-please@^13.19.6: - version "13.19.6" - resolved "https://registry.yarnpkg.com/release-please/-/release-please-13.19.6.tgz#e6e8b111f88d3f5f8796e0962a095094e445943e" - integrity sha512-HcqxhwwyIqCBQ9wVmbLPPq1Q/MG2FDZIRH+5HCiD2ZI9zSOi+C723gY0RY60/afF+R7zxb1k+jZwyHbtCwdG7w== - dependencies: - "@conventional-commits/parser" "^0.4.1" - "@iarna/toml" "^2.2.5" - "@lerna/collect-updates" "^4.0.0" - "@lerna/package" "^4.0.0" - "@lerna/package-graph" "^4.0.0" - "@lerna/run-topologically" "^4.0.0" - "@octokit/graphql" "^4.3.1" - "@octokit/request" "^5.6.0" - "@octokit/request-error" "^2.1.0" - "@octokit/rest" "^18.12.0" - "@types/npm-package-arg" "^6.1.0" - "@xmldom/xmldom" "^0.8.2" - chalk "^4.0.0" - code-suggester "^3.0.0" - conventional-changelog-conventionalcommits "^5.0.0" - conventional-changelog-writer "^5.0.0" - conventional-commits-filter "^2.0.2" - detect-indent "^6.1.0" - diff "^5.0.0" - figures "^3.0.0" - js-yaml "^4.0.0" - jsonpath "^1.1.1" - node-html-parser "^5.0.0" - parse-github-repo-url "^1.4.1" - semver "^7.0.0" - type-fest "^2.0.0" - typescript "^4.6.4" - unist-util-visit "^2.0.3" - unist-util-visit-parents "^3.1.1" - xpath "^0.0.32" - yargs "^17.0.0" - release-zalgo@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" @@ -16378,7 +15808,7 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -retry@0.13.1, retry@^0.13.1: +retry@^0.13.1: version "0.13.1" resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== @@ -16652,7 +16082,7 @@ semver@7.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@7.x, semver@^7.0.0, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: +semver@7.x, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: version "7.3.7" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== @@ -16771,7 +16201,7 @@ serve-static@1.15.0, serve-static@^1.14.1: parseurl "~1.3.3" send "0.18.0" -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== @@ -16961,13 +16391,6 @@ sort-css-media-queries@2.0.4: resolved "https://registry.yarnpkg.com/sort-css-media-queries/-/sort-css-media-queries-2.0.4.tgz#b2badfa519cb4a938acbc6d3aaa913d4949dc908" integrity sha512-PAIsEK/XupCQwitjv7XxoMvYhT7EAfyzI3hsy/MyDgTvc+Ft55ctdkctJLOy6cQejaIC+zjpUL4djFVm2ivOOw== -sort-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" - integrity sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg== - dependencies: - is-plain-obj "^1.0.0" - source-list-map@^2.0.0, source-list-map@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" @@ -17129,13 +16552,6 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" -split@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" - integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== - dependencies: - through "2" - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -17201,13 +16617,6 @@ state-toggle@^1.0.0: resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.3.tgz#e123b16a88e143139b09c6852221bc9815917dfe" integrity sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ== -static-eval@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.2.tgz#2d1759306b1befa688938454c546b7871f806a42" - integrity sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg== - dependencies: - escodegen "^1.8.1" - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -17296,15 +16705,6 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -17478,15 +16878,6 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== -strong-log-transformer@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz#0f5ed78d325e0421ac6f90f7f10e691d6ae3ae10" - integrity sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA== - dependencies: - duplexer "^0.1.1" - minimist "^1.2.0" - through "^2.3.4" - stubs@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" @@ -17832,18 +17223,6 @@ through2@^2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" -through2@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" - integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== - dependencies: - readable-stream "3" - -through@2, through@^2.3.4: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== - thunky@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" @@ -17995,11 +17374,6 @@ trim-newlines@^1.0.0: resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" integrity sha512-Nm4cF79FhSTzrLKGDMi3I4utBtFv8qKy4sq1enftf2gMdpqI8oVQTAfySkTz5r49giVzDj88SVZXP4CeYQwjaw== -trim-newlines@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" - integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== - trim-trailing-lines@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.4.tgz#bd4abbec7cc880462f10b2c8b5ce1d8d1ec7c2c0" @@ -18157,11 +17531,6 @@ type-fest@^0.16.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.16.0.tgz#3240b891a78b0deae910dbeb86553e552a148860" integrity sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg== -type-fest@^0.18.0: - version "0.18.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" - integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== - type-fest@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" @@ -18172,11 +17541,6 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.4.1.tgz#8bdf77743385d8a4f13ba95f610f5ccd68c728f8" - integrity sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw== - type-fest@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" @@ -18187,11 +17551,6 @@ type-fest@^0.8.0, type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-fest@^2.0.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.18.0.tgz#fdef3a74e0a9e68ebe46054836650fb91ac3881e" - integrity sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw== - type-fest@^2.5.0: version "2.13.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.13.1.tgz#621c84220df0e01a8469002594fc005714f0cfba" @@ -18230,7 +17589,7 @@ 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.6.4, typescript@^4.7.4: +typescript@^4.7.4: version "4.7.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== @@ -18260,11 +17619,6 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" -underscore@1.12.1: - version "1.12.1" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.12.1.tgz#7bb8cc9b3d397e201cf8553336d262544ead829e" - integrity sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw== - underscore@1.8.3: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" @@ -18409,7 +17763,7 @@ unist-util-stringify-position@^2.0.0: dependencies: "@types/unist" "^2.0.2" -unist-util-visit-parents@^3.0.0, unist-util-visit-parents@^3.1.1: +unist-util-visit-parents@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== @@ -18426,11 +17780,6 @@ unist-util-visit@2.0.3, unist-util-visit@^2.0.0, unist-util-visit@^2.0.3: unist-util-is "^4.0.0" unist-util-visit-parents "^3.0.0" -universal-user-agent@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" - integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== - universalify@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -18672,13 +18021,6 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -validate-npm-package-name@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" - integrity sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw== - dependencies: - builtins "^1.0.3" - value-equal@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c" @@ -19579,7 +18921,7 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wide-align@^1.1.0, wide-align@^1.1.2: +wide-align@^1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== @@ -19830,15 +19172,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write-file-atomic@^2.4.2: - version "2.4.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" - integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - write-file-atomic@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" @@ -19849,27 +19182,6 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -write-json-file@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-3.2.0.tgz#65bbdc9ecd8a1458e15952770ccbadfcff5fe62a" - integrity sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ== - dependencies: - detect-indent "^5.0.0" - graceful-fs "^4.1.15" - make-dir "^2.1.0" - pify "^4.0.1" - sort-keys "^2.0.0" - write-file-atomic "^2.4.2" - -write-pkg@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-4.0.0.tgz#675cc04ef6c11faacbbc7771b24c0abbf2a20039" - integrity sha512-v2UQ+50TNf2rNHJ8NyWttfm/EJUBWMJcx6ZTYZr6Qp52uuegWw/lBkCtCbnYZEmPRNL61m+u67dAmGxo+HTULA== - dependencies: - sort-keys "^2.0.0" - type-fest "^0.4.1" - write-json-file "^3.2.0" - ws@^7.3.1, ws@^7.4.6: version "7.5.8" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.8.tgz#ac2729881ab9e7cbaf8787fe3469a48c5c7f636a" @@ -19909,11 +19221,6 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xpath@^0.0.32: - version "0.0.32" - resolved "https://registry.yarnpkg.com/xpath/-/xpath-0.0.32.tgz#1b73d3351af736e17ec078d6da4b8175405c48af" - integrity sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw== - xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" @@ -19949,7 +19256,7 @@ yaml@^2.1.1: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.1.1.tgz#1e06fb4ca46e60d9da07e4f786ea370ed3c3cfec" integrity sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw== -yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: +yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.9: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== @@ -19984,7 +19291,7 @@ yargs@^15.0.2: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.0.0, yargs@^16.2.0: +yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== From 1a09f400e03e2261e2917e566dda1bab6cfe1d4c Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 14:40:37 -0400 Subject: [PATCH 175/203] `yarn format:all` compels me --- .github/dependabot.yml | 1 - .github/workflows/release-please.yml | 50 ++++++++++++++-------------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e5293308..443439c4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,4 +12,3 @@ updates: commit-message: prefix: "⬆️" open-pull-requests-limit: 100 - diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 27cc95d6..299aad22 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -57,19 +57,19 @@ 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@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 }} relplz-components: name: for components runs-on: ubuntu-latest @@ -84,18 +84,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 89e5f7e0721d3d61acf0e2d516c2788f978719c8 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 14:44:40 -0400 Subject: [PATCH 176/203] Added note about dynamic custom component in internal docs --- packages/website/docs/Internal/ImportIntoMdx.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/website/docs/Internal/ImportIntoMdx.mdx b/packages/website/docs/Internal/ImportIntoMdx.mdx index 683f9311..74a2837e 100644 --- a/packages/website/docs/Internal/ImportIntoMdx.mdx +++ b/packages/website/docs/Internal/ImportIntoMdx.mdx @@ -29,6 +29,8 @@ import { SquiggleEditorWithImportedBindings } from "../../src/components/Squiggl />; ``` +Notice, you need to wrap the export of `@quri/squiggle-components` in custom code for dynamicism, please view `packages/website/src/components/` in github for details. + Which would then look exactly like Date: Mon, 1 Aug 2022 18:45:32 +0000 Subject: [PATCH 177/203] chore: release develop --- .release-please-manifest.json | 8 +------- packages/website/CHANGELOG.md | 9 +++++++++ packages/website/package.json | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 packages/website/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1bdb33d0..0210face 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,7 +1 @@ -{ - "packages/squiggle-lang": "0.2.11", - "packages/website": "0.2.0", - "packages/components": "0.2.24", - "packages/vscode-ext": "0.3.1", - "packages/cli": "0.0.3" -} +{"packages/cli":"0.0.3","packages/components":"0.2.24","packages/squiggle-lang":"0.2.11","packages/vscode-ext":"0.3.1","packages/website":"0.2.1"} \ No newline at end of file diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md new file mode 100644 index 00000000..5c16bf93 --- /dev/null +++ b/packages/website/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +### [0.2.1](https://www.github.com/quantified-uncertainty/squiggle/compare/squiggle-website-v0.2.0...squiggle-website-v0.2.1) (2022-08-01) + + +### Bug Fixes + +* added NextJS starter to `Integrations.md` ([7ea9522](https://www.github.com/quantified-uncertainty/squiggle/commit/7ea95225b2fa3bd638b75a23bfd2d55ea1b7d595)) +* so the PR it opens is proper this time ([fd411c4](https://www.github.com/quantified-uncertainty/squiggle/commit/fd411c49b9013ba215ed305ae6ed66850592433b)) diff --git a/packages/website/package.json b/packages/website/package.json index e2ceb9aa..9f21ad98 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "squiggle-website", - "version": "0.2.0", + "version": "0.2.1", "private": true, "license": "MIT", "scripts": { From 31085f821816aeff14c4e7b7caae3c2d487df1ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 18:49:08 +0000 Subject: [PATCH 178/203] :arrow_up: Bump @typescript-eslint/parser from 5.31.0 to 5.32.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.31.0 to 5.32.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.32.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 0defda40..2ee63c7c 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -130,7 +130,7 @@ "@types/node": "18.x", "@types/vscode": "^1.69.0", "@typescript-eslint/eslint-plugin": "^5.31.0", - "@typescript-eslint/parser": "^5.31.0", + "@typescript-eslint/parser": "^5.32.0", "eslint": "^8.21.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index e866737c..207f0c73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5026,14 +5026,14 @@ dependencies: "@typescript-eslint/utils" "5.29.0" -"@typescript-eslint/parser@^5.31.0", "@typescript-eslint/parser@^5.5.0": - version "5.31.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.31.0.tgz#7f42d7dcc68a0a6d80a0f3d9a65063aee7bb8d2c" - integrity sha512-UStjQiZ9OFTFReTrN+iGrC6O/ko9LVDhreEK5S3edmXgR396JGq7CoX2TWIptqt/ESzU2iRKXAHfSF2WJFcWHw== +"@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== dependencies: - "@typescript-eslint/scope-manager" "5.31.0" - "@typescript-eslint/types" "5.31.0" - "@typescript-eslint/typescript-estree" "5.31.0" + "@typescript-eslint/scope-manager" "5.32.0" + "@typescript-eslint/types" "5.32.0" + "@typescript-eslint/typescript-estree" "5.32.0" debug "^4.3.4" "@typescript-eslint/scope-manager@5.29.0": @@ -5052,6 +5052,14 @@ "@typescript-eslint/types" "5.31.0" "@typescript-eslint/visitor-keys" "5.31.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/type-utils@5.31.0": version "5.31.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.31.0.tgz#70a0b7201360b5adbddb0c36080495aa08f6f3d9" @@ -5071,6 +5079,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.31.0.tgz#7aa389122b64b18e473c1672fb3b8310e5f07a9a" integrity sha512-/f/rMaEseux+I4wmR6mfpM2wvtNZb1p9hAV77hWfuKc3pmaANp5dLAZSiE3/8oXTYTt3uV9KW5yZKJsMievp6g== +"@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/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" @@ -5097,6 +5110,19 @@ 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/utils@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.29.0.tgz#775046effd5019667bd086bcf326acbe32cd0082" @@ -5137,6 +5163,14 @@ "@typescript-eslint/types" "5.31.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" + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" From 5d1bdbb68c34aa28eaea0ec214abc52ca26d8b22 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 14:56:57 -0400 Subject: [PATCH 179/203] rm bootstrap sha --- release-please-config.json | 1 - 1 file changed, 1 deletion(-) diff --git a/release-please-config.json b/release-please-config.json index 2e7cf7db..3c4294a5 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,5 +1,4 @@ { - "bootstrap-sha": "b1cbce1aaacc9cbc2914ce388c01bc072b2fd8e0", "bump-patch-for-minor-pre-major": true, "release-type": "node", "packages": { From 4d789805303bd460ff9c3129e91f4b55d93579c6 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Mon, 1 Aug 2022 15:05:00 -0400 Subject: [PATCH 180/203] `yarn format:all` compels me :) --- .release-please-manifest.json | 8 +++++++- packages/website/CHANGELOG.md | 5 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0210face..60a035fb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1,7 @@ -{"packages/cli":"0.0.3","packages/components":"0.2.24","packages/squiggle-lang":"0.2.11","packages/vscode-ext":"0.3.1","packages/website":"0.2.1"} \ No newline at end of file +{ + "packages/cli": "0.0.3", + "packages/components": "0.2.24", + "packages/squiggle-lang": "0.2.11", + "packages/vscode-ext": "0.3.1", + "packages/website": "0.2.1" +} diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md index 5c16bf93..d571a1d3 100644 --- a/packages/website/CHANGELOG.md +++ b/packages/website/CHANGELOG.md @@ -2,8 +2,7 @@ ### [0.2.1](https://www.github.com/quantified-uncertainty/squiggle/compare/squiggle-website-v0.2.0...squiggle-website-v0.2.1) (2022-08-01) - ### Bug Fixes -* added NextJS starter to `Integrations.md` ([7ea9522](https://www.github.com/quantified-uncertainty/squiggle/commit/7ea95225b2fa3bd638b75a23bfd2d55ea1b7d595)) -* so the PR it opens is proper this time ([fd411c4](https://www.github.com/quantified-uncertainty/squiggle/commit/fd411c49b9013ba215ed305ae6ed66850592433b)) +- added NextJS starter to `Integrations.md` ([7ea9522](https://www.github.com/quantified-uncertainty/squiggle/commit/7ea95225b2fa3bd638b75a23bfd2d55ea1b7d595)) +- so the PR it opens is proper this time ([fd411c4](https://www.github.com/quantified-uncertainty/squiggle/commit/fd411c49b9013ba215ed305ae6ed66850592433b)) From d3da99423096534e34c7a1996aabca8d394fe0e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 19:08:01 +0000 Subject: [PATCH 181/203] :arrow_up: Bump @typescript-eslint/eslint-plugin from 5.31.0 to 5.32.0 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.31.0 to 5.32.0. - [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.32.0/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, 20 insertions(+), 54 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 2ee63c7c..fca0c43d 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.69.0", - "@typescript-eslint/eslint-plugin": "^5.31.0", + "@typescript-eslint/eslint-plugin": "^5.32.0", "@typescript-eslint/parser": "^5.32.0", "eslint": "^8.21.0", "glob": "^8.0.3", diff --git a/yarn.lock b/yarn.lock index 207f0c73..52953d7f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5004,14 +5004,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.31.0", "@typescript-eslint/eslint-plugin@^5.5.0": - version "5.31.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.31.0.tgz#cae1967b1e569e6171bbc6bec2afa4e0c8efccfe" - integrity sha512-VKW4JPHzG5yhYQrQ1AzXgVgX8ZAJEvCz0QI6mLRX4tf7rnFfh5D8SKm0Pq6w5PyNfAWJk6sv313+nEt3ohWMBQ== +"@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== dependencies: - "@typescript-eslint/scope-manager" "5.31.0" - "@typescript-eslint/type-utils" "5.31.0" - "@typescript-eslint/utils" "5.31.0" + "@typescript-eslint/scope-manager" "5.32.0" + "@typescript-eslint/type-utils" "5.32.0" + "@typescript-eslint/utils" "5.32.0" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -5044,14 +5044,6 @@ "@typescript-eslint/types" "5.29.0" "@typescript-eslint/visitor-keys" "5.29.0" -"@typescript-eslint/scope-manager@5.31.0": - version "5.31.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.31.0.tgz#f47a794ba84d9b818ab7f8f44fff55a61016c606" - integrity sha512-8jfEzBYDBG88rcXFxajdVavGxb5/XKXyvWgvD8Qix3EEJLCFIdVloJw+r9ww0wbyNLOTYyBsR+4ALNGdlalLLg== - dependencies: - "@typescript-eslint/types" "5.31.0" - "@typescript-eslint/visitor-keys" "5.31.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" @@ -5060,12 +5052,12 @@ "@typescript-eslint/types" "5.32.0" "@typescript-eslint/visitor-keys" "5.32.0" -"@typescript-eslint/type-utils@5.31.0": - version "5.31.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.31.0.tgz#70a0b7201360b5adbddb0c36080495aa08f6f3d9" - integrity sha512-7ZYqFbvEvYXFn9ax02GsPcEOmuWNg+14HIf4q+oUuLnMbpJ6eHAivCg7tZMVwzrIuzX3QCeAOqKoyMZCv5xe+w== +"@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== dependencies: - "@typescript-eslint/utils" "5.31.0" + "@typescript-eslint/utils" "5.32.0" debug "^4.3.4" tsutils "^3.21.0" @@ -5074,11 +5066,6 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== -"@typescript-eslint/types@5.31.0": - version "5.31.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.31.0.tgz#7aa389122b64b18e473c1672fb3b8310e5f07a9a" - integrity sha512-/f/rMaEseux+I4wmR6mfpM2wvtNZb1p9hAV77hWfuKc3pmaANp5dLAZSiE3/8oXTYTt3uV9KW5yZKJsMievp6g== - "@typescript-eslint/types@5.32.0": version "5.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.32.0.tgz#484273021eeeae87ddb288f39586ef5efeb6dcd8" @@ -5097,19 +5084,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.31.0": - version "5.31.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.31.0.tgz#eb92970c9d6e3946690d50c346fb9b1d745ee882" - integrity sha512-3S625TMcARX71wBc2qubHaoUwMEn+l9TCsaIzYI/ET31Xm2c9YQ+zhGgpydjorwQO9pLfR/6peTzS/0G3J/hDw== - dependencies: - "@typescript-eslint/types" "5.31.0" - "@typescript-eslint/visitor-keys" "5.31.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.32.0": version "5.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.32.0.tgz#282943f34babf07a4afa7b0ff347a8e7b6030d12" @@ -5135,15 +5109,15 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/utils@5.31.0", "@typescript-eslint/utils@^5.13.0": - version "5.31.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.31.0.tgz#e146fa00dca948bfe547d665b2138a2dc1b79acd" - integrity sha512-kcVPdQS6VIpVTQ7QnGNKMFtdJdvnStkqS5LeALr4rcwx11G6OWb2HB17NMPnlRHvaZP38hL9iK8DdE9Fne7NYg== +"@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== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.31.0" - "@typescript-eslint/types" "5.31.0" - "@typescript-eslint/typescript-estree" "5.31.0" + "@typescript-eslint/scope-manager" "5.32.0" + "@typescript-eslint/types" "5.32.0" + "@typescript-eslint/typescript-estree" "5.32.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -5155,14 +5129,6 @@ "@typescript-eslint/types" "5.29.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@5.31.0": - version "5.31.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.31.0.tgz#b0eca264df01ce85dceb76aebff3784629258f54" - integrity sha512-ZK0jVxSjS4gnPirpVjXHz7mgdOsZUHzNYSfTw2yPa3agfbt9YfqaBiBZFSSxeBWnpWkzCxTfUpnzA3Vily/CSg== - dependencies: - "@typescript-eslint/types" "5.31.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" From 14df9d64384a960cebf8b7724d8cdd525d5d7762 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 4 Aug 2022 09:10:26 -0400 Subject: [PATCH 182/203] hotfix: set `dependabot` on gh actions versions --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 443439c4..4e459652 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,3 +12,9 @@ updates: commit-message: prefix: "⬆️" open-pull-requests-limit: 100 + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "⬆️" From 1dd74ed33e6e4f892cd97ff86045ff3674e27988 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:10:48 +0000 Subject: [PATCH 183/203] :arrow_up: Bump fkirc/skip-duplicate-actions from 3.4.1 to 4.0.0 Bumps [fkirc/skip-duplicate-actions](https://github.com/fkirc/skip-duplicate-actions) from 3.4.1 to 4.0.0. - [Release notes](https://github.com/fkirc/skip-duplicate-actions/releases) - [Commits](https://github.com/fkirc/skip-duplicate-actions/compare/v3.4.1...v4.0.0) --- updated-dependencies: - dependency-name: fkirc/skip-duplicate-actions dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/release-please.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7dff9d0..39bbcefa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,27 +24,27 @@ jobs: steps: - id: skip_lang_check name: Check if the changes are about squiggle-lang src files - uses: fkirc/skip-duplicate-actions@v3.4.1 + uses: fkirc/skip-duplicate-actions@v4.0.0 with: paths: '["packages/squiggle-lang/**"]' - id: skip_components_check name: Check if the changes are about components src files - uses: fkirc/skip-duplicate-actions@v3.4.1 + uses: fkirc/skip-duplicate-actions@v4.0.0 with: paths: '["packages/components/**"]' - id: skip_website_check name: Check if the changes are about website src files - uses: fkirc/skip-duplicate-actions@v3.4.1 + uses: fkirc/skip-duplicate-actions@v4.0.0 with: paths: '["packages/website/**"]' - id: skip_vscodeext_check name: Check if the changes are about vscode extension src files - uses: fkirc/skip-duplicate-actions@v3.4.1 + uses: fkirc/skip-duplicate-actions@v4.0.0 with: paths: '["packages/vscode-ext/**"]' - id: skip_cli_check name: Check if the changes are about cli src files - uses: fkirc/skip-duplicate-actions@v3.4.1 + uses: fkirc/skip-duplicate-actions@v4.0.0 with: paths: '["packages/cli/**"]' diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 299aad22..6286cbd0 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -18,27 +18,27 @@ jobs: steps: - id: skip_lang_check name: Check if the changes are about squiggle-lang src files - uses: fkirc/skip-duplicate-actions@v3.4.1 + uses: fkirc/skip-duplicate-actions@v4.0.0 with: paths: '["packages/squiggle-lang/**"]' - id: skip_components_check name: Check if the changes are about components src files - uses: fkirc/skip-duplicate-actions@v3.4.1 + uses: fkirc/skip-duplicate-actions@v4.0.0 with: paths: '["packages/components/**"]' - id: skip_website_check name: Check if the changes are about website src files - uses: fkirc/skip-duplicate-actions@v3.4.1 + uses: fkirc/skip-duplicate-actions@v4.0.0 with: paths: '["packages/website/**"]' - id: skip_vscodeext_check name: Check if the changes are about vscode extension src files - uses: fkirc/skip-duplicate-actions@v3.4.1 + uses: fkirc/skip-duplicate-actions@v4.0.0 with: paths: '["packages/vscode-ext/**"]' - id: skip_cli_check name: Check if the changes are about cli src files - uses: fkirc/skip-duplicate-actions@v3.4.1 + uses: fkirc/skip-duplicate-actions@v4.0.0 with: paths: '["packages/cli/**"]' From 4fd80a46eea3979ec798406f36980cc51bc68c9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:10:51 +0000 Subject: [PATCH 184/203] :arrow_up: Bump google-github-actions/release-please-action from 2 to 3 Bumps [google-github-actions/release-please-action](https://github.com/google-github-actions/release-please-action) from 2 to 3. - [Release notes](https://github.com/google-github-actions/release-please-action/releases) - [Changelog](https://github.com/google-github-actions/release-please-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/google-github-actions/release-please-action/compare/v2...v3) --- updated-dependencies: - dependency-name: google-github-actions/release-please-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/release-please.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 299aad22..8b2d11fe 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -49,7 +49,7 @@ jobs: if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} steps: - name: Release please (squiggle-lang) - uses: google-github-actions/release-please-action@v2 + uses: google-github-actions/release-please-action@v3 id: release with: token: ${{secrets.GITHUB_TOKEN}} @@ -77,7 +77,7 @@ jobs: if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }} steps: - name: Release please (components) - uses: google-github-actions/release-please-action@v2 + uses: google-github-actions/release-please-action@v3 with: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr @@ -103,7 +103,7 @@ jobs: if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }} steps: - name: Release please (website) - uses: google-github-actions/release-please-action@v2 + uses: google-github-actions/release-please-action@v3 with: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr @@ -117,7 +117,7 @@ jobs: if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }} steps: - name: Release please (vscode-ext) - uses: google-github-actions/release-please-action@v2 + uses: google-github-actions/release-please-action@v3 with: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr @@ -131,7 +131,7 @@ jobs: if: ${{ needs.pre_check.outputs.should_skip_cli != 'true' }} steps: - name: Release please (cli) - uses: google-github-actions/release-please-action@v2 + uses: google-github-actions/release-please-action@v3 with: token: ${{secrets.GITHUB_TOKEN}} command: manifest-pr From 130e8fb3f626c30e706f6d4e82cceeef18e3b5a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:10:53 +0000 Subject: [PATCH 185/203] :arrow_up: Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 18 +++++++++--------- .github/workflows/codeql-analysis.yml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7dff9d0..3832533c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: shell: bash working-directory: packages/squiggle-lang steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Dependencies run: cd ../../ && yarn - name: Check rescript lint @@ -79,7 +79,7 @@ jobs: shell: bash working-directory: packages/squiggle-lang steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 2 - name: Install dependencies from monorepo level @@ -107,7 +107,7 @@ jobs: shell: bash working-directory: packages/components steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Check javascript, typescript, and markdown lint uses: creyD/prettier_action@v4.2 with: @@ -124,7 +124,7 @@ jobs: shell: bash working-directory: packages/components steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install dependencies from monorepo level run: cd ../../ && yarn - name: Build rescript codebase in squiggle-lang @@ -144,7 +144,7 @@ jobs: shell: bash working-directory: packages/website steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Check javascript, typescript, and markdown lint uses: creyD/prettier_action@v4.2 with: @@ -161,7 +161,7 @@ jobs: shell: bash working-directory: packages/website steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install dependencies from monorepo level run: cd ../../ && yarn - name: Build rescript in squiggle-lang @@ -181,7 +181,7 @@ jobs: shell: bash working-directory: packages/vscode-ext steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install dependencies from monorepo level run: cd ../../ && yarn - name: Lint the VSCode Extension source code @@ -197,7 +197,7 @@ jobs: shell: bash working-directory: packages/vscode-ext steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install dependencies from monorepo level run: cd ../../ && yarn - name: Build @@ -213,7 +213,7 @@ jobs: shell: bash working-directory: packages/cli steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Check javascript, typescript, and markdown lint uses: creyD/prettier_action@v4.2 with: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 450e2ab7..c7f7893d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -33,7 +33,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From a9d80ea0a27547a04804feb50d42c264097f6166 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:10:56 +0000 Subject: [PATCH 186/203] :arrow_up: Bump github/codeql-action from 1 to 2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v1...v2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 450e2ab7..93a21834 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,7 +37,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -48,7 +48,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 - name: Install dependencies run: yarn - name: Build rescript @@ -65,4 +65,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 6a6fdcfee72e73f26ea0a3605e0e72580593e43b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:15:12 +0000 Subject: [PATCH 187/203] :arrow_up: Bump @storybook/react from 6.5.9 to 6.5.10 Bumps [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/app/react) from 6.5.9 to 6.5.10. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/app/react) --- updated-dependencies: - dependency-name: "@storybook/react" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 465 ++++++++++++++++++++++++++----- 2 files changed, 390 insertions(+), 77 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 553a7557..a64be32e 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -33,7 +33,7 @@ "@storybook/manager-webpack5": "^6.5.9", "@storybook/node-logger": "^6.5.9", "@storybook/preset-create-react-app": "^4.1.2", - "@storybook/react": "^6.5.9", + "@storybook/react": "^6.5.10", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^14.3.0", diff --git a/yarn.lock b/yarn.lock index 52953d7f..931df5ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3434,6 +3434,23 @@ prop-types "^15.7.2" regenerator-runtime "^0.13.7" +"@storybook/addons@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.10.tgz#bff2f8fb8453e9df04fa6dbc41341fd05f4cdeba" + integrity sha512-VD4tBCQ23PkSeDoxuHcKy0RfhIs3oMYjBacOZx7d0bvOzK9WjPyvE2ysDAh7r/ceqnwmWHAScIpE+I1RU7gl+g== + dependencies: + "@storybook/api" "6.5.10" + "@storybook/channels" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.10" + "@storybook/theming" "6.5.10" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + global "^4.4.0" + regenerator-runtime "^0.13.7" + "@storybook/addons@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.9.tgz#5a9d7395c579a9cbc44dfc122362fb3c95dfb9d5" @@ -3451,6 +3468,29 @@ global "^4.4.0" regenerator-runtime "^0.13.7" +"@storybook/api@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.10.tgz#215623844648f0da2ac646fdcdd1345c2e1a8490" + integrity sha512-AkmgSPNEGdKp4oZA4KQ+RJsacw7GwfvjsVDnCkcXqS9zmSr/RNL0fhpcd60KKkmx/hGKPTDFpK3ZayxDrJ/h4A== + dependencies: + "@storybook/channels" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.10" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.10" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/api@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.9.tgz#303733214c9de0422d162f7c54ae05d088b89bf9" @@ -3474,28 +3514,28 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/builder-webpack4@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.5.9.tgz#4b37e1fa23a25aa4bfeaba640e5d318fcd511f95" - integrity sha512-YOeA4++9uRZ8Hog1wC60yjaxBOiI1FRQNtax7b9E7g+kP8UlSCPCGcv4gls9hFmzbzTOPfQTWnToA9Oa6jzRVw== +"@storybook/builder-webpack4@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.5.10.tgz#79e95323577a37349ab3c81193fa249ac5c50173" + integrity sha512-AoKjsCNoQQoZXYwBDxO8s+yVEd5FjBJAaysEuUTHq2fb81jwLrGcEOo6hjw4jqfugZQIzYUEjPazlvubS78zpw== dependencies: "@babel/core" "^7.12.10" - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/channel-postmessage" "6.5.9" - "@storybook/channels" "6.5.9" - "@storybook/client-api" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/core-common" "6.5.9" - "@storybook/core-events" "6.5.9" - "@storybook/node-logger" "6.5.9" - "@storybook/preview-web" "6.5.9" - "@storybook/router" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/channel-postmessage" "6.5.10" + "@storybook/channels" "6.5.10" + "@storybook/client-api" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/core-common" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/node-logger" "6.5.10" + "@storybook/preview-web" "6.5.10" + "@storybook/router" "6.5.10" "@storybook/semver" "^7.3.2" - "@storybook/store" "6.5.9" - "@storybook/theming" "6.5.9" - "@storybook/ui" "6.5.9" + "@storybook/store" "6.5.10" + "@storybook/theming" "6.5.10" + "@storybook/ui" "6.5.10" "@types/node" "^14.0.10 || ^16.0.0" "@types/webpack" "^4.41.26" autoprefixer "^9.8.6" @@ -3571,6 +3611,19 @@ webpack-hot-middleware "^2.25.1" webpack-virtual-modules "^0.4.1" +"@storybook/channel-postmessage@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.5.10.tgz#be8971b4b7f91b664bb2c6965fdfb073d541a03e" + integrity sha512-t9PTA0UzFvYa3IlOfpBOolfrRMPTjUMIeCQ6FNyM0aj5GqLKSvoQzP8NeoRpIrvyf6ljFKKdaMaZ3fiCvh45ag== + dependencies: + "@storybook/channels" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + core-js "^3.8.2" + global "^4.4.0" + qs "^6.10.0" + telejson "^6.0.8" + "@storybook/channel-postmessage@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.5.9.tgz#9cf4530f0364cee0d5e58f92d6fb5ce98e10257b" @@ -3584,6 +3637,17 @@ qs "^6.10.0" telejson "^6.0.8" +"@storybook/channel-websocket@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-6.5.10.tgz#bd1316a9b555229b215e5054a76b57c503dd8adc" + integrity sha512-RTXMZbMWCS3xU+4GVIdfnUXsKcwg/WTozy88/5OxaKjGw6KgRedqLAQJKJ6Y5XlnwIcWelirkHj/COwTTXhbPg== + dependencies: + "@storybook/channels" "6.5.10" + "@storybook/client-logger" "6.5.10" + core-js "^3.8.2" + global "^4.4.0" + telejson "^6.0.8" + "@storybook/channel-websocket@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-6.5.9.tgz#6b7a0127fec58ee5be4f6aebcf460adc564f2f34" @@ -3595,6 +3659,15 @@ global "^4.4.0" telejson "^6.0.8" +"@storybook/channels@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.10.tgz#fca5b0d1ea8d30b022e805301ed436407c867ac4" + integrity sha512-lo26YZ6kWpHXLhuHJF4P/bICY7jD/rXEZqReKtGOSk1Lv99/xvG6pqmcy3hWLf3v3Dy/8otjRPSR7izFVIIZgQ== + dependencies: + core-js "^3.8.2" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/channels@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.9.tgz#abfab89a6587a2688e9926d4aafeb11c9d8b2e79" @@ -3604,6 +3677,32 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/client-api@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.10.tgz#0bc3f68ce014ce1ffd560472a893ba04be370f09" + integrity sha512-3wBWZl3NvMFgMovgEh+euiARAT2FXzpvTF4Q1gerGMNNDlrGxHnFvSuy4FHg/irtOGLa4yLz43ULFbYtpKw0Lg== + dependencies: + "@storybook/addons" "6.5.10" + "@storybook/channel-postmessage" "6.5.10" + "@storybook/channels" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/store" "6.5.10" + "@types/qs" "^6.9.5" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/client-api@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.9.tgz#3e4a8ec1d277fd81325c5d959c553161a85fa182" @@ -3630,6 +3729,14 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/client-logger@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.10.tgz#cfea823a5b8444409daa74f854c5d05367986b34" + integrity sha512-/xA0MHOevXev68hyLMQw8Qo8KczSIdXOxliAgrycMTkDmw5eKeA8TP7B8zP3wGuq/e3MrdD9/8MWhb/IQBNC3w== + dependencies: + core-js "^3.8.2" + global "^4.4.0" + "@storybook/client-logger@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.9.tgz#dc1669abe8c45af1cc38f74c6f4b15ff33e63014" @@ -3638,6 +3745,20 @@ core-js "^3.8.2" global "^4.4.0" +"@storybook/components@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.10.tgz#268e1269bc3d262f7dcec13f96c3b844919687b8" + integrity sha512-9OhgB8YQfGwOKjo/N96N5mrtJ6qDVVoEM1zuhea32tJUd2eYf0aSWpryA9VnOM0V1q/8DAoCg5rPBMYWMBU5uw== + dependencies: + "@storybook/client-logger" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/theming" "6.5.10" + core-js "^3.8.2" + memoizerific "^1.11.3" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + util-deprecate "^1.0.2" + "@storybook/components@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.9.tgz#97e07ffe11ab76c01ccee380888991bd161f75b2" @@ -3654,6 +3775,32 @@ regenerator-runtime "^0.13.7" util-deprecate "^1.0.2" +"@storybook/core-client@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.10.tgz#90c86923236c8efff33d454a0dc552f6df4346b1" + integrity sha512-THsIjNrOrampTl0Lgfjvfjk1JnktKb4CQLOM80KpQb4cjDqorBjJmErzUkUQ2y3fXvrDmQ/kUREkShET4XEdtA== + dependencies: + "@storybook/addons" "6.5.10" + "@storybook/channel-postmessage" "6.5.10" + "@storybook/channel-websocket" "6.5.10" + "@storybook/client-api" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/preview-web" "6.5.10" + "@storybook/store" "6.5.10" + "@storybook/ui" "6.5.10" + airbnb-js-shims "^2.2.1" + ansi-to-html "^0.6.11" + core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.21" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + ts-dedent "^2.0.0" + unfetch "^4.2.0" + util-deprecate "^1.0.2" + "@storybook/core-client@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.9.tgz#ea6035d1c90d2c68e860e3cf629979491856cd88" @@ -3680,6 +3827,62 @@ unfetch "^4.2.0" util-deprecate "^1.0.2" +"@storybook/core-common@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.10.tgz#6b93449548b0890f5c68d89f0ca78e092026182c" + integrity sha512-Bx+VKkfWdrAmD8T51Sjq/mMhRaiapBHcpG4cU5bc3DMbg+LF2/yrgqv/cjVu+m5gHAzYCac5D7gqzBgvG7Myww== + dependencies: + "@babel/core" "^7.12.10" + "@babel/plugin-proposal-class-properties" "^7.12.1" + "@babel/plugin-proposal-decorators" "^7.12.12" + "@babel/plugin-proposal-export-default-from" "^7.12.1" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" + "@babel/plugin-proposal-object-rest-spread" "^7.12.1" + "@babel/plugin-proposal-optional-chaining" "^7.12.7" + "@babel/plugin-proposal-private-methods" "^7.12.1" + "@babel/plugin-proposal-private-property-in-object" "^7.12.1" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-transform-arrow-functions" "^7.12.1" + "@babel/plugin-transform-block-scoping" "^7.12.12" + "@babel/plugin-transform-classes" "^7.12.1" + "@babel/plugin-transform-destructuring" "^7.12.1" + "@babel/plugin-transform-for-of" "^7.12.1" + "@babel/plugin-transform-parameters" "^7.12.1" + "@babel/plugin-transform-shorthand-properties" "^7.12.1" + "@babel/plugin-transform-spread" "^7.12.1" + "@babel/preset-env" "^7.12.11" + "@babel/preset-react" "^7.12.10" + "@babel/preset-typescript" "^7.12.7" + "@babel/register" "^7.12.1" + "@storybook/node-logger" "6.5.10" + "@storybook/semver" "^7.3.2" + "@types/node" "^14.0.10 || ^16.0.0" + "@types/pretty-hrtime" "^1.0.0" + babel-loader "^8.0.0" + babel-plugin-macros "^3.0.1" + babel-plugin-polyfill-corejs3 "^0.1.0" + chalk "^4.1.0" + core-js "^3.8.2" + express "^4.17.1" + file-system-cache "^1.0.5" + find-up "^5.0.0" + fork-ts-checker-webpack-plugin "^6.0.4" + fs-extra "^9.0.1" + glob "^7.1.6" + handlebars "^4.7.7" + interpret "^2.2.0" + json5 "^2.1.3" + lazy-universal-dotenv "^3.0.1" + picomatch "^2.3.0" + pkg-dir "^5.0.0" + pretty-hrtime "^1.0.3" + resolve-from "^5.0.0" + slash "^3.0.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + webpack "4" + "@storybook/core-common@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.9.tgz#7ca8258ea2634b1d64695c1e4262f71cc7457989" @@ -3736,6 +3939,13 @@ util-deprecate "^1.0.2" webpack "4" +"@storybook/core-events@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.10.tgz#66d87c8ea18db8e448018a16a3d0198ddbcbc683" + integrity sha512-EVb1gO1172klVIAABLOoigFMx0V88uctY0K/qVCO8n6v+wd2+0Ccn63kl+gTxsAC3WZ8XhXh9q2w5ImHklVECw== + dependencies: + core-js "^3.8.2" + "@storybook/core-events@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.9.tgz#5b0783c7d22a586c0f5e927a61fe1b1223e19637" @@ -3743,23 +3953,23 @@ dependencies: core-js "^3.8.2" -"@storybook/core-server@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.5.9.tgz#749a881c1a81d7cf1a69f3782c06a7f0c39a505c" - integrity sha512-YeePGUrd5fQPvGzMhowh124KrcZURFpFXg1VB0Op3ESqCIsInoMZeObci4Gc+binMXC7vcv7aw3EwSLU37qJzQ== +"@storybook/core-server@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.5.10.tgz#ada3d647833c02cb8c742281c1f314ff866f96f8" + integrity sha512-jqwpA0ccA8X5ck4esWBid04+cEIVqirdAcqJeNb9IZAD+bRreO4Im8ilzr7jc5AmQ9fkqHs2NByFKh9TITp8NQ== dependencies: "@discoveryjs/json-ext" "^0.5.3" - "@storybook/builder-webpack4" "6.5.9" - "@storybook/core-client" "6.5.9" - "@storybook/core-common" "6.5.9" - "@storybook/core-events" "6.5.9" + "@storybook/builder-webpack4" "6.5.10" + "@storybook/core-client" "6.5.10" + "@storybook/core-common" "6.5.10" + "@storybook/core-events" "6.5.10" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/csf-tools" "6.5.9" - "@storybook/manager-webpack4" "6.5.9" - "@storybook/node-logger" "6.5.9" + "@storybook/csf-tools" "6.5.10" + "@storybook/manager-webpack4" "6.5.10" + "@storybook/node-logger" "6.5.10" "@storybook/semver" "^7.3.2" - "@storybook/store" "6.5.9" - "@storybook/telemetry" "6.5.9" + "@storybook/store" "6.5.10" + "@storybook/telemetry" "6.5.10" "@types/node" "^14.0.10 || ^16.0.0" "@types/node-fetch" "^2.5.7" "@types/pretty-hrtime" "^1.0.0" @@ -3794,18 +4004,18 @@ ws "^8.2.3" x-default-browser "^0.4.0" -"@storybook/core@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/core/-/core-6.5.9.tgz#da4f237391d99aed1228323f24b335cafbdf3499" - integrity sha512-Mt3TTQnjQt2/pa60A+bqDsAOrYpohapdtt4DDZEbS8h0V6u11KyYYh3w7FCySlL+sPEyogj63l5Ec76Jah3l2w== +"@storybook/core@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/core/-/core-6.5.10.tgz#15ec8be85943251e25c2c24e80e20dcacc4fed65" + integrity sha512-K86yYa0tYlMxADlwQTculYvPROokQau09SCVqpsLg3wJCTvYFL4+SIqcYoyBSbFmHOdnYbJgPydjN33MYLiOZQ== dependencies: - "@storybook/core-client" "6.5.9" - "@storybook/core-server" "6.5.9" + "@storybook/core-client" "6.5.10" + "@storybook/core-server" "6.5.10" -"@storybook/csf-tools@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/csf-tools/-/csf-tools-6.5.9.tgz#8e01df2305b53e228229f0b45ada3720e6e42a1c" - integrity sha512-RAdhsO2XmEDyWy0qNQvdKMLeIZAuyfD+tYlUwBHRU6DbByDucvwgMOGy5dF97YNJFmyo93EUYJzXjUrJs3U1LQ== +"@storybook/csf-tools@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/csf-tools/-/csf-tools-6.5.10.tgz#ae6f1ebd4951e8978c8fe3e08ddd2bd269bf922b" + integrity sha512-H77kZQEisu7+skzeIbNZwmE09OqLjwJTeFhLN1pcjxKVa30LEI3pBHcNBxVKqgxl+Yg3KkB7W/ArLO2N+i2ohw== dependencies: "@babel/core" "^7.12.10" "@babel/generator" "^7.12.11" @@ -3829,6 +4039,19 @@ dependencies: lodash "^4.17.15" +"@storybook/docs-tools@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/docs-tools/-/docs-tools-6.5.10.tgz#30baa62c1ca3a18b13625b6b305e23e39f404416" + integrity sha512-/bvYgOO+CxMEcHifkjJg0A60OTGOhcjGxnsB1h0gJuxMrqA/7Qwc108bFmPiX0eiD1BovFkZLJV4O6OY7zP5Vw== + dependencies: + "@babel/core" "^7.12.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/store" "6.5.10" + core-js "^3.8.2" + doctrine "^3.0.0" + lodash "^4.17.21" + regenerator-runtime "^0.13.7" + "@storybook/docs-tools@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/docs-tools/-/docs-tools-6.5.9.tgz#5ff304f881e972ce14923a5ffcfed3f052094889" @@ -3842,20 +4065,20 @@ lodash "^4.17.21" regenerator-runtime "^0.13.7" -"@storybook/manager-webpack4@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/manager-webpack4/-/manager-webpack4-6.5.9.tgz#c75d2cced4550c8a786f00b0e57b203d613e706c" - integrity sha512-49LZlHqWc7zj9tQfOOANixPYmLxqWTTZceA6DSXnKd9xDiO2Gl23Y+l/CSPXNZGDB8QFAwpimwqyKJj/NLH45A== +"@storybook/manager-webpack4@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/manager-webpack4/-/manager-webpack4-6.5.10.tgz#41bae252b863484f293954ef2d2dc80bf3e028f1" + integrity sha512-N/TlNDhuhARuFipR/ZJ/xEVESz23iIbCsZ4VNehLHm8PpiGlQUehk+jMjWmz5XV0bJItwjRclY+CU3GjZKblfQ== dependencies: "@babel/core" "^7.12.10" "@babel/plugin-transform-template-literals" "^7.12.1" "@babel/preset-react" "^7.12.10" - "@storybook/addons" "6.5.9" - "@storybook/core-client" "6.5.9" - "@storybook/core-common" "6.5.9" - "@storybook/node-logger" "6.5.9" - "@storybook/theming" "6.5.9" - "@storybook/ui" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/core-client" "6.5.10" + "@storybook/core-common" "6.5.10" + "@storybook/node-logger" "6.5.10" + "@storybook/theming" "6.5.10" + "@storybook/ui" "6.5.10" "@types/node" "^14.0.10 || ^16.0.0" "@types/webpack" "^4.41.26" babel-loader "^8.0.0" @@ -3938,7 +4161,18 @@ prettier ">=2.2.1 <=2.3.0" ts-dedent "^2.0.0" -"@storybook/node-logger@6.5.9", "@storybook/node-logger@^6.5.9": +"@storybook/node-logger@6.5.10", "@storybook/node-logger@^6.5.9": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.10.tgz#bce4c04009c4b62d6d2fb617176d7ef0084e9e89" + integrity sha512-bYswXIKV7Stru8vYfkjUMNN8UhF7Qg7NRsUvG5Djt5lLIae1XmUIgnH40mU/nW4X4BSfcR9MKxsSsngvn2WmQg== + dependencies: + "@types/npmlog" "^4.1.2" + chalk "^4.1.0" + core-js "^3.8.2" + npmlog "^5.0.1" + pretty-hrtime "^1.0.3" + +"@storybook/node-logger@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.9.tgz#129cfe0d0f79cab4f6a2ba194d39516680b1626f" integrity sha512-nZZNZG2Wtwv6Trxi3FrnIqUmB55xO+X/WQGPT5iKlqNjdRIu/T72mE7addcp4rbuWCQfZUhcDDGpBOwKtBxaGg== @@ -3968,6 +4202,28 @@ pnp-webpack-plugin "^1.7.0" semver "^7.3.5" +"@storybook/preview-web@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/preview-web/-/preview-web-6.5.10.tgz#81bf5d3f5fca9e26099c057206bd8e684225989b" + integrity sha512-sTC/o5gkvALOtcNgtApGKGN9EavvSxRHBeBh+5BQjV2qQ8ap+26RsfUizNBECAa2Jrn4osaDYn9HRhJLFL69WA== + dependencies: + "@storybook/addons" "6.5.10" + "@storybook/channel-postmessage" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/store" "6.5.10" + ansi-to-html "^0.6.11" + core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.21" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + unfetch "^4.2.0" + util-deprecate "^1.0.2" + "@storybook/preview-web@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/preview-web/-/preview-web-6.5.9.tgz#557d919e6df50d66259521aa36ebf4055bbd236e" @@ -4003,24 +4259,24 @@ react-docgen-typescript "^2.1.1" tslib "^2.0.0" -"@storybook/react@^6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/react/-/react-6.5.9.tgz#687ec1f6b785822a392b7ac115b61800f69fb7cd" - integrity sha512-Rp+QaTQAzxJhwuzJXVd49mnIBLQRlF8llTxPT2YoGHdrGkku/zl/HblQ6H2yzEf15367VyzaAv/BpLsO9Jlfxg== +"@storybook/react@^6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/react/-/react-6.5.10.tgz#6e9f5cf5e4c81d966774c08c87fb2414052db454" + integrity sha512-m8S1qQrwA7pDGwdKEvL6LV3YKvSzVUY297Fq+xcTU3irnAy4sHDuFoLqV6Mi1510mErK1r8+rf+0R5rEXB219g== dependencies: "@babel/preset-flow" "^7.12.1" "@babel/preset-react" "^7.12.10" "@pmmmwh/react-refresh-webpack-plugin" "^0.5.3" - "@storybook/addons" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/core" "6.5.9" - "@storybook/core-common" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core" "6.5.10" + "@storybook/core-common" "6.5.10" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/docs-tools" "6.5.9" - "@storybook/node-logger" "6.5.9" + "@storybook/docs-tools" "6.5.10" + "@storybook/node-logger" "6.5.10" "@storybook/react-docgen-typescript-plugin" "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0" "@storybook/semver" "^7.3.2" - "@storybook/store" "6.5.9" + "@storybook/store" "6.5.10" "@types/estree" "^0.0.51" "@types/node" "^14.14.20 || ^16.0.0" "@types/webpack-env" "^1.16.0" @@ -4044,6 +4300,17 @@ util-deprecate "^1.0.2" webpack ">=4.43.0 <6.0.0" +"@storybook/router@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.10.tgz#b0c342e080c1d2b5344603bc43a6c75734a4a879" + integrity sha512-O+vNW/eEpYFF8eCg5jZjNQ6q2DKQVxqDRPCy9pJdEbvavMDZn6AFYgVK+VJe5F4211WW2yncOu922xObCxXJYg== + dependencies: + "@storybook/client-logger" "6.5.10" + core-js "^3.8.2" + memoizerific "^1.11.3" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + "@storybook/router@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.9.tgz#4740248f8517425b2056273fb366ace8a17c65e8" @@ -4079,6 +4346,27 @@ prettier ">=2.2.1 <=2.3.0" regenerator-runtime "^0.13.7" +"@storybook/store@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/store/-/store-6.5.10.tgz#85df17a8d57af0cba3934b3c6046537e2bca9abd" + integrity sha512-RswrSYh2IiKkytFPxP9AvP+hekjrvHK2ILvyDk2ZgduCN4n5ivsekOb+N3M2t+dq1eLuW9or5n2T4OWwAwjxxQ== + dependencies: + "@storybook/addons" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + slash "^3.0.0" + stable "^0.1.8" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/store@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/store/-/store-6.5.9.tgz#dc9963fc013636569082bd8f7200804866373735" @@ -4100,13 +4388,13 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/telemetry@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/telemetry/-/telemetry-6.5.9.tgz#8e1e0d4a89fc2387620045e5ea96c109d16a7247" - integrity sha512-JluoHCRhHAr4X0eUNVBSBi1JIBA92404Tu1TPdbN7x6gCZxHXXPTSUTAnspXp/21cTdMhY2x+kfZQ8fmlGK4MQ== +"@storybook/telemetry@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/telemetry/-/telemetry-6.5.10.tgz#742b05a55dfe8470ce4cb371f3f3f2c02f96e816" + integrity sha512-+M5HILDFS8nDumLxeSeAwi1MTzIuV6UWzV4yB2wcsEXOBTdplcl9oYqFKtlst78oOIdGtpPYxYfivDlqxC2K4g== dependencies: - "@storybook/client-logger" "6.5.9" - "@storybook/core-common" "6.5.9" + "@storybook/client-logger" "6.5.10" + "@storybook/core-common" "6.5.10" chalk "^4.1.0" core-js "^3.8.2" detect-package-manager "^2.0.1" @@ -4118,6 +4406,16 @@ read-pkg-up "^7.0.1" regenerator-runtime "^0.13.7" +"@storybook/theming@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.10.tgz#052100979c1270fc8f60653c1a13a6f047318109" + integrity sha512-BvTQBBcSEwKKcsVmF+Ol6v0RIQUr+bxP7gb10wtfBd23mZTEFA0C1N5FnZr/dDeiBKG1pvf1UKvoYA731y0BsA== + dependencies: + "@storybook/client-logger" "6.5.10" + core-js "^3.8.2" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + "@storybook/theming@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.9.tgz#13f60a3a3cd73ceb5caf9f188e1627e79f1891aa" @@ -4128,6 +4426,26 @@ memoizerific "^1.11.3" regenerator-runtime "^0.13.7" +"@storybook/ui@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.10.tgz#f56095a1a39ae5a203f2ac7f3dba86341a5927d5" + integrity sha512-6iaoaRAiTqB1inTw35vao+5hjcDE0Qa0A3a9ZIeNa6yHvpB1k0lO/N/0PMrRdVvySYpXVD1iry4z4QYdo1rU+w== + dependencies: + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/channels" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/router" "6.5.10" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.10" + core-js "^3.8.2" + memoizerific "^1.11.3" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + resolve-from "^5.0.0" + "@storybook/ui@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.9.tgz#41e59279323cccc0d613974ec9782d797220c8a7" @@ -5500,12 +5818,7 @@ acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1: - version "8.7.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" - integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== - -acorn@^8.8.0: +acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: version "8.8.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== From 4cbea6826f9c00f4f09fde47578d7760b21f841b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:17:28 +0000 Subject: [PATCH 188/203] :arrow_up: Bump @storybook/addon-essentials from 6.5.9 to 6.5.10 Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.9 to 6.5.10. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 459 +++++++++++++++++++++++-------- 2 files changed, 348 insertions(+), 113 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 553a7557..b390c934 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -27,7 +27,7 @@ "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.18.6", "@storybook/addon-actions": "^6.5.9", - "@storybook/addon-essentials": "^6.5.9", + "@storybook/addon-essentials": "^6.5.10", "@storybook/addon-links": "^6.5.9", "@storybook/builder-webpack5": "^6.5.9", "@storybook/manager-webpack5": "^6.5.9", diff --git a/yarn.lock b/yarn.lock index 52953d7f..fd2325b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3239,18 +3239,18 @@ "@stdlib/types" "^0.0.x" debug "^2.6.9" -"@storybook/addon-actions@6.5.9", "@storybook/addon-actions@^6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.5.9.tgz#d50d65631403e1a5b680961429d9c0d7bd383e68" - integrity sha512-wDYm3M1bN+zcYZV3Q24M03b/P8DDpvj1oSoY6VLlxDAi56h8qZB/voeIS2I6vWXOB79C5tbwljYNQO0GsufS0g== +"@storybook/addon-actions@6.5.10", "@storybook/addon-actions@^6.5.9": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.5.10.tgz#83ec807a899e0412cf98037647f256c45cc32bf5" + integrity sha512-vpCnEu81fmtYzOf0QsRYoDuf9wXgVVl2VysE1dWRebRhIUDU0JurrthTnw322e38D4FzaoNGqZE7wnBYBohzZA== dependencies: - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/core-events" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/core-events" "6.5.10" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/theming" "6.5.9" + "@storybook/theming" "6.5.10" core-js "^3.8.2" fast-deep-equal "^3.1.3" global "^4.4.0" @@ -3264,18 +3264,18 @@ util-deprecate "^1.0.2" uuid-browser "^3.1.0" -"@storybook/addon-backgrounds@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-6.5.9.tgz#a9579fc9d73f783a768c6c6ceb97193c5a1ee708" - integrity sha512-9k+GiY5aiANLOct34ar29jqgdi5ZpCqpZ86zPH0GsEC6ifH6nzP4trLU0vFUe260XDCvB4g8YaI7JZKPhozERg== +"@storybook/addon-backgrounds@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-6.5.10.tgz#9ab2d2165fe35d265d9d6013fc174fa8528a272f" + integrity sha512-5uzQda3dh891h7BL8e9Ymk7BI+QgkkzDJXuA4mHjOXfIiD3S3efhJI8amXuBC2ZpIr6zmVit0MqZVyoVve46cQ== dependencies: - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/core-events" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/core-events" "6.5.10" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/theming" "6.5.9" + "@storybook/theming" "6.5.10" core-js "^3.8.2" global "^4.4.0" memoizerific "^1.11.3" @@ -3283,47 +3283,47 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/addon-controls@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-controls/-/addon-controls-6.5.9.tgz#8f6ef939c87b3dbad98f8bda7e124f0b34f668d2" - integrity sha512-VvjkgK32bGURKyWU2No6Q2B0RQZjLZk8D3neVNCnrWxwrl1G82StegxjRPn/UZm9+MZVPvTvI46nj1VdgOktnw== +"@storybook/addon-controls@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-controls/-/addon-controls-6.5.10.tgz#275ddcd0f4dc1a107777b425417a8f252f52a91e" + integrity sha512-lC2y3XcolmQAJwFurIyGrynAHPWmfNtTCdu3rQBTVGwyxCoNwdOOeC2jV0BRqX2+CW6OHzJr9frNWXPSaZ8c4w== dependencies: - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/core-common" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/core-common" "6.5.10" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/node-logger" "6.5.9" - "@storybook/store" "6.5.9" - "@storybook/theming" "6.5.9" + "@storybook/node-logger" "6.5.10" + "@storybook/store" "6.5.10" + "@storybook/theming" "6.5.10" core-js "^3.8.2" lodash "^4.17.21" ts-dedent "^2.0.0" -"@storybook/addon-docs@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-6.5.9.tgz#32b27fb298624afd738c1371a764d7ff4831fe6d" - integrity sha512-9lwOZyiOJFUgGd9ADVfcgpels5o0XOXqGMeVLuzT1160nopbZjNjo/3+YLJ0pyHRPpMJ4rmq2+vxRQR6PVRgPg== +"@storybook/addon-docs@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-6.5.10.tgz#dde18b5659e8033651e139a231a7f69306433b92" + integrity sha512-1kgjo3f0vL6GN8fTwLL05M/q/kDdzvuqwhxPY/v5hubFb3aQZGr2yk9pRBaLAbs4bez0yG0ASXcwhYnrEZUppg== dependencies: "@babel/plugin-transform-react-jsx" "^7.12.12" "@babel/preset-env" "^7.12.11" "@jest/transform" "^26.6.2" "@mdx-js/react" "^1.6.22" - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/core-common" "6.5.9" - "@storybook/core-events" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/core-common" "6.5.10" + "@storybook/core-events" "6.5.10" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/docs-tools" "6.5.9" + "@storybook/docs-tools" "6.5.10" "@storybook/mdx1-csf" "^0.0.1" - "@storybook/node-logger" "6.5.9" - "@storybook/postinstall" "6.5.9" - "@storybook/preview-web" "6.5.9" - "@storybook/source-loader" "6.5.9" - "@storybook/store" "6.5.9" - "@storybook/theming" "6.5.9" + "@storybook/node-logger" "6.5.10" + "@storybook/postinstall" "6.5.10" + "@storybook/preview-web" "6.5.10" + "@storybook/source-loader" "6.5.10" + "@storybook/store" "6.5.10" + "@storybook/theming" "6.5.10" babel-loader "^8.0.0" core-js "^3.8.2" fast-deep-equal "^3.1.3" @@ -3335,23 +3335,23 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/addon-essentials@^6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-essentials/-/addon-essentials-6.5.9.tgz#32ba63acba4d153f4cf6ac33cbbf14b87d260788" - integrity sha512-V9ThjKQsde4A2Es20pLFBsn0MWx2KCJuoTcTsANP4JDcbvEmj8UjbDWbs8jAU+yzJT5r+CI6NoWmQudv12ZOgw== +"@storybook/addon-essentials@^6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-essentials/-/addon-essentials-6.5.10.tgz#d56f0f972e3bd5eae6c79b2126f510c5c020b62d" + integrity sha512-PT2aiR4vgAyB0pl3HNBUa4/a7NDRxASxAazz7zt9ZDirkipDKfxwdcLeRoJzwSngVDWEhuz5/paN5x4eNp4Hww== dependencies: - "@storybook/addon-actions" "6.5.9" - "@storybook/addon-backgrounds" "6.5.9" - "@storybook/addon-controls" "6.5.9" - "@storybook/addon-docs" "6.5.9" - "@storybook/addon-measure" "6.5.9" - "@storybook/addon-outline" "6.5.9" - "@storybook/addon-toolbars" "6.5.9" - "@storybook/addon-viewport" "6.5.9" - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/core-common" "6.5.9" - "@storybook/node-logger" "6.5.9" + "@storybook/addon-actions" "6.5.10" + "@storybook/addon-backgrounds" "6.5.10" + "@storybook/addon-controls" "6.5.10" + "@storybook/addon-docs" "6.5.10" + "@storybook/addon-measure" "6.5.10" + "@storybook/addon-outline" "6.5.10" + "@storybook/addon-toolbars" "6.5.10" + "@storybook/addon-viewport" "6.5.10" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/core-common" "6.5.10" + "@storybook/node-logger" "6.5.10" core-js "^3.8.2" regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" @@ -3374,66 +3374,83 @@ regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" -"@storybook/addon-measure@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-measure/-/addon-measure-6.5.9.tgz#f949d4f5f4025c839634114365f1399ea04bd0ae" - integrity sha512-0aA22wD0CIEUccsEbWkckCOXOwr4VffofMH1ToVCOeqBoyLOMB0gxFubESeprqM54CWsYh2DN1uujgD6508cwA== +"@storybook/addon-measure@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-measure/-/addon-measure-6.5.10.tgz#afac72a15d927f9f2119e2218017d757a8c8c6a4" + integrity sha512-ss7L1H5K5hXygDIoVwj+QyVXbve5V67x7CofLiLCgQYuJzfO16+sPGjiTGWMpTb4ijox2uKWnTkpilt5bCjXgw== dependencies: - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/core-events" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/core-events" "6.5.10" "@storybook/csf" "0.0.2--canary.4566f4d.1" core-js "^3.8.2" global "^4.4.0" -"@storybook/addon-outline@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-outline/-/addon-outline-6.5.9.tgz#6ce9b3fb77e6a1a59607d7657c359c69f26cf6dd" - integrity sha512-oJ1DK3BDJr6aTlZc9axfOxV1oDkZO7hOohgUQDaKO1RZrSpyQsx2ViK2X6p/W7JhFJHKh7rv+nGCaVlLz3YIZA== +"@storybook/addon-outline@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-outline/-/addon-outline-6.5.10.tgz#a49164697344de1bd11d35a5ce21e59afc0dd19c" + integrity sha512-AjdaeQ+/iBKmGrAqRW4niwMB6AkgGnYmSzVs5Cf6F/Sb4Dp+vzgLNOwLABD9qs8Ri8dvHl5J4QpVwQKUhYZaOQ== dependencies: - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/core-events" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/core-events" "6.5.10" "@storybook/csf" "0.0.2--canary.4566f4d.1" core-js "^3.8.2" global "^4.4.0" regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" -"@storybook/addon-toolbars@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-toolbars/-/addon-toolbars-6.5.9.tgz#feedfdac08482d43bb1f3cc00840d80322c5eace" - integrity sha512-6JFQNHYVZUwp17p5rppc+iQJ2QOIWPTF+ni1GMMThjc84mzXs2+899Sf1aPFTvrFJTklmT+bPX6x4aUTouVa1w== +"@storybook/addon-toolbars@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-toolbars/-/addon-toolbars-6.5.10.tgz#750e6c7fa50a54dac7fe5df7b7c239fb02a4456c" + integrity sha512-S0Ljc6Wv+bPbx2e0iTveJ6bBDqjsemu+FZD4qDLsHreoI7DAcqyrF5Def1l8xNohixIVpx8dQpYXRtyzNlXekg== dependencies: - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/theming" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/theming" "6.5.10" core-js "^3.8.2" regenerator-runtime "^0.13.7" -"@storybook/addon-viewport@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-viewport/-/addon-viewport-6.5.9.tgz#fc390ccebea56d2e874ed2fda085c09fe04dd240" - integrity sha512-thKS+iw6M7ueDQQ7M66STZ5rgtJKliAcIX6UCopo0Ffh4RaRYmX6MCjqtvBKk8joyXUvm9SpWQemJD9uBQrjgw== +"@storybook/addon-viewport@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-viewport/-/addon-viewport-6.5.10.tgz#4c6151d7e8177b07df8dcb4c61e842dac949215b" + integrity sha512-RFMd+4kZljyuJjR9OJ2bFXHrSG7VTi5FDZYWEU+4W1sBxzC+JhnVnUP+HJH3gUxEFIRQC5neRzwWRE9RUUoALQ== dependencies: - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/core-events" "6.5.9" - "@storybook/theming" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/theming" "6.5.10" core-js "^3.8.2" global "^4.4.0" memoizerific "^1.11.3" prop-types "^15.7.2" regenerator-runtime "^0.13.7" +"@storybook/addons@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.10.tgz#bff2f8fb8453e9df04fa6dbc41341fd05f4cdeba" + integrity sha512-VD4tBCQ23PkSeDoxuHcKy0RfhIs3oMYjBacOZx7d0bvOzK9WjPyvE2ysDAh7r/ceqnwmWHAScIpE+I1RU7gl+g== + dependencies: + "@storybook/api" "6.5.10" + "@storybook/channels" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.10" + "@storybook/theming" "6.5.10" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + global "^4.4.0" + regenerator-runtime "^0.13.7" + "@storybook/addons@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.9.tgz#5a9d7395c579a9cbc44dfc122362fb3c95dfb9d5" @@ -3451,6 +3468,29 @@ global "^4.4.0" regenerator-runtime "^0.13.7" +"@storybook/api@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.10.tgz#215623844648f0da2ac646fdcdd1345c2e1a8490" + integrity sha512-AkmgSPNEGdKp4oZA4KQ+RJsacw7GwfvjsVDnCkcXqS9zmSr/RNL0fhpcd60KKkmx/hGKPTDFpK3ZayxDrJ/h4A== + dependencies: + "@storybook/channels" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.10" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.10" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/api@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.9.tgz#303733214c9de0422d162f7c54ae05d088b89bf9" @@ -3571,6 +3611,19 @@ webpack-hot-middleware "^2.25.1" webpack-virtual-modules "^0.4.1" +"@storybook/channel-postmessage@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.5.10.tgz#be8971b4b7f91b664bb2c6965fdfb073d541a03e" + integrity sha512-t9PTA0UzFvYa3IlOfpBOolfrRMPTjUMIeCQ6FNyM0aj5GqLKSvoQzP8NeoRpIrvyf6ljFKKdaMaZ3fiCvh45ag== + dependencies: + "@storybook/channels" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + core-js "^3.8.2" + global "^4.4.0" + qs "^6.10.0" + telejson "^6.0.8" + "@storybook/channel-postmessage@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.5.9.tgz#9cf4530f0364cee0d5e58f92d6fb5ce98e10257b" @@ -3595,6 +3648,15 @@ global "^4.4.0" telejson "^6.0.8" +"@storybook/channels@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.10.tgz#fca5b0d1ea8d30b022e805301ed436407c867ac4" + integrity sha512-lo26YZ6kWpHXLhuHJF4P/bICY7jD/rXEZqReKtGOSk1Lv99/xvG6pqmcy3hWLf3v3Dy/8otjRPSR7izFVIIZgQ== + dependencies: + core-js "^3.8.2" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/channels@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.9.tgz#abfab89a6587a2688e9926d4aafeb11c9d8b2e79" @@ -3630,6 +3692,14 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/client-logger@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.10.tgz#cfea823a5b8444409daa74f854c5d05367986b34" + integrity sha512-/xA0MHOevXev68hyLMQw8Qo8KczSIdXOxliAgrycMTkDmw5eKeA8TP7B8zP3wGuq/e3MrdD9/8MWhb/IQBNC3w== + dependencies: + core-js "^3.8.2" + global "^4.4.0" + "@storybook/client-logger@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.9.tgz#dc1669abe8c45af1cc38f74c6f4b15ff33e63014" @@ -3638,6 +3708,20 @@ core-js "^3.8.2" global "^4.4.0" +"@storybook/components@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.10.tgz#268e1269bc3d262f7dcec13f96c3b844919687b8" + integrity sha512-9OhgB8YQfGwOKjo/N96N5mrtJ6qDVVoEM1zuhea32tJUd2eYf0aSWpryA9VnOM0V1q/8DAoCg5rPBMYWMBU5uw== + dependencies: + "@storybook/client-logger" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/theming" "6.5.10" + core-js "^3.8.2" + memoizerific "^1.11.3" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + util-deprecate "^1.0.2" + "@storybook/components@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.9.tgz#97e07ffe11ab76c01ccee380888991bd161f75b2" @@ -3680,6 +3764,62 @@ unfetch "^4.2.0" util-deprecate "^1.0.2" +"@storybook/core-common@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.10.tgz#6b93449548b0890f5c68d89f0ca78e092026182c" + integrity sha512-Bx+VKkfWdrAmD8T51Sjq/mMhRaiapBHcpG4cU5bc3DMbg+LF2/yrgqv/cjVu+m5gHAzYCac5D7gqzBgvG7Myww== + dependencies: + "@babel/core" "^7.12.10" + "@babel/plugin-proposal-class-properties" "^7.12.1" + "@babel/plugin-proposal-decorators" "^7.12.12" + "@babel/plugin-proposal-export-default-from" "^7.12.1" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" + "@babel/plugin-proposal-object-rest-spread" "^7.12.1" + "@babel/plugin-proposal-optional-chaining" "^7.12.7" + "@babel/plugin-proposal-private-methods" "^7.12.1" + "@babel/plugin-proposal-private-property-in-object" "^7.12.1" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-transform-arrow-functions" "^7.12.1" + "@babel/plugin-transform-block-scoping" "^7.12.12" + "@babel/plugin-transform-classes" "^7.12.1" + "@babel/plugin-transform-destructuring" "^7.12.1" + "@babel/plugin-transform-for-of" "^7.12.1" + "@babel/plugin-transform-parameters" "^7.12.1" + "@babel/plugin-transform-shorthand-properties" "^7.12.1" + "@babel/plugin-transform-spread" "^7.12.1" + "@babel/preset-env" "^7.12.11" + "@babel/preset-react" "^7.12.10" + "@babel/preset-typescript" "^7.12.7" + "@babel/register" "^7.12.1" + "@storybook/node-logger" "6.5.10" + "@storybook/semver" "^7.3.2" + "@types/node" "^14.0.10 || ^16.0.0" + "@types/pretty-hrtime" "^1.0.0" + babel-loader "^8.0.0" + babel-plugin-macros "^3.0.1" + babel-plugin-polyfill-corejs3 "^0.1.0" + chalk "^4.1.0" + core-js "^3.8.2" + express "^4.17.1" + file-system-cache "^1.0.5" + find-up "^5.0.0" + fork-ts-checker-webpack-plugin "^6.0.4" + fs-extra "^9.0.1" + glob "^7.1.6" + handlebars "^4.7.7" + interpret "^2.2.0" + json5 "^2.1.3" + lazy-universal-dotenv "^3.0.1" + picomatch "^2.3.0" + pkg-dir "^5.0.0" + pretty-hrtime "^1.0.3" + resolve-from "^5.0.0" + slash "^3.0.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + webpack "4" + "@storybook/core-common@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.9.tgz#7ca8258ea2634b1d64695c1e4262f71cc7457989" @@ -3736,6 +3876,13 @@ util-deprecate "^1.0.2" webpack "4" +"@storybook/core-events@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.10.tgz#66d87c8ea18db8e448018a16a3d0198ddbcbc683" + integrity sha512-EVb1gO1172klVIAABLOoigFMx0V88uctY0K/qVCO8n6v+wd2+0Ccn63kl+gTxsAC3WZ8XhXh9q2w5ImHklVECw== + dependencies: + core-js "^3.8.2" + "@storybook/core-events@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.9.tgz#5b0783c7d22a586c0f5e927a61fe1b1223e19637" @@ -3829,6 +3976,19 @@ dependencies: lodash "^4.17.15" +"@storybook/docs-tools@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/docs-tools/-/docs-tools-6.5.10.tgz#30baa62c1ca3a18b13625b6b305e23e39f404416" + integrity sha512-/bvYgOO+CxMEcHifkjJg0A60OTGOhcjGxnsB1h0gJuxMrqA/7Qwc108bFmPiX0eiD1BovFkZLJV4O6OY7zP5Vw== + dependencies: + "@babel/core" "^7.12.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/store" "6.5.10" + core-js "^3.8.2" + doctrine "^3.0.0" + lodash "^4.17.21" + regenerator-runtime "^0.13.7" + "@storybook/docs-tools@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/docs-tools/-/docs-tools-6.5.9.tgz#5ff304f881e972ce14923a5ffcfed3f052094889" @@ -3938,7 +4098,18 @@ prettier ">=2.2.1 <=2.3.0" ts-dedent "^2.0.0" -"@storybook/node-logger@6.5.9", "@storybook/node-logger@^6.5.9": +"@storybook/node-logger@6.5.10", "@storybook/node-logger@^6.5.9": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.10.tgz#bce4c04009c4b62d6d2fb617176d7ef0084e9e89" + integrity sha512-bYswXIKV7Stru8vYfkjUMNN8UhF7Qg7NRsUvG5Djt5lLIae1XmUIgnH40mU/nW4X4BSfcR9MKxsSsngvn2WmQg== + dependencies: + "@types/npmlog" "^4.1.2" + chalk "^4.1.0" + core-js "^3.8.2" + npmlog "^5.0.1" + pretty-hrtime "^1.0.3" + +"@storybook/node-logger@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.9.tgz#129cfe0d0f79cab4f6a2ba194d39516680b1626f" integrity sha512-nZZNZG2Wtwv6Trxi3FrnIqUmB55xO+X/WQGPT5iKlqNjdRIu/T72mE7addcp4rbuWCQfZUhcDDGpBOwKtBxaGg== @@ -3949,10 +4120,10 @@ npmlog "^5.0.1" pretty-hrtime "^1.0.3" -"@storybook/postinstall@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-6.5.9.tgz#a5a2565808e9d7bc310e78c279b09ce337fe3457" - integrity sha512-KQBupK+FMRrtSt8IL0MzCZ/w9qbd25Yxxp/+ajfWgZTRgsWgVFOqcDyMhS16eNbBp5qKIBCBDXfEF+/mK8HwQQ== +"@storybook/postinstall@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-6.5.10.tgz#b25378da036bce7b318c6732733aa5ad43449f37" + integrity sha512-xqUdpnFHYkn8MgtV+QztvIsRWa6jQUk7QT1Mu17Y0S7PbslNGsuskRPHenHhACXBJF+TM86R+4BaAhnVYTmElw== dependencies: core-js "^3.8.2" @@ -3968,6 +4139,28 @@ pnp-webpack-plugin "^1.7.0" semver "^7.3.5" +"@storybook/preview-web@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/preview-web/-/preview-web-6.5.10.tgz#81bf5d3f5fca9e26099c057206bd8e684225989b" + integrity sha512-sTC/o5gkvALOtcNgtApGKGN9EavvSxRHBeBh+5BQjV2qQ8ap+26RsfUizNBECAa2Jrn4osaDYn9HRhJLFL69WA== + dependencies: + "@storybook/addons" "6.5.10" + "@storybook/channel-postmessage" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/store" "6.5.10" + ansi-to-html "^0.6.11" + core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.21" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + unfetch "^4.2.0" + util-deprecate "^1.0.2" + "@storybook/preview-web@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/preview-web/-/preview-web-6.5.9.tgz#557d919e6df50d66259521aa36ebf4055bbd236e" @@ -4044,6 +4237,17 @@ util-deprecate "^1.0.2" webpack ">=4.43.0 <6.0.0" +"@storybook/router@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.10.tgz#b0c342e080c1d2b5344603bc43a6c75734a4a879" + integrity sha512-O+vNW/eEpYFF8eCg5jZjNQ6q2DKQVxqDRPCy9pJdEbvavMDZn6AFYgVK+VJe5F4211WW2yncOu922xObCxXJYg== + dependencies: + "@storybook/client-logger" "6.5.10" + core-js "^3.8.2" + memoizerific "^1.11.3" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + "@storybook/router@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.9.tgz#4740248f8517425b2056273fb366ace8a17c65e8" @@ -4063,13 +4267,13 @@ core-js "^3.6.5" find-up "^4.1.0" -"@storybook/source-loader@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/source-loader/-/source-loader-6.5.9.tgz#7b6f065c6a6108c4b4ca7e45bfd78707373d84ac" - integrity sha512-H03nFKaP6borfWMTTa9igBA+Jm2ph+FoVJImWC/X+LAmLSJYYSXuqSgmiZ/DZvbjxS4k8vccE2HXogne1IvaRA== +"@storybook/source-loader@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/source-loader/-/source-loader-6.5.10.tgz#f62b4c7b1933976a20913ddc149d55026ef4c872" + integrity sha512-1RxxRumpjs8VUUwES9LId+cuNQnixhZAcwCxd6jaKkTZbjiQCtAhXX6DBTjJGV1u/JnCsqEp5b1wB8j/EioNHw== dependencies: - "@storybook/addons" "6.5.9" - "@storybook/client-logger" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/client-logger" "6.5.10" "@storybook/csf" "0.0.2--canary.4566f4d.1" core-js "^3.8.2" estraverse "^5.2.0" @@ -4079,6 +4283,27 @@ prettier ">=2.2.1 <=2.3.0" regenerator-runtime "^0.13.7" +"@storybook/store@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/store/-/store-6.5.10.tgz#85df17a8d57af0cba3934b3c6046537e2bca9abd" + integrity sha512-RswrSYh2IiKkytFPxP9AvP+hekjrvHK2ILvyDk2ZgduCN4n5ivsekOb+N3M2t+dq1eLuW9or5n2T4OWwAwjxxQ== + dependencies: + "@storybook/addons" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + slash "^3.0.0" + stable "^0.1.8" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/store@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/store/-/store-6.5.9.tgz#dc9963fc013636569082bd8f7200804866373735" @@ -4118,6 +4343,16 @@ read-pkg-up "^7.0.1" regenerator-runtime "^0.13.7" +"@storybook/theming@6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.10.tgz#052100979c1270fc8f60653c1a13a6f047318109" + integrity sha512-BvTQBBcSEwKKcsVmF+Ol6v0RIQUr+bxP7gb10wtfBd23mZTEFA0C1N5FnZr/dDeiBKG1pvf1UKvoYA731y0BsA== + dependencies: + "@storybook/client-logger" "6.5.10" + core-js "^3.8.2" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + "@storybook/theming@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.9.tgz#13f60a3a3cd73ceb5caf9f188e1627e79f1891aa" From b65102721ee2c4e0754f90123844856f42d31636 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:32:10 +0000 Subject: [PATCH 189/203] :arrow_up: Bump @storybook/manager-webpack5 from 6.5.9 to 6.5.10 Bumps [@storybook/manager-webpack5](https://github.com/storybookjs/storybook/tree/HEAD/lib/core) from 6.5.9 to 6.5.10. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/lib/core) --- updated-dependencies: - dependency-name: "@storybook/manager-webpack5" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 99 ++++---------------------------- 2 files changed, 12 insertions(+), 89 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 82759121..0b86d5c5 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -30,7 +30,7 @@ "@storybook/addon-essentials": "^6.5.10", "@storybook/addon-links": "^6.5.9", "@storybook/builder-webpack5": "^6.5.9", - "@storybook/manager-webpack5": "^6.5.9", + "@storybook/manager-webpack5": "^6.5.10", "@storybook/node-logger": "^6.5.9", "@storybook/preset-create-react-app": "^4.1.2", "@storybook/react": "^6.5.10", diff --git a/yarn.lock b/yarn.lock index b084669b..9783e70c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1376,14 +1376,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-template-literals@^7.12.1": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.2.tgz#31ed6915721864847c48b656281d0098ea1add28" - integrity sha512-/cmuBVw9sZBGZVOMkpAEaVLwm4JmK2GZ1dFKOGGpMzEHWFmyZZ59lUU0PdRr8YNYeQdNzTDwuxP2X2gzydTc9g== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-template-literals@^7.18.6": +"@babel/plugin-transform-template-literals@^7.12.1", "@babel/plugin-transform-template-literals@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.6.tgz#b763f4dc9d11a7cce58cf9a490d82e80547db9c2" integrity sha512-UuqlRrQmT2SWRvahW46cGSany0uTlcj8NYOS5sRGYi8FxPYPoLd5DDmMd32ZXEj2Jq+06uGVQKHxa/hJx2EzKw== @@ -3648,17 +3641,6 @@ global "^4.4.0" telejson "^6.0.8" -"@storybook/channel-websocket@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-6.5.9.tgz#6b7a0127fec58ee5be4f6aebcf460adc564f2f34" - integrity sha512-xtHvSNwuOhkgALwVshKWsoFhDmuvcosdYfxcfFGEiYKXIu46tRS5ZXmpmgEC/0JAVkVoFj5nL8bV7IY5np6oaA== - dependencies: - "@storybook/channels" "6.5.9" - "@storybook/client-logger" "6.5.9" - core-js "^3.8.2" - global "^4.4.0" - telejson "^6.0.8" - "@storybook/channels@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.10.tgz#fca5b0d1ea8d30b022e805301ed436407c867ac4" @@ -3801,32 +3783,6 @@ unfetch "^4.2.0" util-deprecate "^1.0.2" -"@storybook/core-client@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.9.tgz#ea6035d1c90d2c68e860e3cf629979491856cd88" - integrity sha512-LY0QbhShowO+PQx3gao3wdVjpKMH1AaSLmuI95FrcjoMmSXGf96jVLKQp9mJRGeHIsAa93EQBYuCihZycM3Kbg== - dependencies: - "@storybook/addons" "6.5.9" - "@storybook/channel-postmessage" "6.5.9" - "@storybook/channel-websocket" "6.5.9" - "@storybook/client-api" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/core-events" "6.5.9" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/preview-web" "6.5.9" - "@storybook/store" "6.5.9" - "@storybook/ui" "6.5.9" - airbnb-js-shims "^2.2.1" - ansi-to-html "^0.6.11" - core-js "^3.8.2" - global "^4.4.0" - lodash "^4.17.21" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - unfetch "^4.2.0" - util-deprecate "^1.0.2" - "@storybook/core-common@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.10.tgz#6b93449548b0890f5c68d89f0ca78e092026182c" @@ -4052,19 +4008,6 @@ lodash "^4.17.21" regenerator-runtime "^0.13.7" -"@storybook/docs-tools@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/docs-tools/-/docs-tools-6.5.9.tgz#5ff304f881e972ce14923a5ffcfed3f052094889" - integrity sha512-UoTaXLvec8x+q+4oYIk/t8DBju9C3ZTGklqOxDIt+0kS3TFAqEgI3JhKXqQOXgN5zDcvLVSxi8dbVAeSxk2ktA== - dependencies: - "@babel/core" "^7.12.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/store" "6.5.9" - core-js "^3.8.2" - doctrine "^3.0.0" - lodash "^4.17.21" - regenerator-runtime "^0.13.7" - "@storybook/manager-webpack4@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/manager-webpack4/-/manager-webpack4-6.5.10.tgz#41bae252b863484f293954ef2d2dc80bf3e028f1" @@ -4106,20 +4049,20 @@ webpack-dev-middleware "^3.7.3" webpack-virtual-modules "^0.2.2" -"@storybook/manager-webpack5@^6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/manager-webpack5/-/manager-webpack5-6.5.9.tgz#ce9dd6ea6298ab426b111f170c23deea7085ba08" - integrity sha512-J1GamphSsaZLNBEhn1awgxzOS8KfvzrHtVlAm2VHwW7j1E1DItROFJhGCgduYYuBiN9eqm+KIYrxcr6cRuoolQ== +"@storybook/manager-webpack5@^6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/manager-webpack5/-/manager-webpack5-6.5.10.tgz#dff8e53615906284b68df013935e8a6234ddaafe" + integrity sha512-uRo+6e5MiVOtyFVMYIKVqvpDveCjHyzXBfetSYR7rKEZoaDMEnLLiuF7DIH12lzxwmzCJ1gIc4lf5HFiTMNkgw== dependencies: "@babel/core" "^7.12.10" "@babel/plugin-transform-template-literals" "^7.12.1" "@babel/preset-react" "^7.12.10" - "@storybook/addons" "6.5.9" - "@storybook/core-client" "6.5.9" - "@storybook/core-common" "6.5.9" - "@storybook/node-logger" "6.5.9" - "@storybook/theming" "6.5.9" - "@storybook/ui" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/core-client" "6.5.10" + "@storybook/core-common" "6.5.10" + "@storybook/node-logger" "6.5.10" + "@storybook/theming" "6.5.10" + "@storybook/ui" "6.5.10" "@types/node" "^14.0.10 || ^16.0.0" babel-loader "^8.0.0" case-sensitive-paths-webpack-plugin "^2.3.0" @@ -4446,26 +4389,6 @@ regenerator-runtime "^0.13.7" resolve-from "^5.0.0" -"@storybook/ui@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.9.tgz#41e59279323cccc0d613974ec9782d797220c8a7" - integrity sha512-ryuPxJgtbb0gPXKGgGAUC+Z185xGAd1IvQ0jM5fJ0SisHXI8jteG3RaWhntOehi9qCg+64Vv6eH/cj9QYNHt1Q== - dependencies: - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/channels" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/core-events" "6.5.9" - "@storybook/router" "6.5.9" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.5.9" - core-js "^3.8.2" - memoizerific "^1.11.3" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - resolve-from "^5.0.0" - "@surma/rollup-plugin-off-main-thread@^2.2.3": version "2.2.3" resolved "https://registry.yarnpkg.com/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.3.tgz#ee34985952ca21558ab0d952f00298ad2190c053" From cc86186e0aca4c8b2006b0d78e0412b14c7eb88a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:32:35 +0000 Subject: [PATCH 190/203] :arrow_up: Bump @storybook/addon-links from 6.5.9 to 6.5.10 Bumps [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/addons/links) from 6.5.9 to 6.5.10. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/addons/links) --- updated-dependencies: - dependency-name: "@storybook/addon-links" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 29 ++++++++--------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 82759121..61303bc6 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -28,7 +28,7 @@ "@babel/plugin-proposal-private-property-in-object": "^7.18.6", "@storybook/addon-actions": "^6.5.9", "@storybook/addon-essentials": "^6.5.10", - "@storybook/addon-links": "^6.5.9", + "@storybook/addon-links": "^6.5.10", "@storybook/builder-webpack5": "^6.5.9", "@storybook/manager-webpack5": "^6.5.9", "@storybook/node-logger": "^6.5.9", diff --git a/yarn.lock b/yarn.lock index b084669b..f9081939 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3356,16 +3356,16 @@ regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" -"@storybook/addon-links@^6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.9.tgz#91cbca0c044796badf2498723fdd10dacea5748b" - integrity sha512-4BYC7pkxL3NLRnEgTA9jpIkObQKril+XFj1WtmY/lngF90vvK0Kc/TtvTA2/5tSgrHfxEuPevIdxMIyLJ4ejWQ== +"@storybook/addon-links@^6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.10.tgz#f66568fbc84b942032ac2de85f799d69fcf77922" + integrity sha512-r3WzYIPz7WjHiaPObC2Tg6bHuZRBb/Kt/X+Eitw+jTqBel7ksvkO36tn81q8Eyj61qIdNQmUWAaX/0aewT0kLA== dependencies: - "@storybook/addons" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/core-events" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/core-events" "6.5.10" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.9" + "@storybook/router" "6.5.10" "@types/qs" "^6.9.5" core-js "^3.8.2" global "^4.4.0" @@ -4052,19 +4052,6 @@ lodash "^4.17.21" regenerator-runtime "^0.13.7" -"@storybook/docs-tools@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/docs-tools/-/docs-tools-6.5.9.tgz#5ff304f881e972ce14923a5ffcfed3f052094889" - integrity sha512-UoTaXLvec8x+q+4oYIk/t8DBju9C3ZTGklqOxDIt+0kS3TFAqEgI3JhKXqQOXgN5zDcvLVSxi8dbVAeSxk2ktA== - dependencies: - "@babel/core" "^7.12.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/store" "6.5.9" - core-js "^3.8.2" - doctrine "^3.0.0" - lodash "^4.17.21" - regenerator-runtime "^0.13.7" - "@storybook/manager-webpack4@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/manager-webpack4/-/manager-webpack4-6.5.10.tgz#41bae252b863484f293954ef2d2dc80bf3e028f1" From 0092923543f608f852546807b92dd50b15734b69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:35:32 +0000 Subject: [PATCH 191/203] :arrow_up: Bump @testing-library/user-event from 14.3.0 to 14.4.1 Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 14.3.0 to 14.4.1. - [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.3...v14.4.1) --- updated-dependencies: - dependency-name: "@testing-library/user-event" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 21 ++++----------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 82759121..75c1ed40 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.4", "@testing-library/react": "^13.3.0", - "@testing-library/user-event": "^14.3.0", + "@testing-library/user-event": "^14.4.1", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.182", "@types/node": "^18.6.3", diff --git a/yarn.lock b/yarn.lock index b084669b..140407a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4052,19 +4052,6 @@ lodash "^4.17.21" regenerator-runtime "^0.13.7" -"@storybook/docs-tools@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/docs-tools/-/docs-tools-6.5.9.tgz#5ff304f881e972ce14923a5ffcfed3f052094889" - integrity sha512-UoTaXLvec8x+q+4oYIk/t8DBju9C3ZTGklqOxDIt+0kS3TFAqEgI3JhKXqQOXgN5zDcvLVSxi8dbVAeSxk2ktA== - dependencies: - "@babel/core" "^7.12.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/store" "6.5.9" - core-js "^3.8.2" - doctrine "^3.0.0" - lodash "^4.17.21" - regenerator-runtime "^0.13.7" - "@storybook/manager-webpack4@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/manager-webpack4/-/manager-webpack4-6.5.10.tgz#41bae252b863484f293954ef2d2dc80bf3e028f1" @@ -4728,10 +4715,10 @@ "@testing-library/dom" "^8.5.0" "@types/react-dom" "^18.0.0" -"@testing-library/user-event@^14.3.0": - version "14.3.0" - resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.3.0.tgz#0a6750b94b40e4739706d41e8efc2ccf64d2aad9" - integrity sha512-P02xtBBa8yMaLhK8CzJCIns8rqwnF6FxhR9zs810flHOBXUYCFjLd8Io1rQrAkQRWEmW2PGdZIEdMxf/KLsqFA== +"@testing-library/user-event@^14.4.1": + version "14.4.1" + resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.4.1.tgz#dfa1cceef4833f5288a4090d1b85dce5d8dc20b6" + integrity sha512-Gr20dje1RaNxZ1ehHGPvFkLswfetBQKCfRD/lo6sUJQ52X2TV/QnqUpkjoShfEebrB2KiTPfQkcONwdQiofLhg== "@tootallnate/once@1": version "1.1.2" From 0e7ea923d5263678efdeb8f839dc72641443cbef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:51:23 +0000 Subject: [PATCH 192/203] :arrow_up: Bump @storybook/builder-webpack5 from 6.5.9 to 6.5.10 Bumps [@storybook/builder-webpack5](https://github.com/storybookjs/storybook/tree/HEAD/lib/core) from 6.5.9 to 6.5.10. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.10/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.10/lib/core) --- updated-dependencies: - dependency-name: "@storybook/builder-webpack5" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 347 ++----------------------------- 2 files changed, 21 insertions(+), 328 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index cb6397b2..54421a8c 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -29,7 +29,7 @@ "@storybook/addon-actions": "^6.5.9", "@storybook/addon-essentials": "^6.5.10", "@storybook/addon-links": "^6.5.10", - "@storybook/builder-webpack5": "^6.5.9", + "@storybook/builder-webpack5": "^6.5.10", "@storybook/manager-webpack5": "^6.5.10", "@storybook/node-logger": "^6.5.9", "@storybook/preset-create-react-app": "^4.1.2", diff --git a/yarn.lock b/yarn.lock index 4443a68b..c13f2b77 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1555,7 +1555,7 @@ core-js-pure "^3.20.2" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.6", "@babel/runtime@^7.18.9", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.0", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.6", "@babel/runtime@^7.18.9", "@babel/runtime@^7.5.0", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== @@ -3444,23 +3444,6 @@ global "^4.4.0" regenerator-runtime "^0.13.7" -"@storybook/addons@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.9.tgz#5a9d7395c579a9cbc44dfc122362fb3c95dfb9d5" - integrity sha512-adwdiXg+mntfPocLc1KXjZXyLgGk7Aac699Fwe+OUYPEC5tW347Rm/kFatcE556d42o5czcRiq3ZSIGWnm9ieQ== - dependencies: - "@storybook/api" "6.5.9" - "@storybook/channels" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/core-events" "6.5.9" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.9" - "@storybook/theming" "6.5.9" - "@types/webpack-env" "^1.16.0" - core-js "^3.8.2" - global "^4.4.0" - regenerator-runtime "^0.13.7" - "@storybook/api@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.10.tgz#215623844648f0da2ac646fdcdd1345c2e1a8490" @@ -3484,29 +3467,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/api@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.9.tgz#303733214c9de0422d162f7c54ae05d088b89bf9" - integrity sha512-9ylztnty4Y+ALU/ehW3BML9czjCAFsWvrwuCi6UgcwNjswwjSX3VRLhfD1KT3pl16ho//95LgZ0LnSwROCcPOA== - dependencies: - "@storybook/channels" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/core-events" "6.5.9" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.9" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.5.9" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.21" - memoizerific "^1.11.3" - regenerator-runtime "^0.13.7" - store2 "^2.12.0" - telejson "^6.0.8" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/builder-webpack4@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.5.10.tgz#79e95323577a37349ab3c81193fa249ac5c50173" @@ -3560,27 +3520,27 @@ webpack-hot-middleware "^2.25.1" webpack-virtual-modules "^0.2.2" -"@storybook/builder-webpack5@^6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/builder-webpack5/-/builder-webpack5-6.5.9.tgz#30b4e08622daff104bcccd015d3ee7902f99dd99" - integrity sha512-NUVZ4Qci6HWPuoH8U/zQkdBO5soGgu7QYrGC/LWU0tRfmmZxkjr7IUU14ppDpGPYgx3r7jkaQI1J/E1YEmSCWQ== +"@storybook/builder-webpack5@^6.5.10": + version "6.5.10" + resolved "https://registry.yarnpkg.com/@storybook/builder-webpack5/-/builder-webpack5-6.5.10.tgz#de78a8a262410bbe65eecc62f2beaed1fe44dd5d" + integrity sha512-Hcsm/TzGRXHndgQCftt+pzI7GQJRqAv8A8ie5b3aFcodhJfK0qzZsQD4Y4ZWxXh1I/xe5t74Kl2qUJ40PX+geA== dependencies: "@babel/core" "^7.12.10" - "@storybook/addons" "6.5.9" - "@storybook/api" "6.5.9" - "@storybook/channel-postmessage" "6.5.9" - "@storybook/channels" "6.5.9" - "@storybook/client-api" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/components" "6.5.9" - "@storybook/core-common" "6.5.9" - "@storybook/core-events" "6.5.9" - "@storybook/node-logger" "6.5.9" - "@storybook/preview-web" "6.5.9" - "@storybook/router" "6.5.9" + "@storybook/addons" "6.5.10" + "@storybook/api" "6.5.10" + "@storybook/channel-postmessage" "6.5.10" + "@storybook/channels" "6.5.10" + "@storybook/client-api" "6.5.10" + "@storybook/client-logger" "6.5.10" + "@storybook/components" "6.5.10" + "@storybook/core-common" "6.5.10" + "@storybook/core-events" "6.5.10" + "@storybook/node-logger" "6.5.10" + "@storybook/preview-web" "6.5.10" + "@storybook/router" "6.5.10" "@storybook/semver" "^7.3.2" - "@storybook/store" "6.5.9" - "@storybook/theming" "6.5.9" + "@storybook/store" "6.5.10" + "@storybook/theming" "6.5.10" "@types/node" "^14.0.10 || ^16.0.0" babel-loader "^8.0.0" babel-plugin-named-exports-order "^0.0.2" @@ -3617,19 +3577,6 @@ qs "^6.10.0" telejson "^6.0.8" -"@storybook/channel-postmessage@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.5.9.tgz#9cf4530f0364cee0d5e58f92d6fb5ce98e10257b" - integrity sha512-pX/0R8UW7ezBhCrafRaL20OvMRcmESYvQQCDgjqSzJyHkcG51GOhsd6Ge93eJ6QvRMm9+w0Zs93N2VKjVtz0Qw== - dependencies: - "@storybook/channels" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/core-events" "6.5.9" - core-js "^3.8.2" - global "^4.4.0" - qs "^6.10.0" - telejson "^6.0.8" - "@storybook/channel-websocket@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-6.5.10.tgz#bd1316a9b555229b215e5054a76b57c503dd8adc" @@ -3650,15 +3597,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/channels@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.9.tgz#abfab89a6587a2688e9926d4aafeb11c9d8b2e79" - integrity sha512-FvGA35nV38UPXWOl9ERapFTJaxwSTamQ339s2Ev7E9riyRG+GRkgTWzf5kECJgS1PAYKd/7m/RqKJT9BVv6A5g== - dependencies: - core-js "^3.8.2" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/client-api@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.10.tgz#0bc3f68ce014ce1ffd560472a893ba04be370f09" @@ -3685,32 +3623,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/client-api@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.9.tgz#3e4a8ec1d277fd81325c5d959c553161a85fa182" - integrity sha512-pc7JKJoWLesixUKvG2nV36HukUuYoGRyAgD3PpIV7qSBS4JixqZ3VAHFUtqV1UzfOSQTovLSl4a0rIRnpie6gA== - dependencies: - "@storybook/addons" "6.5.9" - "@storybook/channel-postmessage" "6.5.9" - "@storybook/channels" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/core-events" "6.5.9" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/store" "6.5.9" - "@types/qs" "^6.9.5" - "@types/webpack-env" "^1.16.0" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.21" - memoizerific "^1.11.3" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - store2 "^2.12.0" - synchronous-promise "^2.0.15" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/client-logger@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.10.tgz#cfea823a5b8444409daa74f854c5d05367986b34" @@ -3719,14 +3631,6 @@ core-js "^3.8.2" global "^4.4.0" -"@storybook/client-logger@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.9.tgz#dc1669abe8c45af1cc38f74c6f4b15ff33e63014" - integrity sha512-DOHL6p0uiDd3gV/Sb2FR+Vh6OiPrrf8BrA06uvXWsMRIIvEEvnparxv9EvPg7FlmUX0T3nq7d3juwjx4F8Wbcg== - dependencies: - core-js "^3.8.2" - global "^4.4.0" - "@storybook/components@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.10.tgz#268e1269bc3d262f7dcec13f96c3b844919687b8" @@ -3741,22 +3645,6 @@ regenerator-runtime "^0.13.7" util-deprecate "^1.0.2" -"@storybook/components@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.9.tgz#97e07ffe11ab76c01ccee380888991bd161f75b2" - integrity sha512-BhfX980O9zn/1J4FNMeDo8ZvL1m5Ml3T4HRpfYmEBnf8oW5b5BeF6S2K2cwFStZRjWqm1feUcwNpZxCBVMkQnQ== - dependencies: - "@storybook/client-logger" "6.5.9" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/theming" "6.5.9" - "@types/react-syntax-highlighter" "11.0.5" - core-js "^3.8.2" - memoizerific "^1.11.3" - qs "^6.10.0" - react-syntax-highlighter "^15.4.5" - regenerator-runtime "^0.13.7" - util-deprecate "^1.0.2" - "@storybook/core-client@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.10.tgz#90c86923236c8efff33d454a0dc552f6df4346b1" @@ -3839,62 +3727,6 @@ util-deprecate "^1.0.2" webpack "4" -"@storybook/core-common@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.9.tgz#7ca8258ea2634b1d64695c1e4262f71cc7457989" - integrity sha512-NxOK0mrOCo0TWZ7Npc5HU66EKoRHlrtg18/ZixblLDWQMIqY9XCck8K1kJ8QYpYCHla+aHIsYUArFe2vhlEfZA== - dependencies: - "@babel/core" "^7.12.10" - "@babel/plugin-proposal-class-properties" "^7.12.1" - "@babel/plugin-proposal-decorators" "^7.12.12" - "@babel/plugin-proposal-export-default-from" "^7.12.1" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" - "@babel/plugin-proposal-object-rest-spread" "^7.12.1" - "@babel/plugin-proposal-optional-chaining" "^7.12.7" - "@babel/plugin-proposal-private-methods" "^7.12.1" - "@babel/plugin-proposal-private-property-in-object" "^7.12.1" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-transform-arrow-functions" "^7.12.1" - "@babel/plugin-transform-block-scoping" "^7.12.12" - "@babel/plugin-transform-classes" "^7.12.1" - "@babel/plugin-transform-destructuring" "^7.12.1" - "@babel/plugin-transform-for-of" "^7.12.1" - "@babel/plugin-transform-parameters" "^7.12.1" - "@babel/plugin-transform-shorthand-properties" "^7.12.1" - "@babel/plugin-transform-spread" "^7.12.1" - "@babel/preset-env" "^7.12.11" - "@babel/preset-react" "^7.12.10" - "@babel/preset-typescript" "^7.12.7" - "@babel/register" "^7.12.1" - "@storybook/node-logger" "6.5.9" - "@storybook/semver" "^7.3.2" - "@types/node" "^14.0.10 || ^16.0.0" - "@types/pretty-hrtime" "^1.0.0" - babel-loader "^8.0.0" - babel-plugin-macros "^3.0.1" - babel-plugin-polyfill-corejs3 "^0.1.0" - chalk "^4.1.0" - core-js "^3.8.2" - express "^4.17.1" - file-system-cache "^1.0.5" - find-up "^5.0.0" - fork-ts-checker-webpack-plugin "^6.0.4" - fs-extra "^9.0.1" - glob "^7.1.6" - handlebars "^4.7.7" - interpret "^2.2.0" - json5 "^2.1.3" - lazy-universal-dotenv "^3.0.1" - picomatch "^2.3.0" - pkg-dir "^5.0.0" - pretty-hrtime "^1.0.3" - resolve-from "^5.0.0" - slash "^3.0.0" - telejson "^6.0.8" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - webpack "4" - "@storybook/core-events@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.10.tgz#66d87c8ea18db8e448018a16a3d0198ddbcbc683" @@ -3902,13 +3734,6 @@ dependencies: core-js "^3.8.2" -"@storybook/core-events@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.9.tgz#5b0783c7d22a586c0f5e927a61fe1b1223e19637" - integrity sha512-tXt7a3ZvJOCeEKpNa/B5rQM5VI7UJLlOh3IHOImWn4HqoBRrZvbourmac+PRZAtXpos0h3c6554Hjapj/Sny5Q== - dependencies: - core-js "^3.8.2" - "@storybook/core-server@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.5.10.tgz#ada3d647833c02cb8c742281c1f314ff866f96f8" @@ -4115,17 +3940,6 @@ npmlog "^5.0.1" pretty-hrtime "^1.0.3" -"@storybook/node-logger@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.9.tgz#129cfe0d0f79cab4f6a2ba194d39516680b1626f" - integrity sha512-nZZNZG2Wtwv6Trxi3FrnIqUmB55xO+X/WQGPT5iKlqNjdRIu/T72mE7addcp4rbuWCQfZUhcDDGpBOwKtBxaGg== - dependencies: - "@types/npmlog" "^4.1.2" - chalk "^4.1.0" - core-js "^3.8.2" - npmlog "^5.0.1" - pretty-hrtime "^1.0.3" - "@storybook/postinstall@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-6.5.10.tgz#b25378da036bce7b318c6732733aa5ad43449f37" @@ -4167,28 +3981,6 @@ unfetch "^4.2.0" util-deprecate "^1.0.2" -"@storybook/preview-web@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/preview-web/-/preview-web-6.5.9.tgz#557d919e6df50d66259521aa36ebf4055bbd236e" - integrity sha512-4eMrO2HJyZUYyL/j+gUaDvry6iGedshwT5MQqe7J9FaA+Q2pNARQRB1X53f410w7S4sObRmYIAIluWPYdWym9w== - dependencies: - "@storybook/addons" "6.5.9" - "@storybook/channel-postmessage" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/core-events" "6.5.9" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/store" "6.5.9" - ansi-to-html "^0.6.11" - core-js "^3.8.2" - global "^4.4.0" - lodash "^4.17.21" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - synchronous-promise "^2.0.15" - ts-dedent "^2.0.0" - unfetch "^4.2.0" - util-deprecate "^1.0.2" - "@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0", "@storybook/react-docgen-typescript-plugin@canary": version "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0" resolved "https://registry.yarnpkg.com/@storybook/react-docgen-typescript-plugin/-/react-docgen-typescript-plugin-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0.tgz#3103532ff494fb7dc3cf835f10740ecf6a26c0f9" @@ -4254,17 +4046,6 @@ qs "^6.10.0" regenerator-runtime "^0.13.7" -"@storybook/router@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.9.tgz#4740248f8517425b2056273fb366ace8a17c65e8" - integrity sha512-G2Xp/2r8vU2O34eelE+G5VbEEVFDeHcCURrVJEROh6dq2asFJAPbzslVXSeCqgOTNLSpRDJ2NcN5BckkNqmqJg== - dependencies: - "@storybook/client-logger" "6.5.9" - core-js "^3.8.2" - memoizerific "^1.11.3" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - "@storybook/semver@^7.3.2": version "7.3.2" resolved "https://registry.yarnpkg.com/@storybook/semver/-/semver-7.3.2.tgz#f3b9c44a1c9a0b933c04e66d0048fcf2fa10dac0" @@ -4310,27 +4091,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/store@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/store/-/store-6.5.9.tgz#dc9963fc013636569082bd8f7200804866373735" - integrity sha512-80pcDTcCwK6wUA63aWOp13urI77jfipIVee9mpVvbNyfrNN8kGv1BS0z/JHDxuV6rC4g7LG1fb+BurR0yki7BA== - dependencies: - "@storybook/addons" "6.5.9" - "@storybook/client-logger" "6.5.9" - "@storybook/core-events" "6.5.9" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.21" - memoizerific "^1.11.3" - regenerator-runtime "^0.13.7" - slash "^3.0.0" - stable "^0.1.8" - synchronous-promise "^2.0.15" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/telemetry@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/telemetry/-/telemetry-6.5.10.tgz#742b05a55dfe8470ce4cb371f3f3f2c02f96e816" @@ -4359,16 +4119,6 @@ memoizerific "^1.11.3" regenerator-runtime "^0.13.7" -"@storybook/theming@6.5.9": - version "6.5.9" - resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.9.tgz#13f60a3a3cd73ceb5caf9f188e1627e79f1891aa" - integrity sha512-KM0AMP5jMQPAdaO8tlbFCYqx9uYM/hZXGSVUhznhLYu7bhNAIK7ZVmXxyE/z/khM++8eUHzRoZGiO/cwCkg9Xw== - dependencies: - "@storybook/client-logger" "6.5.9" - core-js "^3.8.2" - memoizerific "^1.11.3" - regenerator-runtime "^0.13.7" - "@storybook/ui@6.5.10": version "6.5.10" resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.10.tgz#f56095a1a39ae5a203f2ac7f3dba86341a5927d5" @@ -5062,13 +4812,6 @@ "@types/history" "^4.7.11" "@types/react" "*" -"@types/react-syntax-highlighter@11.0.5": - version "11.0.5" - resolved "https://registry.yarnpkg.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-11.0.5.tgz#0d546261b4021e1f9d85b50401c0a42acb106087" - integrity sha512-VIOi9i2Oj5XsmWWoB72p3KlZoEbdRAcechJa8Ztebw7bDl2YmR+odxIqhtJGp1q2EozHs02US+gzxJ9nuf56qg== - dependencies: - "@types/react" "*" - "@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": version "18.0.15" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" @@ -9575,13 +9318,6 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -fault@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13" - integrity sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA== - dependencies: - format "^0.2.0" - faye-websocket@^0.11.3: version "0.11.4" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" @@ -9859,11 +9595,6 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -format@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" - integrity sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww== - forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -10546,11 +10277,6 @@ hey-listen@^1.0.8: resolved "https://registry.yarnpkg.com/hey-listen/-/hey-listen-1.0.8.tgz#8e59561ff724908de1aa924ed6ecc84a56a9aa68" integrity sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q== -highlight.js@^10.4.1, highlight.js@~10.7.0: - version "10.7.3" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" - integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== - history@^4.9.0: version "4.10.1" resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3" @@ -12584,14 +12310,6 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== -lowlight@^1.17.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.20.0.tgz#ddb197d33462ad0d93bf19d17b6c301aa3941888" - integrity sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw== - dependencies: - fault "^1.0.0" - highlight.js "~10.7.0" - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -14886,16 +14604,11 @@ prism-react-renderer@^1.3.5: resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-1.3.5.tgz#786bb69aa6f73c32ba1ee813fbe17a0115435085" integrity sha512-IJ+MSwBWKG+SM3b2SUfdrhC+gu01QkV2KmRQgREThBfSQRoufqRfxfHUxpG1WcaFjP+kojcFyO9Qqtpgt3qLCg== -prismjs@^1.27.0, prismjs@^1.28.0: +prismjs@^1.28.0: version "1.28.0" resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.28.0.tgz#0d8f561fa0f7cf6ebca901747828b149147044b6" integrity sha512-8aaXdYvl1F7iC7Xm1spqSaY/OJBpYW3v+KJ+F17iYxvdc8sfjW194COK5wVhMZX45tGteiBQgdvD/nhxcRwylw== -prismjs@~1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.27.0.tgz#bb6ee3138a0b438a3653dd4d6ce0cc6510a45057" - integrity sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA== - process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -15459,17 +15172,6 @@ react-scripts@^5.0.1: optionalDependencies: fsevents "^2.3.2" -react-syntax-highlighter@^15.4.5: - version "15.5.0" - resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.5.0.tgz#4b3eccc2325fa2ec8eff1e2d6c18fa4a9e07ab20" - integrity sha512-+zq2myprEnQmH5yw6Gqc8lD55QHnpKaU8TOcFeC/Lg/MQSs8UknEA0JC4nTZGFAXC2J2Hyj/ijJ7NlabyPi2gg== - dependencies: - "@babel/runtime" "^7.3.1" - highlight.js "^10.4.1" - lowlight "^1.17.0" - prismjs "^1.27.0" - refractor "^3.6.0" - react-textarea-autosize@^8.3.2: version "8.3.4" resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.3.4.tgz#270a343de7ad350534141b02c9cb78903e553524" @@ -15656,15 +15358,6 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -refractor@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.6.0.tgz#ac318f5a0715ead790fcfb0c71f4dd83d977935a" - integrity sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA== - dependencies: - hastscript "^6.0.0" - parse-entities "^2.0.0" - prismjs "~1.27.0" - regenerate-unicode-properties@^10.0.1: version "10.0.1" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz#7f442732aa7934a3740c779bb9b3340dccc1fb56" From 90cd7f2a4ab75e5783f1fff3e9c23454b3e3a8d3 Mon Sep 17 00:00:00 2001 From: Forrest Wolf Date: Thu, 4 Aug 2022 15:00:05 -0400 Subject: [PATCH 193/203] Fix example in squiggle-lang README --- packages/squiggle-lang/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/squiggle-lang/README.md b/packages/squiggle-lang/README.md index 8e84a333..18a6020f 100644 --- a/packages/squiggle-lang/README.md +++ b/packages/squiggle-lang/README.md @@ -20,7 +20,7 @@ environment created from the squiggle code. ```js import { run } from "@quri/squiggle-lang"; run( - "normal(0, 1) * fromSamples([-3,-2,-1,1,2,3,3,3,4,9]" + "normal(0, 1) * SampleSet.fromList([-3, 2,-1,1,2,3,3,3,4,9])" ).value.value.toSparkline().value; ``` From 9c25c90a33bb18f865161b98ed5f1f0e3271d133 Mon Sep 17 00:00:00 2001 From: Forrest Wolf Date: Thu, 4 Aug 2022 15:05:46 -0400 Subject: [PATCH 194/203] Update 'Language Basics' and 'Squiggle functions' links in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cdc73c28..e182f539 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ _An estimation language_. - [Gallery](https://www.squiggle-language.com/docs/Discussions/Gallery) - [Squiggle playground](https://squiggle-language.com/playground) -- [Language basics](https://www.squiggle-language.com/docs/Features/Language) -- [Squiggle functions source of truth](https://www.squiggle-language.com/docs/Features/Functions) +- [Language basics](https://www.squiggle-language.com/docs/Guides/Language) +- [Squiggle functions source of truth](https://www.squiggle-language.com/docs/Guides/Functions) - [Known bugs](https://www.squiggle-language.com/docs/Discussions/Bugs) - [Original lesswrong sequence](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3) - [Author your squiggle models as Observable notebooks](https://observablehq.com/@hazelfire/squiggle) From c2f2b644a6167f5d9259ddd80b03b89bcf7de913 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:22:30 +0000 Subject: [PATCH 195/203] :arrow_up: Bump @types/vscode from 1.69.0 to 1.70.0 Bumps [@types/vscode](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/vscode) from 1.69.0 to 1.70.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/vscode) --- updated-dependencies: - dependency-name: "@types/vscode" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/vscode-ext/package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index fca0c43d..b4e00587 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -128,7 +128,7 @@ "devDependencies": { "@types/glob": "^7.2.0", "@types/node": "18.x", - "@types/vscode": "^1.69.0", + "@types/vscode": "^1.70.0", "@typescript-eslint/eslint-plugin": "^5.32.0", "@typescript-eslint/parser": "^5.32.0", "eslint": "^8.21.0", diff --git a/yarn.lock b/yarn.lock index c13f2b77..ced93082 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4813,9 +4813,9 @@ "@types/react" "*" "@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": - version "18.0.15" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" - integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== + version "18.0.17" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.17.tgz#4583d9c322d67efe4b39a935d223edcc7050ccf4" + integrity sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -4915,10 +4915,10 @@ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== -"@types/vscode@^1.69.0": - version "1.69.0" - resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.69.0.tgz#a472011af392fbcf82cbb82f60b4c239c21b921c" - integrity sha512-RlzDAnGqUoo9wS6d4tthNyAdZLxOIddLiX3djMoWk29jFfSA1yJbIwr0epBYqqYarWB6s2Z+4VaZCQ80Jaa3kA== +"@types/vscode@^1.70.0": + version "1.70.0" + resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.70.0.tgz#9cb14cdaac9f450a7005ae2db49ecee4a084c983" + integrity sha512-3/9Fz0F2eBgwciazc94Ien+9u1elnjFg9YAhvAb3qDy/WeFWD9VrOPU7CIytryOVUdbxus8uzL4VZYONA0gDtA== "@types/webpack-env@^1.16.0": version "1.17.0" From dce0864bde563a2f476885cebaca8b51144db9db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:26:50 +0000 Subject: [PATCH 196/203] :arrow_up: Bump @testing-library/jest-dom from 5.16.4 to 5.16.5 Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.16.4 to 5.16.5. - [Release notes](https://github.com/testing-library/jest-dom/releases) - [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md) - [Commits](https://github.com/testing-library/jest-dom/compare/v5.16.4...v5.16.5) --- updated-dependencies: - dependency-name: "@testing-library/jest-dom" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 38 +++++++++++--------------------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 54421a8c..59b4160d 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -34,7 +34,7 @@ "@storybook/node-logger": "^6.5.9", "@storybook/preset-create-react-app": "^4.1.2", "@storybook/react": "^6.5.10", - "@testing-library/jest-dom": "^5.16.4", + "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^14.4.1", "@types/jest": "^27.5.0", diff --git a/yarn.lock b/yarn.lock index c13f2b77..fcaaeb50 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@adobe/css-tools@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.0.1.tgz#b38b444ad3aa5fedbb15f2f746dcd934226a12dd" + integrity sha512-+u76oB43nOHrF4DDWRLWDCtci7f3QJoEBigemIdIeTi1ODqjx6Tad9NCVnPRwewWlKkVab5PlK8DCtPTyX7S8g== + "@algolia/autocomplete-core@1.7.1": version "1.7.1" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.7.1.tgz#025538b8a9564a9f3dd5bcf8a236d6951c76c7d1" @@ -4377,16 +4382,16 @@ lz-string "^1.4.4" pretty-format "^27.0.2" -"@testing-library/jest-dom@^5.16.4": - version "5.16.4" - resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.16.4.tgz#938302d7b8b483963a3ae821f1c0808f872245cd" - integrity sha512-Gy+IoFutbMQcky0k+bqqumXZ1cTGswLsFqmNLzNdSKkU9KGV2u9oXhukCbbJ9/LRPKiqwxEE8VpV/+YZlfkPUA== +"@testing-library/jest-dom@^5.16.5": + version "5.16.5" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.16.5.tgz#3912846af19a29b2dbf32a6ae9c31ef52580074e" + integrity sha512-N5ixQ2qKpi5OLYfwQmUb/5mSV9LneAcaUfp32pn4yCnpb8r/Yz0pXFPck21dIicKmi+ta5WRAknkZCfA8refMA== dependencies: + "@adobe/css-tools" "^4.0.1" "@babel/runtime" "^7.9.2" "@types/testing-library__jest-dom" "^5.9.1" aria-query "^5.0.0" chalk "^3.0.0" - css "^3.0.0" css.escape "^1.5.1" dom-accessibility-api "^0.5.6" lodash "^4.17.15" @@ -4813,9 +4818,9 @@ "@types/react" "*" "@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": - version "18.0.15" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" - integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== + version "18.0.17" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.17.tgz#4583d9c322d67efe4b39a935d223edcc7050ccf4" + integrity sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -7758,15 +7763,6 @@ css.escape@^1.5.1: resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb" integrity sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg== -css@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d" - integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ== - dependencies: - inherits "^2.0.4" - source-map "^0.6.1" - source-map-resolve "^0.6.0" - cssdb@^6.6.3: version "6.6.3" resolved "https://registry.yarnpkg.com/cssdb/-/cssdb-6.6.3.tgz#1f331a2fab30c18d9f087301e6122a878bb1e505" @@ -16355,14 +16351,6 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-resolve@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" - integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - source-map-support@^0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" From 7422e5becf412638c7a9a61c1d2a80e138a7e537 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:28:42 +0000 Subject: [PATCH 197/203] :arrow_up: Bump framer-motion from 6.5.1 to 7.0.0 Bumps [framer-motion](https://github.com/framer/motion) from 6.5.1 to 7.0.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/v6.5.1...v7.0.0) --- updated-dependencies: - dependency-name: framer-motion dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 96 +++++++++++++++++--------------- 2 files changed, 53 insertions(+), 45 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 54421a8c..8c788ce3 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -11,7 +11,7 @@ "@quri/squiggle-lang": "^0.2.8", "@react-hook/size": "^2.1.2", "clsx": "^1.2.1", - "framer-motion": "^6.5.1", + "framer-motion": "^7.0.0", "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", diff --git a/yarn.lock b/yarn.lock index c13f2b77..1d4ae2b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2649,56 +2649,56 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@motionone/animation@^10.12.0": - version "10.12.0" - resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.12.0.tgz#bca8968d3d9c779f8a548678f24206bd36cc60b6" - integrity sha512-SCWkVjMChQwA4Cnt1pdmhCi0OC4cAR+rqsskNEqmbgfG59zmn50TfOP6vgqjkYbaSZXXLeEb03Mez362jIEHRg== +"@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== dependencies: - "@motionone/easing" "^10.12.0" - "@motionone/types" "^10.12.0" - "@motionone/utils" "^10.12.0" + "@motionone/easing" "^10.13.2" + "@motionone/types" "^10.13.2" + "@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== +"@motionone/dom@10.13.1": + version "10.13.1" + resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.13.1.tgz#fc29ea5d12538f21b211b3168e502cfc07a24882" + integrity sha512-zjfX+AGMIt/fIqd/SL1Lj93S6AiJsEA3oc5M9VkUr+Gz+juRmYN1vfvZd6MvEkSqEjwPQgcjN7rGZHrDB9APfQ== dependencies: - "@motionone/animation" "^10.12.0" - "@motionone/generators" "^10.12.0" - "@motionone/types" "^10.12.0" - "@motionone/utils" "^10.12.0" + "@motionone/animation" "^10.13.1" + "@motionone/generators" "^10.13.1" + "@motionone/types" "^10.13.0" + "@motionone/utils" "^10.13.1" hey-listen "^1.0.8" tslib "^2.3.1" -"@motionone/easing@^10.12.0": - version "10.12.0" - resolved "https://registry.yarnpkg.com/@motionone/easing/-/easing-10.12.0.tgz#cc10a00ed5ec9a7a05daf4ef985fcd14840b9a50" - integrity sha512-kdwcn1ja/0//BBHRElX3In1yfqMEhqUoL3G0njDan8R+gfPy3DanyuCtio4VruHQ1m3XN3LcrqavbClzcGo7IA== +"@motionone/easing@^10.13.2": + version "10.13.2" + resolved "https://registry.yarnpkg.com/@motionone/easing/-/easing-10.13.2.tgz#8f10c8624000eb741312941d3f578ed05154e06f" + integrity sha512-3HqctS5NyDfDQ+8+cZqc3Pu7I6amFCt9zDUjcozHyFXHh4PKYHK4+GJDFjJIS8bCAF2BrJmpmduDQ2V7lFEYeQ== dependencies: - "@motionone/utils" "^10.12.0" + "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/generators@^10.12.0": - version "10.12.0" - resolved "https://registry.yarnpkg.com/@motionone/generators/-/generators-10.12.0.tgz#2a175c47c741ed3864dd834e6c98efa68798a866" - integrity sha512-QM8/ndOve80HLXImChwW8ogrEM/8m9xzZEl2Ci2ep1uGLAQ+ADiwzKtl11inGESrxiFDrUdD12WXacCn+y172Q== +"@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== dependencies: - "@motionone/types" "^10.12.0" - "@motionone/utils" "^10.12.0" + "@motionone/types" "^10.13.2" + "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/types@^10.12.0": - version "10.12.0" - resolved "https://registry.yarnpkg.com/@motionone/types/-/types-10.12.0.tgz#06ede843d4c2990edbd22ecf8d5568d1fcd1f105" - integrity sha512-D9k7ijkAT6JJOCMUVn9IgJqWolp7N3oBbWRQTIRGGO41Bmr/JzLv4GzAb00PvkYAzZX+BpnSTKqXI19zrSjC5w== +"@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": - version "10.12.0" - resolved "https://registry.yarnpkg.com/@motionone/utils/-/utils-10.12.0.tgz#e8432a96bb7f91148987d0baaab6653ae727f9ee" - integrity sha512-2g3tCqYYwb/tgzCDRbILbD5edXJB45HV51NbnhwKVOOl0PhFraRDtehzLKo9wLHdaTnO/IjVn6cHQsw6RjdolA== +"@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== dependencies: - "@motionone/types" "^10.12.0" + "@motionone/types" "^10.13.2" hey-listen "^1.0.8" tslib "^2.3.1" @@ -4813,9 +4813,9 @@ "@types/react" "*" "@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": - version "18.0.15" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" - integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== + version "18.0.17" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.17.tgz#4583d9c322d67efe4b39a935d223edcc7050ccf4" + integrity sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -9612,16 +9612,16 @@ 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== +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== dependencies: - "@motionone/dom" "10.12.0" + "@motionone/dom" "10.13.1" framesync "6.0.1" hey-listen "^1.0.8" popmotion "11.0.3" - style-value-types "5.0.0" + style-value-types "5.1.0" tslib "^2.1.0" optionalDependencies: "@emotion/is-prop-valid" "^0.8.2" @@ -16848,6 +16848,14 @@ 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== + dependencies: + hey-listen "^1.0.8" + tslib "^2.3.1" + stylehacks@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-5.1.0.tgz#a40066490ca0caca04e96c6b02153ddc39913520" From d6655bde2f709ff8cdb9fbb6dedf4d901b303bed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:32:06 +0000 Subject: [PATCH 198/203] :arrow_up: Bump tailwindcss from 3.1.7 to 3.1.8 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.1.7...v3.1.8) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 54421a8c..c18bb58c 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -51,7 +51,7 @@ "react": "^18.1.0", "react-scripts": "^5.0.1", "style-loader": "^3.3.1", - "tailwindcss": "^3.1.7", + "tailwindcss": "^3.1.8", "ts-loader": "^9.3.0", "tsconfig-paths-webpack-plugin": "^4.0.0", "typescript": "^4.7.4", diff --git a/yarn.lock b/yarn.lock index c13f2b77..56ab7c4b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4813,9 +4813,9 @@ "@types/react" "*" "@types/react@*", "@types/react@^18.0.1", "@types/react@^18.0.9": - version "18.0.15" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe" - integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow== + version "18.0.17" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.17.tgz#4583d9c322d67efe4b39a935d223edcc7050ccf4" + integrity sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -16957,10 +16957,10 @@ synchronous-promise@^2.0.15: resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.15.tgz#07ca1822b9de0001f5ff73595f3d08c4f720eb8e" integrity sha512-k8uzYIkIVwmT+TcglpdN50pS2y1BDcUnBPK9iJeGu0Pl1lOI8pD6wtzgw91Pjpe+RxtTncw32tLxs/R0yNL2Mg== -tailwindcss@^3.0.2, tailwindcss@^3.1.7: - version "3.1.7" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.1.7.tgz#ce99425f30a74e01457a2e6a724463b0df3159ac" - integrity sha512-r7mgumZ3k0InfVPpGWcX8X/Ut4xBfv+1O/+C73ar/m01LxGVzWvPxF/w6xIUPEztrCoz7axfx0SMdh8FH8ZvRQ== +tailwindcss@^3.0.2, tailwindcss@^3.1.8: + version "3.1.8" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.1.8.tgz#4f8520550d67a835d32f2f4021580f9fddb7b741" + integrity sha512-YSneUCZSFDYMwk+TGq8qYFdCA3yfBRdBlS7txSq0LUmzyeqRe3a8fBQzbz9M3WS/iFT4BNf/nmw9mEzrnSaC0g== dependencies: arg "^5.0.2" chokidar "^3.5.3" From 6d07228a9cf4807af2048d6e54e2e2d8785ba848 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:40:08 +0000 Subject: [PATCH 199/203] :arrow_up: Bump @types/node from 18.6.3 to 18.6.4 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.6.3 to 18.6.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-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 59b4160d..7c93dfd5 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -39,7 +39,7 @@ "@testing-library/user-event": "^14.4.1", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.182", - "@types/node": "^18.6.3", + "@types/node": "^18.6.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 9d423eda..9c6d8a56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4714,10 +4714,10 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@18.x", "@types/node@^18.6.3": - version "18.6.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.3.tgz#4e4a95b6fe44014563ceb514b2598b3e623d1c98" - integrity sha512-6qKpDtoaYLM+5+AFChLhHermMQxc3TOEFIDzrZLPRGHPrLEwqFkkT5Kx3ju05g6X7uDPazz3jHbKPX0KzCjntg== +"@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@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0": version "16.11.41" From e2fe12c5f7cffa14d55d75b297741646e5ef357c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:53:27 +0000 Subject: [PATCH 200/203] :arrow_up: Bump @testing-library/user-event from 14.4.1 to 14.4.2 Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 14.4.1 to 14.4.2. - [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.1...v14.4.2) --- 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 1a19c169..0ffbed0a 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.1", + "@testing-library/user-event": "^14.4.2", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.182", "@types/node": "^18.6.4", diff --git a/yarn.lock b/yarn.lock index acfd0141..6accd635 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4406,10 +4406,10 @@ "@testing-library/dom" "^8.5.0" "@types/react-dom" "^18.0.0" -"@testing-library/user-event@^14.4.1": - version "14.4.1" - resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.4.1.tgz#dfa1cceef4833f5288a4090d1b85dce5d8dc20b6" - integrity sha512-Gr20dje1RaNxZ1ehHGPvFkLswfetBQKCfRD/lo6sUJQ52X2TV/QnqUpkjoShfEebrB2KiTPfQkcONwdQiofLhg== +"@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== "@tootallnate/once@1": version "1.1.2" From 63e2b1f8c94de8e03f25fcd4555fabf5715fef87 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 9 Aug 2022 11:55:49 -0700 Subject: [PATCH 201/203] 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 202/203] 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 203/203] 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": {