Open pepopowitz opened 3 hours ago
I got excited about this idea and started exploring it, but it became a can of worms and I had to stop. I also may have taken the wrong approach -- I forgot about the fact that we have all these scripts already for isolating a single version, and I ended up duplicating them in JavaScript instead of BASH.
I've captured everything I did at https://gist.github.com/pepopowitz/6139b8b8a54c0f15b59a9dfd3c025bb0. It does not yet handle the sidebar navigation -- it was at this point that I remembered the isolation scripts existed, and I became uncertain whether I preferred to (a) completely reinvent the wheel for all these scripts and have copies of them in both BASH and JavaScript, or (b) rewrite my start-single-version script to use JavaScript just for the ability to roll back changes when the server exits, and rewrite the BASH scripts so that I could consume only pieces of them.
At this point I'm still not sure which of those I prefer. I might even consider a third option -- use JavaScript for as many of these steps as possible, and update the isolateVersion scripts to consume them instead of the sed BASH scripts.
Running the docs locally via
npm start
uses a lot of resources and takes a lot of time, sometimes resulting in crashes, and usually resulting in a frustrating experience.Workaround
The local run can be scoped to only one pair of versions (one main docs instance, one Optimize instance), plus vNext, by making a few changes to configuration:
versions
definitions in the docusaurus.config.jsFeature request
We could add a script like
npm run start:version 8.5
, which would update the local environment to limit it to the specified version (as described in the workaround, and as demonstrated in our version archival scripts), then run the docs.It should probably clean up any changes that it made, so that users don't accidentally commit them.