Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions packages/zvelte-check-bin/build.ncl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
let { Attrs, BuildSpec, Local, OutputBin, Source, .. } = import "minimal.ncl" in
let { target, .. } = import "config.ncl" in
let base = import "../base/build.ncl" in

# Imported from the Homebrew formula `ampcode/homebrew-tap/zvelte-check` by `pkgmgr import homebrew`.
#
# PREBUILT vendor binary — there is no source build. The pinned sha256
# per architecture is the ONLY integrity anchor for this package.
let version = "0.2.0" in
let target_suffix = match { { arch = 'Amd64, .. } => "x86_64", { arch = 'Arm64, .. } => "aarch64" } target in
{
name = "zvelte-check-bin",
build_deps = [
{ file = "build.sh" } | Local,
match {
{ arch = 'Amd64, .. } =>
{
url = "https://github.com/ampcode/zvelte-check/releases/download/v%{version}/zvelte-check-linux-x86_64.tar.gz",
sha256 = "f3326fe48a0a2bc056b16ce424abd705ca7864d3632fd8f02ace1ea8ecfc8b9b",
} | Source,
{ arch = 'Arm64, .. } =>
{
url = "https://github.com/ampcode/zvelte-check/releases/download/v%{version}/zvelte-check-linux-aarch64.tar.gz",
sha256 = "05a2661648952ba12b2da618242698c3065d2db375340cb605288a38f59c4105",
} | Source,
} target,
base,
],
# No runtime_deps: the installed binary is statically linked
# (verified against the built tree, not assumed).

cmd = "./build.sh",
build_args = { include version, arch = target_suffix },

outputs = {
zvelte-check = { glob = "usr/bin/zvelte-check" } | OutputBin,
},

attrs =
{
upstream_version = version,
license_spdx = "MIT",
source_provenance = {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If this is truly a binary fetch, drop source provenance and set binary_from. Also if its closed source you need closed_source = true.

category = 'GithubRepo,
owner = "ampcode",
repo = "zvelte-check",
},
} | Attrs,
} | BuildSpec
7 changes: 7 additions & 0 deletions packages/zvelte-check-bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
# Imported from the Homebrew formula `ampcode/homebrew-tap/zvelte-check` by `pkgmgr import homebrew`.
# Prebuilt vendor binary: unpacked and installed, never compiled.
set -ex
Comment on lines +1 to +4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Use the required Bash strict mode.

The build script must start with #!/bin/bash and set -euo pipefail; the current /bin/sh and set -ex combination does not satisfy that contract and does not fail immediately when required variables are unset.

Proposed fix
-#!/bin/sh
+#!/bin/bash
@@
-set -ex
+set -euo pipefail
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#!/bin/sh
# Imported from the Homebrew formula `ampcode/homebrew-tap/zvelte-check` by `pkgmgr import homebrew`.
# Prebuilt vendor binary: unpacked and installed, never compiled.
set -ex
#!/bin/bash
# Imported from the Homebrew formula `ampcode/homebrew-tap/zvelte-check` by `pkgmgr import homebrew`.
# Prebuilt vendor binary: unpacked and installed, never compiled.
set -euo pipefail
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/zvelte-check-bin/build.sh` around lines 1 - 4, Update the build
script header to use the Bash interpreter and replace the current shell options
with Bash strict mode, specifically ensuring the script starts with the required
shebang and uses set -euo pipefail.

Source: Coding guidelines


tar -xof "zvelte-check-linux-${MINIMAL_ARG_ARCH}.tar.gz"
install -D -m 755 "zvelte-check" "$OUTPUT_DIR/usr/bin/zvelte-check"