Skip to content

Commit 5d3c644

Browse files
authored
Merge pull request #231533 from Homebrew/varlock-add-formula
varlock 0.0.6 (new formula)
2 parents b42556a + d1e0a99 commit 5d3c644

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Formula/v/varlock.rb

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
class Varlock < Formula
2+
desc "Add declarative schema to .env files using @env-spec decorator comments"
3+
homepage "https://varlock.dev"
4+
url "https://registry.npmjs.org/varlock/-/varlock-0.0.6.tgz"
5+
sha256 "ada6b2a938351f4f6b1ffeec7a1b4a97b3f9a35c586e44e7dfa7fec94fc47e36"
6+
license "MIT"
7+
8+
bottle do
9+
sha256 cellar: :any_skip_relocation, arm64_sequoia: "506af2149a89685fb58e28c2f5e2d41effd22feb0fc0a71e734335d2b1b076c8"
10+
sha256 cellar: :any_skip_relocation, arm64_sonoma: "506af2149a89685fb58e28c2f5e2d41effd22feb0fc0a71e734335d2b1b076c8"
11+
sha256 cellar: :any_skip_relocation, arm64_ventura: "506af2149a89685fb58e28c2f5e2d41effd22feb0fc0a71e734335d2b1b076c8"
12+
sha256 cellar: :any_skip_relocation, sonoma: "1ee7363477cfd62b8dc2304ec235c78d6caeadad323f8ece939f91a8aa608b6c"
13+
sha256 cellar: :any_skip_relocation, ventura: "1ee7363477cfd62b8dc2304ec235c78d6caeadad323f8ece939f91a8aa608b6c"
14+
sha256 cellar: :any_skip_relocation, x86_64_linux: "506af2149a89685fb58e28c2f5e2d41effd22feb0fc0a71e734335d2b1b076c8"
15+
end
16+
17+
depends_on "node"
18+
19+
def install
20+
system "npm", "install", *std_npm_args
21+
bin.install_symlink Dir["#{libexec}/bin/*"]
22+
end
23+
24+
test do
25+
assert_match version.to_s, shell_output("#{bin}/varlock --version")
26+
27+
(testpath/".env.schema").write <<~TEXT
28+
# This is the header, and may contain root decorators
29+
# @envFlag=APP_ENV
30+
# @defaultSensitive=false @defaultRequired=false
31+
# @generateTypes(lang=ts, path=env.d.ts)
32+
# ---
33+
34+
# This is a config item comment block and may contain decorators which affect only the item
35+
# @required @type=enum(dev, test, staging, prod)
36+
APP_ENV=dev
37+
TEXT
38+
39+
assert_match "dev", shell_output("#{bin}/varlock load 2>&1")
40+
end
41+
end

0 commit comments

Comments
 (0)