From ce252bb2f971a37e0f6c0d723d76e798d4fe6b56 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Fri, 25 Mar 2022 14:12:14 +1100 Subject: [PATCH] Fix up build ssr and ci for docs --- .github/workflows/ci.yaml | 6 ++++-- packages/website/babel.config.js | 6 +++++- packages/website/docs/Functions.mdx | 2 +- packages/website/docs/Language.mdx | 2 +- packages/website/src/components/SquiggleEditor.jsx | 13 +++++++++++++ 5 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 packages/website/src/components/SquiggleEditor.jsx diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 31e15df0..7bf80ead 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -79,7 +79,9 @@ jobs: working-directory: packages/website steps: - uses: actions/checkout@v2 - - name: Install dependencies - run: yarn + - name: Install dependencies from monorepo level + run: cd ../../ && yarn + - name: Build rescript in squiggle-lang + run: cd ../squiggle-lang && yarn build - name: Build website assets run: yarn build diff --git a/packages/website/babel.config.js b/packages/website/babel.config.js index e00595da..0bf9a1b9 100644 --- a/packages/website/babel.config.js +++ b/packages/website/babel.config.js @@ -1,3 +1,7 @@ module.exports = { - presets: [require.resolve('@docusaurus/core/lib/babel/preset')], + presets: [ + require.resolve('@docusaurus/core/lib/babel/preset'), + ["@babel/preset-react", {"runtime": "automatic"}] + + ], }; diff --git a/packages/website/docs/Functions.mdx b/packages/website/docs/Functions.mdx index 6a0683cd..65102bc3 100644 --- a/packages/website/docs/Functions.mdx +++ b/packages/website/docs/Functions.mdx @@ -2,7 +2,7 @@ sidebar_position: 7 --- -import { SquiggleEditor } from '@quri/squiggle-components' +import { SquiggleEditor } from '../src/components/SquiggleEditor' # Squiggle Functions Reference diff --git a/packages/website/docs/Language.mdx b/packages/website/docs/Language.mdx index f73a779f..84707479 100644 --- a/packages/website/docs/Language.mdx +++ b/packages/website/docs/Language.mdx @@ -2,7 +2,7 @@ sidebar_position: 2 --- -import { SquiggleEditor } from '@quri/squiggle-components' +import { SquiggleEditor } from '../src/components/SquiggleEditor' # Squiggle Language diff --git a/packages/website/src/components/SquiggleEditor.jsx b/packages/website/src/components/SquiggleEditor.jsx new file mode 100644 index 00000000..7d69ff21 --- /dev/null +++ b/packages/website/src/components/SquiggleEditor.jsx @@ -0,0 +1,13 @@ +import BrowserOnly from '@docusaurus/BrowserOnly'; + +export function SquiggleEditor(props) { + return ( + Loading...}> + {() => { + const LibComponent = + require('@quri/squiggle-components').SquiggleEditor; + return ; + }} + + ); +}