hashicorp / structure

Structure (aka "PDS") [deprecated]
https://hashicorp-structure.vercel.app
Mozilla Public License 2.0
24 stars 5 forks source link

Build/yarn2 zero install #53

Closed CITguy closed 3 years ago

CITguy commented 3 years ago

Yarn 2 Zero-Install

Updated yarn configuration to make use of Zero-Install capabilities.

In order to remain compatible with logic that expects node_modules/ to exist, we use the nodeLinker: node-modules configuration, which still requires running yarn install after cloning/pulling to generate files. However, yarn will do so from the local cache (.yarn/cache/*) instead of pulling from the remote NPM registry.

The Numbers

Here's what was observed in Vercel log output.

Strategy Screenshot Time Notes
Network Install (before) vercel - yarn install - network install 78s
Zero-Install (after) vercel - yarn install - zero-install 17s 78% faster!

Vercel Build

Vercel builds were also failing on every other push, because of two items:

  1. Vercel has some issues with where the yarn install command has to be run.
  2. The Vercel project was misconfigured to make use of monorepo support.

We can't fix item 1, but I've modified the Vercel configuration to use packages/pds-ember as the Root Directory. vercel - hashicorp - structure - root directory

Additionally, the build settings have been updated to reflect the Root Directory configuration and to reduce log output. Vercel truncates logs to the last 2000 lines, which isn't useful when builds were spitting out a ludicrous amount of unnecessary info. vercel - hashicorp - structure - build and dev settings

NOTE: the BUILD COMMAND will be changed to yarn build:ci (added in this PR) once the PR is merged.

With the configuration changes, builds appear to be finishing successfully, without intermittent errors.

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hashicorp/structure/ep0y4a9rp
✅ Preview: https://structure-git-build-yarn2-zero-install.hashicorp.vercel.app

CITguy commented 3 years ago

Closing. Will submit new PR without the zero-install updates.