diff --git a/packages/components/README.md b/packages/components/README.md index e8486e1a..693ad7f4 100644 --- a/packages/components/README.md +++ b/packages/components/README.md @@ -1,6 +1,35 @@ # 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 -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/). +You need to _prepare_ by building and bundling `squiggle-lang` +``` sh +cd ../squiggle-language +yarn +yarn build +yarn bundle +``` +If you've otherwise done this recently you can skip those. -To run the storybook, run `yarn` then `yarn storybook`. +Then, you can install dependencies +``` sh +cd packages/components +yarn +``` + +Run a development server + +``` sh +yarn start +``` + +And build artefacts for production, + +``` sh +yarn bundle # builds components library +yarn build # builds storybook app +``` + +## TODO: double check if `tsc && webpack` is redundantly equivalent to `webpack`. (Edit job step name in `ci.yaml` if you edit the script). + +## TODO: test coverage for react code diff --git a/packages/components/package.json b/packages/components/package.json index 023e6487..64b82526 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -26,10 +26,10 @@ "webpack-cli": "^4.9.2" }, "scripts": { - "storybook": "cross-env REACT_APP_FAST_REFRESH=false && start-storybook -p 6006 -s public", - "build-storybook": "build-storybook -s public", - "package": "tsc", - "ci": "yarn package" + "start": "cross-env REACT_APP_FAST_REFRESH=false && start-storybook -p 6006 -s public", + "build": "build-storybook -s public", + "bundle": "tsc && webpack", + "all": "yarn build && yarn bundle" }, "eslintConfig": { "extends": [ diff --git a/packages/playground/src/components/DistBuilder.tsx b/packages/playground/src/components/DistBuilder.tsx index cf8271a7..19810ebf 100644 --- a/packages/playground/src/components/DistBuilder.tsx +++ b/packages/playground/src/components/DistBuilder.tsx @@ -1,5 +1,5 @@ import { FC, useState } from "react" -import { SquiggleChart } from "@squiggle/components" +import { SquiggleChart } from "@quri/squiggle-components" import { CodeEditor } from "./CodeEditor" import { Form, Input, Card, Row, Col } from "antd" import { css } from '@emotion/react'