diff --git a/.circleci/comment.js b/.circleci/comment.js index fc238675dfe..49bbd89f65b 100644 --- a/.circleci/comment.js +++ b/.circleci/comment.js @@ -52,6 +52,7 @@ async function run() { [NextJS Test App](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/next/index.html) [RAC Spectrum + Tailwind Example](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/rac-spectrum-tailwind/index.html) [S2 Parcel Example](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/s2-parcel-example/index.html) + [S2 Vite Example](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/s2-vite-project/index.html) [S2 Custom Icons](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/icon-builder-fixture/index.html) [S2 Webpack Example](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/s2-webpack-5-example/index.html) [S2 Next.js Example](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/s2-next-macros/index.html) diff --git a/.circleci/config.yml b/.circleci/config.yml index 48d45555b3d..b127b021741 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -693,6 +693,28 @@ jobs: paths: - '*/verdaccio/s2-parcel-example' + v-s2-vite: + executor: rsp-xlarge + steps: + - restore_cache: + key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }} + + - attach_workspace: + at: /tmp/verdaccio-workspace + + - run: + name: build s2-vite off verdaccio + command: | + ./scripts/verdaccio-ci.sh + ./scripts/verdaccio-build-s2-vite.sh + environment: + VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage + + - persist_to_workspace: + root: verdaccio_dist + paths: + - '*/verdaccio/s2-vite-project' + v-s2-webpack: executor: rsp-xlarge steps: @@ -999,6 +1021,9 @@ workflows: - v-s2-parcel: requires: - verdaccio + - v-s2-vite: + requires: + - verdaccio - v-s2-webpack: requires: - verdaccio @@ -1054,6 +1079,7 @@ workflows: - v-nextjs - v-rac-rsp-tailwind - v-s2-parcel + - v-s2-vite - v-s2-webpack - v-s2-next - v-icon-builder diff --git a/scripts/verdaccio-build-s2-vite.sh b/scripts/verdaccio-build-s2-vite.sh new file mode 100755 index 00000000000..996abd8fa00 --- /dev/null +++ b/scripts/verdaccio-build-s2-vite.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +port=4000 +registry="http://localhost:$port" +output="output.out" +touch $output + +set -e + +echo "Building docs with verdaccio" + +# Wait for verdaccio to start +grep -q 'http address' <(tail -f $output) + +if curl -sI http://localhost:4000/ >/dev/null; then + echo "Verdaccio is running on port 4000." +else + echo "Verdaccio is NOT running on port 4000." +fi + +yarn config set npmPublishRegistry --home $registry +yarn config set npmRegistryServer --home $registry +yarn config set npmAlwaysAuth --home false +yarn config set npmAuthToken --home abc +yarn config set unsafeHttpWhitelist --home localhost +npm set registry $registry + +# Rename the dist folder from dist/production/docs to verdaccio_dist/COMMIT_HASH_BEFORE_PUBLISH/verdaccio/docs +# This is so we can have verdaccio build in a separate stream from deploy and deploy_prod +verdaccio_path=verdaccio_dist/`git rev-parse HEAD~0`/verdaccio +mkdir -p $verdaccio_path + + +echo 'build Spectrum 2 + Vite test app' +cd examples/s2-vite-project +yarn config set npmRegistryServer $registry +yarn install --no-immutable +yarn up @react-spectrum/s2 +yarn build --base="./" +mv dist ../../$verdaccio_path/s2-vite-project + +netstat -tpln | awk -F'[[:space:]/:]+' '$5 == 4000 {print $(NF-2)}' | xargs kill