Merge pull request #966 from quantified-uncertainty/develop
Develop -> Master, Aug 8
This commit is contained in:
commit
f015e2ed19
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
|
@ -11,3 +11,10 @@ updates:
|
|||
interval: "weekly"
|
||||
commit-message:
|
||||
prefix: "⬆️"
|
||||
open-pull-requests-limit: 100
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
prefix: "⬆️"
|
||||
|
|
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
|
@ -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/**"]'
|
||||
|
||||
|
@ -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:
|
||||
|
|
8
.github/workflows/codeql-analysis.yml
vendored
8
.github/workflows/codeql-analysis.yml
vendored
|
@ -33,11 +33,11 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 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
|
||||
|
|
140
.github/workflows/release-please.yml
vendored
Normal file
140
.github/workflows/release-please.yml
vendored
Normal file
|
@ -0,0 +1,140 @@
|
|||
name: Run Release Please
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
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:
|
||||
- id: skip_lang_check
|
||||
name: Check if the changes are about squiggle-lang src files
|
||||
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@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@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@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@v4.0.0
|
||||
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: Release please (squiggle-lang)
|
||||
uses: google-github-actions/release-please-action@v3
|
||||
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
|
||||
needs: pre_check
|
||||
if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }}
|
||||
steps:
|
||||
- name: Release please (components)
|
||||
uses: google-github-actions/release-please-action@v3
|
||||
with:
|
||||
token: ${{secrets.GITHUB_TOKEN}}
|
||||
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
|
||||
needs: pre_check
|
||||
if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }}
|
||||
steps:
|
||||
- name: Release please (website)
|
||||
uses: google-github-actions/release-please-action@v3
|
||||
with:
|
||||
token: ${{secrets.GITHUB_TOKEN}}
|
||||
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
|
||||
needs: pre_check
|
||||
if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }}
|
||||
steps:
|
||||
- name: Release please (vscode-ext)
|
||||
uses: google-github-actions/release-please-action@v3
|
||||
with:
|
||||
token: ${{secrets.GITHUB_TOKEN}}
|
||||
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
|
||||
needs: pre_check
|
||||
if: ${{ needs.pre_check.outputs.should_skip_cli != 'true' }}
|
||||
steps:
|
||||
- name: Release please (cli)
|
||||
uses: google-github-actions/release-please-action@v3
|
||||
with:
|
||||
token: ${{secrets.GITHUB_TOKEN}}
|
||||
command: manifest-pr
|
||||
path: packages/cli
|
||||
bump-patch-for-minor-pre-major: true
|
||||
skip-github-release: true
|
7
.release-please-manifest.json
Normal file
7
.release-please-manifest.json
Normal file
|
@ -0,0 +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"
|
||||
}
|
|
@ -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)
|
||||
|
|
|
@ -3,43 +3,43 @@
|
|||
"version": "0.2.24",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@floating-ui/react-dom": "^0.7.2",
|
||||
"@floating-ui/react-dom-interactions": "^0.6.6",
|
||||
"@floating-ui/react-dom": "^1.0.0",
|
||||
"@floating-ui/react-dom-interactions": "^0.9.1",
|
||||
"@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",
|
||||
"framer-motion": "^6.5.1",
|
||||
"framer-motion": "^7.0.0",
|
||||
"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",
|
||||
"vega-embed": "^6.21.0",
|
||||
"vega-lite": "^5.3.0",
|
||||
"vega-lite": "^5.4.0",
|
||||
"vscode-uri": "^3.0.3",
|
||||
"yup": "^0.32.11"
|
||||
},
|
||||
"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-links": "^6.5.9",
|
||||
"@storybook/builder-webpack5": "^6.5.9",
|
||||
"@storybook/manager-webpack5": "^6.5.9",
|
||||
"@storybook/addon-essentials": "^6.5.10",
|
||||
"@storybook/addon-links": "^6.5.10",
|
||||
"@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",
|
||||
"@storybook/react": "^6.5.9",
|
||||
"@testing-library/jest-dom": "^5.16.4",
|
||||
"@storybook/react": "^6.5.10",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
"@testing-library/react": "^13.3.0",
|
||||
"@testing-library/user-event": "^14.3.0",
|
||||
"@testing-library/user-event": "^14.4.2",
|
||||
"@types/jest": "^27.5.0",
|
||||
"@types/lodash": "^4.14.182",
|
||||
"@types/node": "^18.6.1",
|
||||
"@types/node": "^18.6.4",
|
||||
"@types/react": "^18.0.9",
|
||||
"@types/styled-components": "^5.1.24",
|
||||
"@types/webpack": "^5.28.0",
|
||||
|
@ -51,9 +51,9 @@
|
|||
"react": "^18.1.0",
|
||||
"react-scripts": "^5.0.1",
|
||||
"style-loader": "^3.3.1",
|
||||
"tailwindcss": "^3.1.6",
|
||||
"tailwindcss": "^3.1.8",
|
||||
"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",
|
||||
|
|
|
@ -59,6 +59,13 @@ export const ExpressionViewer: React.FC<Props> = ({
|
|||
expression,
|
||||
width,
|
||||
}) => {
|
||||
if (typeof expression !== "object") {
|
||||
return (
|
||||
<VariableList path={path} heading="Error">
|
||||
{() => `Unknown expression: ${expression}`}
|
||||
</VariableList>
|
||||
);
|
||||
}
|
||||
switch (expression.tag) {
|
||||
case "number":
|
||||
return (
|
||||
|
@ -281,10 +288,16 @@ export const ExpressionViewer: React.FC<Props> = ({
|
|||
);
|
||||
default: {
|
||||
return (
|
||||
<div>
|
||||
<span>No display for type: </span>{" "}
|
||||
<span className="font-semibold text-slate-600">{expression.tag}</span>
|
||||
</div>
|
||||
<VariableList path={path} heading="Error">
|
||||
{() => (
|
||||
<div>
|
||||
<span>No display for type: </span>{" "}
|
||||
<span className="font-semibold text-slate-600">
|
||||
{expression.tag}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</VariableList>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
```
|
||||
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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]; }
|
||||
|
|
|
@ -7,6 +7,9 @@ module ErrorValue = Reducer_ErrorValue
|
|||
@genType.opaque
|
||||
type internalCode = Object
|
||||
|
||||
@genType.opaque
|
||||
type hiddenNameSpace = Object
|
||||
|
||||
@genType
|
||||
type rec externalExpressionValue =
|
||||
| EvArray(array<externalExpressionValue>)
|
||||
|
@ -27,14 +30,16 @@ type rec externalExpressionValue =
|
|||
| EvType(record)
|
||||
| EvVoid
|
||||
and record = Js.Dict.t<externalExpressionValue>
|
||||
and externalBindings = record
|
||||
and lambdaValue = {
|
||||
parameters: array<string>,
|
||||
context: externalBindings,
|
||||
context: hiddenNameSpace,
|
||||
body: internalCode,
|
||||
}
|
||||
and lambdaDeclaration = Declaration.declaration<lambdaValue>
|
||||
|
||||
@genType
|
||||
type externalBindings = record
|
||||
|
||||
@genType
|
||||
type t = externalExpressionValue
|
||||
|
||||
|
|
|
@ -37,6 +37,29 @@ type internalExpressionValue = t
|
|||
|
||||
type functionCall = (string, array<t>)
|
||||
|
||||
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 =>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"displayName": "Squiggle",
|
||||
"description": "Squiggle language support",
|
||||
"license": "MIT",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.1",
|
||||
"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",
|
||||
|
@ -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",
|
||||
|
@ -128,10 +128,10 @@
|
|||
"devDependencies": {
|
||||
"@types/glob": "^7.2.0",
|
||||
"@types/node": "18.x",
|
||||
"@types/vscode": "^1.69.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
||||
"@typescript-eslint/parser": "^5.30.7",
|
||||
"eslint": "^8.20.0",
|
||||
"@types/vscode": "^1.70.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
||||
"@typescript-eslint/parser": "^5.32.0",
|
||||
"eslint": "^8.21.0",
|
||||
"glob": "^8.0.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"typescript": "^4.7.4",
|
||||
|
|
8
packages/website/CHANGELOG.md
Normal file
8
packages/website/CHANGELOG.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
# 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))
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
||||
<SquiggleEditorWithImportedBindings
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "squiggle-website",
|
||||
"version": "0.0.0",
|
||||
"version": "0.2.1",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
@ -12,8 +12,8 @@
|
|||
"format": "prettier --write ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-rc.1",
|
||||
"@docusaurus/preset-classic": "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",
|
||||
"base64-js": "^1.5.1",
|
||||
|
|
14
release-please-config.json
Normal file
14
release-please-config.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"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"]
|
||||
}
|
Loading…
Reference in New Issue
Block a user