Merge branch 'develop' into documentation-refactor-June12-2022

* develop:
  ⬆️ Bump @storybook/builder-webpack5 from 6.5.7 to 6.5.8
  ⬆️ Bump @storybook/react from 6.5.7 to 6.5.8
  ⬆️ Bump @storybook/addon-essentials from 6.5.7 to 6.5.8
  always merge stdlib
  ⬆️ Bump webpack-dev-server from 4.9.1 to 4.9.2
  ⬆️ Bump @types/node from 17.0.40 to 17.0.42
  ⬆️ Bump reanalyze from 2.22.0 to 2.23.0
  ⬆️ Bump @storybook/manager-webpack5 from 6.5.7 to 6.5.8
  ⬆️ Bump @storybook/addon-actions from 6.5.7 to 6.5.8
  ⬆️ Bump webpack-cli from 4.9.2 to 4.10.0
  ⬆️ Bump @storybook/addon-links from 6.5.7 to 6.5.8
  ⬆️ Bump @hookform/resolvers from 2.9.0 to 2.9.1
  ⬆️ Bump react-hook-form from 7.31.3 to 7.32.0
  ⬆️ Bump tailwindcss from 3.0.24 to 3.1.2
This commit is contained in:
Ozzie Gooen 2022-06-13 11:04:21 -07:00
commit f01df95381
9 changed files with 585 additions and 330 deletions

View File

@ -5,14 +5,14 @@
"dependencies": { "dependencies": {
"@headlessui/react": "^1.6.4", "@headlessui/react": "^1.6.4",
"@heroicons/react": "^1.0.6", "@heroicons/react": "^1.0.6",
"@hookform/resolvers": "^2.9.0", "@hookform/resolvers": "^2.9.1",
"@quri/squiggle-lang": "^0.2.8", "@quri/squiggle-lang": "^0.2.8",
"@react-hook/size": "^2.1.2", "@react-hook/size": "^2.1.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"react": "^18.1.0", "react": "^18.1.0",
"react-ace": "^10.1.0", "react-ace": "^10.1.0",
"react-dom": "^18.1.0", "react-dom": "^18.1.0",
"react-hook-form": "^7.31.3", "react-hook-form": "^7.32.0",
"react-use": "^17.4.0", "react-use": "^17.4.0",
"react-vega": "^7.5.1", "react-vega": "^7.5.1",
"vega": "^5.22.1", "vega": "^5.22.1",
@ -22,21 +22,21 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.17.12", "@babel/plugin-proposal-private-property-in-object": "^7.17.12",
"@storybook/addon-actions": "^6.5.7", "@storybook/addon-actions": "^6.5.8",
"@storybook/addon-essentials": "^6.5.7", "@storybook/addon-essentials": "^6.5.8",
"@storybook/addon-links": "^6.5.7", "@storybook/addon-links": "^6.5.8",
"@storybook/builder-webpack5": "^6.5.7", "@storybook/builder-webpack5": "^6.5.8",
"@storybook/manager-webpack5": "^6.5.7", "@storybook/manager-webpack5": "^6.5.8",
"@storybook/node-logger": "^6.5.6", "@storybook/node-logger": "^6.5.6",
"@storybook/preset-create-react-app": "^4.1.2", "@storybook/preset-create-react-app": "^4.1.2",
"@storybook/react": "^6.5.7", "@storybook/react": "^6.5.8",
"@tailwindcss/forms": "^0.5.2", "@tailwindcss/forms": "^0.5.2",
"@testing-library/jest-dom": "^5.16.4", "@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0", "@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^14.2.0", "@testing-library/user-event": "^14.2.0",
"@types/jest": "^27.5.0", "@types/jest": "^27.5.0",
"@types/lodash": "^4.14.182", "@types/lodash": "^4.14.182",
"@types/node": "^17.0.40", "@types/node": "^17.0.42",
"@types/react": "^18.0.9", "@types/react": "^18.0.9",
"@types/react-dom": "^18.0.5", "@types/react-dom": "^18.0.5",
"@types/styled-components": "^5.1.24", "@types/styled-components": "^5.1.24",
@ -48,14 +48,14 @@
"postcss-loader": "^7.0.0", "postcss-loader": "^7.0.0",
"react-scripts": "^5.0.1", "react-scripts": "^5.0.1",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"tailwindcss": "^3.0.24", "tailwindcss": "^3.1.2",
"ts-loader": "^9.3.0", "ts-loader": "^9.3.0",
"tsconfig-paths-webpack-plugin": "^3.5.2", "tsconfig-paths-webpack-plugin": "^3.5.2",
"typescript": "^4.7.3", "typescript": "^4.7.3",
"web-vitals": "^2.1.4", "web-vitals": "^2.1.4",
"webpack": "^5.73.0", "webpack": "^5.73.0",
"webpack-cli": "^4.9.2", "webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.0" "webpack-dev-server": "^4.9.2"
}, },
"scripts": { "scripts": {
"start": "cross-env REACT_APP_FAST_REFRESH=false && start-storybook -p 6006 -s public", "start": "cross-env REACT_APP_FAST_REFRESH=false && start-storybook -p 6006 -s public",

View File

@ -25,7 +25,7 @@ let expectToExpressionToBe = (expr, answer, ~v="_", ()) => {
->Result.flatMap(expr => ->Result.flatMap(expr =>
Expression.reduceExpression( Expression.reduceExpression(
expr, expr,
ReducerInterface_DefaultExternalBindings.defaultInternalBindings, ReducerInterface_StdLib.internalStdLib,
ExpressionValue.defaultEnvironment, ExpressionValue.defaultEnvironment,
) )
) )

View File

@ -29,6 +29,7 @@ let expectEvalError = (expr: string) =>
let expectEvalBindingsToBe = (expr: string, bindings: Reducer.externalBindings, answer: string) => let expectEvalBindingsToBe = (expr: string, bindings: Reducer.externalBindings, answer: string) =>
Reducer.evaluateUsingOptions(expr, ~externalBindings=Some(bindings), ~environment=None) Reducer.evaluateUsingOptions(expr, ~externalBindings=Some(bindings), ~environment=None)
->Reducer_Helpers.rRemoveDefaults
->ExpressionValue.toStringResult ->ExpressionValue.toStringResult
->expect ->expect
->toBe(answer) ->toBe(answer)

View File

@ -57,14 +57,14 @@
"moduleserve": "^0.9.1", "moduleserve": "^0.9.1",
"nyc": "^15.1.0", "nyc": "^15.1.0",
"peggy": "^2.0.1", "peggy": "^2.0.1",
"reanalyze": "^2.22.0", "reanalyze": "^2.23.0",
"rescript-fast-check": "^1.1.1", "rescript-fast-check": "^1.1.1",
"ts-jest": "^27.1.4", "ts-jest": "^27.1.4",
"ts-loader": "^9.3.0", "ts-loader": "^9.3.0",
"ts-node": "^10.8.1", "ts-node": "^10.8.1",
"typescript": "^4.7.3", "typescript": "^4.7.3",
"webpack": "^5.73.0", "webpack": "^5.73.0",
"webpack-cli": "^4.9.2" "webpack-cli": "^4.10.0"
}, },
"source": "./src/js/index.ts", "source": "./src/js/index.ts",
"main": "./dist/src/js/index.js", "main": "./dist/src/js/index.js",

View File

@ -24,4 +24,4 @@ let foreignFunctionInterface = (
let defaultEnvironment = ExpressionValue.defaultEnvironment let defaultEnvironment = ExpressionValue.defaultEnvironment
let defaultExternalBindings = ReducerInterface_DefaultExternalBindings.defaultExternalBindings let defaultExternalBindings = ReducerInterface_StdLib.externalStdLib

View File

@ -116,14 +116,20 @@ let evaluateUsingOptions = (
~externalBindings: option<ReducerInterface_ExpressionValue.externalBindings>, ~externalBindings: option<ReducerInterface_ExpressionValue.externalBindings>,
code: string, code: string,
): result<expressionValue, errorValue> => { ): result<expressionValue, errorValue> => {
let anEnvironment = switch environment { let anEnvironment = Belt.Option.getWithDefault(
| Some(env) => env environment,
| None => ReducerInterface_ExpressionValue.defaultEnvironment ReducerInterface_ExpressionValue.defaultEnvironment,
} )
let anExternalBindings = switch externalBindings { let anExternalBindings = switch externalBindings {
| Some(bindings) => bindings | Some(bindings) => {
| None => ReducerInterface_DefaultExternalBindings.defaultExternalBindings let cloneLib = ReducerInterface_StdLib.externalStdLib->Reducer_Category_Bindings.cloneRecord
Js.Dict.entries(bindings)->Js.Array2.reduce((acc, (key, value)) => {
acc->Js.Dict.set(key, value)
acc
}, cloneLib)
}
| None => ReducerInterface_StdLib.externalStdLib
} }
let bindings = anExternalBindings->Bindings.fromExternalBindings let bindings = anExternalBindings->Bindings.fromExternalBindings

View File

@ -1,6 +0,0 @@
module Bindings = Reducer_Category_Bindings
let defaultInternalBindings = Bindings.emptyBindings->SquiggleLibrary_Math.makeBindings
@genType
let defaultExternalBindings = defaultInternalBindings->Bindings.toRecord

View File

@ -0,0 +1,6 @@
module Bindings = Reducer_Category_Bindings
let internalStdLib = Bindings.emptyBindings->SquiggleLibrary_Math.makeBindings
@genType
let externalStdLib = internalStdLib->Bindings.toRecord

852
yarn.lock

File diff suppressed because it is too large Load Diff