Skip to content

Commit 9d471e4

Browse files
chore: Improve verdaccio pipeline (#7900)
* Split up verdaccio file so that we can parallelize building all of the different example applications * turn on verdaccio * add yarn ignore changesets * generate our release versions faster * simplify for debugging * add more information to publish * update version generation * add everything back * turn off verdaccio * Update scripts/buildWebsite.js --------- Co-authored-by: GitHub <[email protected]>
1 parent 6835cce commit 9d471e4

22 files changed

+1897
-835
lines changed

.circleci/comment.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async function run() {
4848
repo: 'react-spectrum',
4949
commit_sha: process.env.CIRCLE_SHA1,
5050
body: `Verdaccio builds:
51-
[CRA Test App](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/build/index.html)
51+
[CRA Test App](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/rsp-cra-18/index.html)
5252
[NextJS Test App](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/next/index.html)
5353
[RAC Tailwind Example](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/rac-tailwind/index.html)
5454
[RAC Spectrum + Tailwind Example](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/rac-spectrum-tailwind/index.html)

.circleci/config.yml

+265-6
Original file line numberDiff line numberDiff line change
@@ -461,22 +461,239 @@ jobs:
461461
paths:
462462
- '*/docs/'
463463

464-
docs-verdaccio:
464+
verdaccio:
465465
executor: rsp-xlarge
466466
steps:
467467
- restore_cache:
468468
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
469469

470470
- run:
471-
name: run verdaccio
472-
command: ./scripts/verdaccio.sh ci
471+
name: run verdaccio and publish built packages
472+
command: |
473+
mkdir -p verdaccio-workspace
474+
./scripts/verdaccio-ci.sh
475+
./scripts/verdaccio-deploy.sh
476+
environment:
477+
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
473478

474479
# Store the prod docs website w/ verdaccio packages in a separate dist folder so it doesn't get deployed by "deploy" workflow
475480
# This is because we have a separate deploy flow for the test prod docs website so it doesn't hold up the normal "deploy" workflow
481+
- persist_to_workspace:
482+
root: /tmp/verdaccio-workspace
483+
paths:
484+
- storage
485+
486+
v-docs:
487+
executor: rsp-xlarge
488+
steps:
489+
- restore_cache:
490+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
491+
492+
- attach_workspace:
493+
at: /tmp/verdaccio-workspace
494+
495+
- run:
496+
name: build docs off verdaccio
497+
command: |
498+
./scripts/verdaccio-ci.sh
499+
./scripts/verdaccio-build.sh
500+
environment:
501+
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
502+
503+
- persist_to_workspace:
504+
root: verdaccio_dist
505+
paths:
506+
- '*/verdaccio/docs'
507+
508+
v-rsp-cra-18:
509+
executor: rsp-xlarge
510+
steps:
511+
- restore_cache:
512+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
513+
514+
- attach_workspace:
515+
at: /tmp/verdaccio-workspace
516+
517+
- run:
518+
name: build react-spectrum-cra-18 off verdaccio
519+
command: |
520+
./scripts/verdaccio-ci.sh
521+
./scripts/verdaccio-build-rsp-cra-18.sh
522+
environment:
523+
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
524+
525+
- persist_to_workspace:
526+
root: verdaccio_dist
527+
paths:
528+
- '*/verdaccio/rsp-cra-18'
529+
530+
v-webpack-4:
531+
executor: rsp-xlarge
532+
steps:
533+
- restore_cache:
534+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
535+
536+
- attach_workspace:
537+
at: /tmp/verdaccio-workspace
538+
539+
- run:
540+
name: build webpack-4 off verdaccio
541+
command: |
542+
./scripts/verdaccio-ci.sh
543+
./scripts/verdaccio-build-webpack-4.sh
544+
environment:
545+
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
546+
547+
- persist_to_workspace:
548+
root: verdaccio_dist
549+
paths:
550+
- '*/verdaccio/webpack-4'
551+
552+
v-nextjs:
553+
executor: rsp-xlarge
554+
steps:
555+
- restore_cache:
556+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
557+
558+
- attach_workspace:
559+
at: /tmp/verdaccio-workspace
560+
561+
- run:
562+
name: build nextjs off verdaccio
563+
command: |
564+
./scripts/verdaccio-ci.sh
565+
./scripts/verdaccio-build-nextjs.sh
566+
environment:
567+
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
568+
476569
- persist_to_workspace:
477570
root: verdaccio_dist
478571
paths:
479-
- '*/verdaccio/'
572+
- '*/verdaccio/next'
573+
574+
v-rac-tailwind:
575+
executor: rsp-xlarge
576+
steps:
577+
- restore_cache:
578+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
579+
580+
- attach_workspace:
581+
at: /tmp/verdaccio-workspace
582+
583+
- run:
584+
name: build rac-tailwind off verdaccio
585+
command: |
586+
./scripts/verdaccio-ci.sh
587+
./scripts/verdaccio-build-rac-tailwind.sh
588+
environment:
589+
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
590+
591+
- persist_to_workspace:
592+
root: verdaccio_dist
593+
paths:
594+
- '*/verdaccio/rac-tailwind'
595+
596+
v-rac-rsp-tailwind:
597+
executor: rsp-xlarge
598+
steps:
599+
- restore_cache:
600+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
601+
602+
- attach_workspace:
603+
at: /tmp/verdaccio-workspace
604+
605+
- run:
606+
name: build rac-rsp-tailwind off verdaccio
607+
command: |
608+
./scripts/verdaccio-ci.sh
609+
./scripts/verdaccio-build-rac-rsp-tailwind.sh
610+
environment:
611+
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
612+
613+
- persist_to_workspace:
614+
root: verdaccio_dist
615+
paths:
616+
- '*/verdaccio/rac-spectrum-tailwind'
617+
618+
v-s2-parcel:
619+
executor: rsp-xlarge
620+
steps:
621+
- restore_cache:
622+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
623+
624+
- attach_workspace:
625+
at: /tmp/verdaccio-workspace
626+
627+
- run:
628+
name: build s2-parcel off verdaccio
629+
command: |
630+
./scripts/verdaccio-ci.sh
631+
./scripts/verdaccio-build-s2-parcel.sh
632+
environment:
633+
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
634+
635+
- persist_to_workspace:
636+
root: verdaccio_dist
637+
paths:
638+
- '*/verdaccio/s2-parcel-example'
639+
640+
v-s2-webpack:
641+
executor: rsp-xlarge
642+
steps:
643+
- restore_cache:
644+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
645+
646+
- attach_workspace:
647+
at: /tmp/verdaccio-workspace
648+
649+
- run:
650+
name: build s2-webpack off verdaccio
651+
command: |
652+
./scripts/verdaccio-ci.sh
653+
./scripts/verdaccio-build-s2-webpack.sh
654+
environment:
655+
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
656+
657+
- persist_to_workspace:
658+
root: verdaccio_dist
659+
paths:
660+
- '*/verdaccio/s2-webpack-5-example'
661+
662+
v-icon-builder:
663+
executor: rsp-xlarge
664+
steps:
665+
- restore_cache:
666+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
667+
668+
- attach_workspace:
669+
at: /tmp/verdaccio-workspace
670+
671+
- run:
672+
name: build icon-builder off verdaccio
673+
command: |
674+
./scripts/verdaccio-ci.sh
675+
./scripts/verdaccio-build-icon-builder.sh
676+
environment:
677+
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
678+
679+
v-publish-stats:
680+
executor: rsp
681+
steps:
682+
- restore_cache:
683+
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
684+
685+
- attach_workspace:
686+
at: /tmp/verdaccio_dist
687+
688+
- run:
689+
name: build size diffs off verdaccio
690+
command: |
691+
./scripts/verdaccio-build-pre-azure.sh
692+
693+
- persist_to_workspace:
694+
root: verdaccio_dist
695+
paths:
696+
- '*/verdaccio/publish-stats'
480697

481698
deploy:
482699
docker:
@@ -646,12 +863,45 @@ workflows:
646863
- docs:
647864
requires:
648865
- install
649-
- docs-verdaccio:
866+
- verdaccio:
650867
filters:
651868
branches:
652869
only: main
653870
requires:
654871
- install
872+
- v-docs:
873+
requires:
874+
- verdaccio
875+
- v-rsp-cra-18:
876+
requires:
877+
- verdaccio
878+
- v-webpack-4:
879+
requires:
880+
- verdaccio
881+
- v-nextjs:
882+
requires:
883+
- verdaccio
884+
- v-rac-tailwind:
885+
requires:
886+
- verdaccio
887+
- v-rac-rsp-tailwind:
888+
requires:
889+
- verdaccio
890+
- v-s2-parcel:
891+
requires:
892+
- verdaccio
893+
- v-s2-webpack:
894+
requires:
895+
- verdaccio
896+
- v-icon-builder:
897+
requires:
898+
- verdaccio
899+
- v-publish-stats:
900+
requires:
901+
- verdaccio
902+
- v-webpack-4
903+
- v-nextjs
904+
- v-rsp-cra-18
655905
- deploy:
656906
requires:
657907
- lint
@@ -670,7 +920,16 @@ workflows:
670920
- docs
671921
- deploy-verdaccio:
672922
requires:
673-
- docs-verdaccio
923+
- v-docs
924+
- v-rsp-cra-18
925+
- v-webpack-4
926+
- v-nextjs
927+
- v-rac-tailwind
928+
- v-rac-rsp-tailwind
929+
- v-s2-parcel
930+
- v-s2-webpack
931+
- v-icon-builder
932+
- v-publish-stats
674933
- comment:
675934
name: comment-pr
676935
filters:

.yarnrc.yml

+5
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ yarnPath: .yarn/releases/yarn-4.2.2.cjs
1212

1313
plugins:
1414
- .yarn/plugins/plugin-nightly-prep.js
15+
16+
changesetIgnorePatterns:
17+
- "**/*.test.*"
18+
- "**/*.md"
19+
- "**/test/**"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
"tempy": "^0.5.0",
210210
"typescript": "^5.5.0",
211211
"typescript-eslint": "^8.9.0",
212-
"verdaccio": "^5.13.0",
212+
"verdaccio": "^6.0.0",
213213
"walk-object": "^4.0.0",
214214
"wsrun": "^5.0.0",
215215
"xml": "^1.0.1",

scripts/buildWebsite.js

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ async function build() {
8686
'@parcel/transformer-css': packageJSON['@parcel/transformer-css']
8787
};
8888

89+
8990
// Add dependencies on each published package to the package.json, and
9091
// copy the docs from the current package into the temp dir.
9192
let packagesDir = path.join(__dirname, '..', 'packages');

scripts/compareSize.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ async function compareBuildAppSize() {
2222

2323
if (commit) {
2424
// Attempt to pull stats from last publish commit. If they don't exist, pull from a hardcoded commit (fallback until these records are generated for a first publish w/ this script)
25-
let lastAppStatUrl = `https://reactspectrum.blob.core.windows.net/reactspectrum/${commit}/verdaccio/publish-stats/${currentAppStatsFile}`;
26-
let lastPublishStatUrl = `https://reactspectrum.blob.core.windows.net/reactspectrum/${commit}/verdaccio/publish-stats/${currentPublishStatsFile}`;
25+
let lastAppStatUrl = `https://reactspectrum.blob.core.windows.net/reactspectrum/${commit}/verdaccio/rsp-cra-18/publish-stats/${currentAppStatsFile}`;
26+
let lastPublishStatUrl = `https://reactspectrum.blob.core.windows.net/reactspectrum/${commit}/verdaccio/rsp-cra-18/publish-stats/${currentPublishStatsFile}`;
2727
let lastAppStatPath = path.join(__dirname, '..', lastAppStatsFile);
2828
let lastPublishStatPath = path.join(__dirname, '..', lastPublishStatsFile);
2929
await download(lastAppStatUrl, lastAppStatPath);
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
port=4000
4+
registry="http://localhost:$port"
5+
output="output.out"
6+
7+
set -e
8+
9+
echo "Building docs with verdaccio"
10+
11+
# Wait for verdaccio to start
12+
grep -q 'http address' <(tail -f $output)
13+
14+
if curl -sI http://localhost:4000/ >/dev/null; then
15+
echo "Verdaccio is running on port 4000."
16+
else
17+
echo "Verdaccio is NOT running on port 4000."
18+
fi
19+
20+
curl -s http://localhost:4000/@adobe/react-spectrum
21+
22+
yarn config set npmPublishRegistry --home $registry
23+
yarn config set npmRegistryServer --home $registry
24+
yarn config set npmAlwaysAuth --home false
25+
yarn config set npmAuthToken --home abc
26+
yarn config set unsafeHttpWhitelist --home localhost
27+
npm set registry $registry
28+
29+
# Rename the dist folder from dist/production/docs to verdaccio_dist/COMMIT_HASH_BEFORE_PUBLISH/verdaccio/docs
30+
# This is so we can have verdaccio build in a separate stream from deploy and deploy_prod
31+
verdaccio_path=verdaccio_dist/`git rev-parse HEAD~0`/verdaccio
32+
mkdir -p $verdaccio_path
33+
34+
echo 'test icon builder'
35+
cd examples/s2-webpack-5-example
36+
mkdir icon-test
37+
cp ../../packages/@react-spectrum/s2/s2wf-icons/S2_Icon_3D_20_N.svg icon-test/S2_Icon_3D_20_N.svg
38+
npx @react-spectrum/s2-icon-builder -i ./icon-test/S2_Icon_3D_20_N.svg -o ./icon-dist
39+
40+
netstat -tpln | awk -F'[[:space:]/:]+' '$5 == 4000 {print $(NF-2)}' | xargs kill

0 commit comments

Comments
 (0)