Skip to content

Conversation

@theoephraim
Copy link
Member

@theoephraim theoephraim commented May 13, 2025

adds a bash install script, meant to be consumed via curl, via some redirecting/shortened url, for example:
curl -sSfL https://varlock.dev/install.sh | sh -s

The script is fetching our homebrew tap/formula to determine the current latest version. A simpler method used by other projects is to rely on github's "latest" release, but because we release multiple packages from our monorepo, and changesets creates a release for each, there is no guarantee that the "latest" will be a varlock release. Fetching from our homebrew formula is a little weird, but it will keep the 2 install methods in sync, and we are already updating that file with the latest version number. Fetching it from anywhere else would mean keeping yet another thing in sync.

One other option would be fetching that version number from npm, but the npm package gets published via changesets before the binary release workflow runs - so there is a short time where these 2 things may not be in sync.

Some other notes

  • if homebrew is detected, it will install via homebrew, unless --force-no-brew flag is set
  • default install dir is ~/.varlock/bin (we anticipate shoving other stuff in there)

future improvements to the install script could be

  • check if current version is already installed
  • confirm if user wants to install globally, especially if we detect a package.json file in the current directory
  • cleanup if install fails
  • more error checks and messages

@changeset-bot
Copy link

changeset-bot bot commented May 13, 2025

⚠️ No Changeset found

Latest commit: d7875e8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented May 13, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
varlock-website d7875e8 Visit preview May 14 2025, 07:33 PM

@pkg-pr-new
Copy link

pkg-pr-new bot commented May 13, 2025

Open in StackBlitz

npm i https://pkg.pr.new/dmno-dev/varlock/@env-spec/parser@18
npm i https://pkg.pr.new/dmno-dev/varlock@18

commit: d7875e8

@theoephraim theoephraim force-pushed the main branch 5 times, most recently from afc722f to a4cf270 Compare May 13, 2025 23:19
@theoephraim theoephraim reopened this May 13, 2025
@theoephraim theoephraim requested a review from philmillman May 13, 2025 23:52
Copy link
Member

@philmillman philmillman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🚀
we may want to an action that does a quick smoke test to install it and maybe run a command to verify the installation

@philmillman
Copy link
Member

should we default to add it to their PATH as well?

@theoephraim theoephraim merged commit dac696b into main May 26, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants