diff --git a/README.md b/README.md index acf0032b..cf21345c 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,31 @@ This is an experiment DSL/language for making probabilistic estimates. -## DistPlus -We have a custom library called DistPlus to handle distributions with additional metadata. This helps handle mixed distributions (continuous + discrete), a cache for a cdf, possible unit types (specific times are supported), and limited domains. +This monorepo has several packages that can be used for various purposes. All +the packages can be found in `packages`. -## Running packages in the monorepo -This application uses `lerna` to manage dependencies between packages. To install -dependencies of all packages, run: +`@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 +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 +for squiggle. This website is hosted at `playground.squiggle-language.com` + +`@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. +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: + +`yarn build:lang`. Builds and packages the language +`yarn storybook:components`. Hosts the component storybook -``` -lerna bootstrap -``` diff --git a/package.json b/package.json index 5c28af6b..3d6df4b0 100644 --- a/package.json +++ b/package.json @@ -4,5 +4,10 @@ "lerna": "^4.0.0" }, "name": "squiggle", + "scripts": { + "build:lang": "cd packages/squiggle-lang && yarn && yarn build && yarn package", + "storybook:components": "cd packages/components && yarn && yarn storybook" + "build:components": "cd packages/components && yarn && yarn package" + }, "workspaces": ["packages/*"] } diff --git a/packages/components/.gitignore b/packages/components/.gitignore index 15209f23..b0a9c29b 100644 --- a/packages/components/.gitignore +++ b/packages/components/.gitignore @@ -22,3 +22,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* storybook-static +dist diff --git a/packages/components/README.md b/packages/components/README.md index 58beeacc..57c87588 100644 --- a/packages/components/README.md +++ b/packages/components/README.md @@ -1,70 +1,6 @@ -# Getting Started with Create React App +# Squiggle Components -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +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/). -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in your browser. - -The page will reload when you make changes.\ -You may also see any lint errors in the console. - -### `npm test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `npm run build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `npm run eject` - -**Note: this is a one-way operation. Once you `eject`, you can't go back!** - -If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. - -You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). - -### Code Splitting - -This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) - -### Analyzing the Bundle Size - -This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) - -### Making a Progressive Web App - -This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) - -### Advanced Configuration - -This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) - -### Deployment - -This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) - -### `npm run build` fails to minify - -This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) +To run the storybook diff --git a/packages/components/package.json b/packages/components/package.json index d5382ffd..1f8cd58c 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -25,12 +25,9 @@ "webpack-cli": "^4.9.2" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", "storybook": "cross-env REACT_APP_FAST_REFRESH=false && start-storybook -p 6006 -s public", - "build-storybook": "build-storybook -s public" + "build-storybook": "build-storybook -s public", + "package": "tsc" }, "eslintConfig": { "extends": [ diff --git a/packages/components/public/favicon.ico b/packages/components/public/favicon.ico index a11777cc..bf4a38a2 100644 Binary files a/packages/components/public/favicon.ico and b/packages/components/public/favicon.ico differ diff --git a/packages/components/public/index.html b/packages/components/public/index.html index aa069f27..7e688cd4 100644 --- a/packages/components/public/index.html +++ b/packages/components/public/index.html @@ -7,37 +7,13 @@ - - - -