diff --git a/package.json b/package.json index b3f4bd5759..9e63f184e6 100644 --- a/package.json +++ b/package.json @@ -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", @@ -138,5 +139,6 @@ }, "engines": { "node": ">=18" - } + }, + "packageManager": "yarn@1.22.19" } diff --git a/scripts/build-editor-preview.sh b/scripts/build-editor-preview.sh new file mode 100755 index 0000000000..9057003b9a --- /dev/null +++ b/scripts/build-editor-preview.sh @@ -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 < public/spec/vega-lite/index.json +{} +EOF + +cat < public/spec/vega/index.json +{} +EOF + +# TBD if some vendor files are needed +yarn run vite build --base /