From d9b2da1b1311e8c1671f669e2e7faa484439dcbc Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Wed, 23 Mar 2022 10:01:51 -0400 Subject: [PATCH] renamed packages to @quri prefix --- packages/components/README.md | 35 +++++++++++++++++-- packages/components/package.json | 8 ++--- .../playground/src/components/DistBuilder.tsx | 2 +- 3 files changed, 37 insertions(+), 8 deletions(-) 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'