From f492899117d25e352106c30197d0e2f7de00f63e Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Wed, 23 Mar 2022 18:34:50 -0400 Subject: [PATCH] After pair programming with @Hazelfire, still need to fix playground scripts (rebase: README and index.js) --- .github/workflows/ci.yaml | 8 +++++--- CONTRIBUTING.md | 2 +- README.md | 22 +++++++++------------ package.json | 3 ++- packages/components/README.md | 4 ++-- packages/playground/README.md | 4 +++- packages/squiggle-lang/README.md | 20 ++++++++++++++++++- packages/squiggle-lang/package.json | 7 ++----- packages/website/README.md | 30 ++++++++++++----------------- packages/website/package.json | 9 ++------- 10 files changed, 57 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 624d39ce..ae7c622a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,6 +39,8 @@ jobs: run: yarn build - name: Run tests run: yarn test + - name: Run tsc and webpack + run: yarn bundle components-build-test: name: Components build and test @@ -54,6 +56,6 @@ jobs: - name: Install packages run: yarn - name: See if storybook builds - run: yarn build-storybook - - name: Run tsc - run: yarn ci + run: yarn build + - name: Run tsc and webpack + run: yarn bundle diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 84635b82..3694f142 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ Squiggle is currently pre-alpha. # Bug reports -Anyone (with a github account) can file an issue at any time. Please allow Quinn, Sam, and Ozzie to triage, but we encourage you to use either the `Bug` or `Enhancement` labels depending on the nature of the issue you're filing. ` +Anyone (with a github account) can file an issue at any time. Please allow Quinn, Sam, and Ozzie to triage, but otherwise just follow the suggestions in the issue templates. # Project structure diff --git a/README.md b/README.md index bce372b9..35eab1cc 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,18 @@ This is an experiment DSL/language for making probabilistic estimates. This monorepo has several packages that can be used for various purposes. All the packages can be found in `packages`. -`@squiggle/lang` in `packages/squiggle-lang` contains the core language, particularly +`@quri/squiggle-lang` in `packages/squiggle-lang` contains the core language, particularly an interface to parse squiggle expressions and return descriptions of distributions or results. -`@squiggle/components` in `packages/components` contains React components that +`@quri/squiggle-components` in `packages/components` contains React components that can be passed squiggle strings as props, and return a presentation of the result of the calculation. -`@squiggle/playground` in `packages/playground` contains a website for a playground +`@quri/playground` in `packages/playground` contains a website for a playground for squiggle. This website is hosted at `playground.squiggle-language.com` -`@squiggle/website` in `packages/website` The main descriptive website for squiggle, +`@quri/squiggle-website` in `packages/website` The main descriptive website for squiggle, it is hosted at `squiggle-language.com`. The playground depends on the components library which then depends on the language. @@ -24,16 +24,12 @@ This means that if you wish to work on the components library, you will need to package the language, and for the playground to work, you will need to package the components library and the playground. -Scripts are available for you in the root directory to do important activities, -such as: +# Develop -- `yarn build:lang`. Builds and packages the language -- `yarn storybook:components`. Hosts the component storybook - -# Local playground +For any project in the repo, begin by running `yarn` in the top level ``` sh -yarn build:playground -cd packages/playground -yarn parcel +yarn ``` + +See `packages/*/README.md` to work with whatever project you're interested in. diff --git a/package.json b/package.json index 8b04c7c5..2b598e52 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "build:playground": "cd packages/playground && yarn && yarn parcel-build", "ci:lang": "yarn workspace @quri/squiggle-lang ci", "ci:components": "yarn ci:lang && yarn workspace @quri/squiggle-components ci", - "ci:playground": "yarn ci:components && yarn workspace @quri/squiggle-playground ci" + "ci:playground": "yarn ci:components && yarn workspace @quri/squiggle-playground ci", + "nodeclean": "rm -r node_modules && rm -r packages/*/node_modules && " }, "workspaces": [ "packages/*" diff --git a/packages/components/README.md b/packages/components/README.md index 693ad7f4..13a9873d 100644 --- a/packages/components/README.md +++ b/packages/components/README.md @@ -1,7 +1,7 @@ # Squiggle Components This package contains all the components for squiggle. These can be used either as a library or hosted as a [storybook](https://storybook.js.org/). -# Build for development +# Build for development You need to _prepare_ by building and bundling `squiggle-lang` ``` sh cd ../squiggle-language @@ -23,7 +23,7 @@ Run a development server yarn start ``` -And build artefacts for production, +And build artefacts for production, ``` sh yarn bundle # builds components library diff --git a/packages/playground/README.md b/packages/playground/README.md index 591062d8..cf6fffa8 100644 --- a/packages/playground/README.md +++ b/packages/playground/README.md @@ -1,9 +1,11 @@ +# TODO: REVIVE PLAYGROUND. + # Squiggle Playground This repository contains the squiggle playground, a small web interface for playing around with squiggle concepts. -It depends on `@squiggle/components` and `@squiggle/lang` so both of them will +It depends on `@quri/squiggle-components` and `@quri/squiggle-lang` so both of them will need to be packaged for this to work. This can be done from the root directory with diff --git a/packages/squiggle-lang/README.md b/packages/squiggle-lang/README.md index 2f238ed2..2768371e 100644 --- a/packages/squiggle-lang/README.md +++ b/packages/squiggle-lang/README.md @@ -1,9 +1,27 @@ +# Squiggle language + +# Build for development +``` sh +yarn +yarn build +yarn bundle +``` + +Other: +``` sh +yarn start # listens to files and recompiles at every mutation +yarn test +yarn test:watch # keeps an active session and runs all tests at every mutation +``` + +# TODO: clean up this README.md + # Squiggle Language Squiggle is a language for representing probability distributions, as well as functions that return probability distributions. Its original intended use is for improving epistemics around EA decisions. -This package, @squiggle/lang, contains the core language of squiggle. The main +This package, @quri/squiggle-lang, contains the core language of squiggle. The main feature revolves around evaluating squiggle expressions. Currently the package only exports a single function, named "run", which from a squiggle string returns an object representing the result of the evaluation. diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 095440ba..ecddbd96 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -8,11 +8,8 @@ "start": "rescript build -w -with-deps", "clean": "rescript clean", "test": "jest", - "test:ci": "yarn jest ./__tests__/Lodash__test.res", - "watch:test": "jest --watchAll", - "watch:s": "yarn jest -- Converter_test --watch", - "package": "tsc", - "ci": "yarn build && yarn package" + "test:watch": "jest --watchAll", + "all": "yarn build && yarn bundle && yarn test" }, "keywords": [ "Rescript" diff --git a/packages/website/README.md b/packages/website/README.md index aaba2fa1..d7dc8509 100644 --- a/packages/website/README.md +++ b/packages/website/README.md @@ -4,38 +4,32 @@ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern sta ### Installation -``` -$ yarn +``` sh +yarn ``` ### Local Development -``` -$ yarn start +``` sh +yarn start ``` This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. ### Build -``` -$ yarn build +``` sh +yarn build ``` This command generates static content into the `build` directory and can be served using any static contents hosting service. -### Deployment +### Clean -Using SSH: - -``` -$ USE_SSH=true yarn deploy +Clean up the build artefacts. +``` sh +yarn clean ``` -Not using SSH: - -``` -$ GIT_USER= yarn deploy -``` - -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. +# TODO: unify formatting across `packages/*/README.md` +# TODO: build docs in `ci.yaml`. diff --git a/packages/website/package.json b/packages/website/package.json index d9e3f9e9..1c37c469 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -3,15 +3,10 @@ "version": "0.0.0", "private": true, "scripts": { - "docusaurus": "docusaurus", "start": "docusaurus start", "build": "docusaurus build", - "swizzle": "docusaurus swizzle", - "deploy": "docusaurus deploy", - "clear": "docusaurus clear", - "serve": "docusaurus serve", - "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids" + "clean": "docusaurus clear", + "all": "yarn build" }, "dependencies": { "@docusaurus/core": "2.0.0-beta.15",