Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Configure deployment previews with Vega Editor #9294

Merged
merged 9 commits into from
Apr 6, 2024
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"clean": "yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete",
"clean:build": "del-cli 'build/*' !build/vega-lite-schema.json",
"data": "rsync -r node_modules/vega-datasets/data/* site/data",
"build-editor-preview": "scripts/build-editor-preview.sh",
"schema": "mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",
"renameschema": "scripts/rename-schema.sh",
"presite": "yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",
Expand Down Expand Up @@ -138,5 +139,6 @@
},
"engines": {
"node": ">=18"
}
},
"packageManager": "yarn@1.22.19"
}
36 changes: 36 additions & 0 deletions scripts/build-editor-preview.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

set -eo pipefail

# Build the docs site and replace the main build with the local copy of vega-lite
echo "Attempting install"
# apt install rsync

yarn build
yarn link
git clone https://github.com/vega/editor.git

#
cd editor
yarn --frozen-lockfile --ignore-scripts
yarn link vega-lite

# TODO: load in real files if we can get rsync installed in the runner someday?
# Put index.json files in public/spec/vega-lite and public/spec/vega
echo "Creating stub index.json for each vega library"

mkdir -p public/spec/vega-lite
mkdir -p public/spec/vega
touch public/spec/vega-lite/index.json
touch public/spec/vega/index.json

cat <<EOF > public/spec/vega-lite/index.json
{}
EOF

cat <<EOF > public/spec/vega/index.json
{}
EOF

# TBD if some vendor files are needed
yarn run vite build --base /
Loading