-
Notifications
You must be signed in to change notification settings - Fork 0
chore(infra): add bin/setup and bin/check #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/usr/bin/env bash | ||
| # The CI gate as a single command: typecheck, lint, test — in the order the | ||
| # platform's Bun stack profile declares, so the first red leg fails the script | ||
| # with a tail that names what was wrong. | ||
| # | ||
| # Anything this runs, CI runs too — set `SKIP_BROWSER_INTEGRATION=1` the way CI | ||
| # does (`.github/workflows/ci.yml`: the BrowserAdapter integration suite flakes | ||
| # under the runner's 2-vCPU load, so CI skips it; the e2e suite covers the real | ||
| # browser→findings path in CI). Run `bin/setup` first. | ||
| set -euo pipefail | ||
|
|
||
| cd "$(dirname "$0")/.." | ||
|
|
||
| # `&&` not `;`: set -e + `&&` fails on the FIRST red leg, so the captured | ||
| # tail names the stage that broke instead of a downstream error masking it. | ||
| echo "==> typecheck" | ||
| bun run typecheck | ||
|
|
||
| echo "==> lint" | ||
| bun run lint | ||
|
|
||
| echo "==> test" | ||
| SKIP_BROWSER_INTEGRATION=1 bun test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #!/usr/bin/env bash | ||
| # Install this repo's dependencies and build its dummy/web e2e fixture, so | ||
| # `bin/check` can run end-to-end on a fresh checkout. | ||
| # | ||
| # Idempotent: every step is a no-op when its output is already there. | ||
| # Cwd-independent: `cd` to the repo root before running anything, so the | ||
| # script works no matter where it is invoked from. | ||
| # | ||
| # Stages: | ||
| # 1. mise (if installed) — pin bun + node from .mise.toml / .tool-versions | ||
| # 2. bun install — root deps, so `bunx tsc` resolves | ||
| # 3. dummy/web fixture — `bun install --frozen-lockfile && bun run build` | ||
| # so the e2e suite's static server can find dist/ | ||
| set -euo pipefail | ||
|
|
||
| cd "$(dirname "$0")/.." | ||
|
|
||
| # Guard mise activation the way wurk's bin/setup does: skip cleanly when mise | ||
| # is absent (a laptop without mise still works), activate it when present so a | ||
| # repo-pinned bun version wins over the system one. | ||
| if command -v mise >/dev/null 2>&1; then | ||
| echo "==> mise install" | ||
| mise install | ||
| # `mise env -s bash` emits `export FOO=bar ...` for the current shell; eval | ||
| # it into THIS shell so the `bun` below is the mise-managed one, not PATH. | ||
| eval "$(mise env -s bash)" | ||
| fi | ||
|
|
||
| command -v bun >/dev/null || { echo "X_BUN_MISSING: install bun — https://bun.sh"; exit 1; } | ||
|
|
||
| echo "==> bun install (root)" | ||
| bun install | ||
|
|
||
| # dummy/web is a standalone package with its own bun.lock, so the repo-root | ||
| # install never reaches it. Both `bun test` (src/dummy-web.e2e.test.ts:141) and | ||
| # CI (.github/workflows/ci.yml:42) build the fixture's dist/ up front; doing it | ||
| # here too keeps `bin/check` honest when run from a fresh clone. | ||
| echo "==> dummy/web fixture (install + build)" | ||
| ( | ||
| cd dummy/web | ||
| # --frozen-lockfile under CI only: locally a plain install is fine and lets | ||
| # `bun install` record any newly added dep. `${CI:+...}` is the form | ||
| # `set -u` exempts, so an unset CI expands to nothing. | ||
| bun install ${CI:+--frozen-lockfile} | ||
| bun run build | ||
| ) | ||
|
|
||
| echo "==> ready. try: bin/check" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: developerz-ai/ui-debugger-mcp
Length of output: 31405
Correct the CI equivalence claim.
bin/checkruns typecheck before lint, while.github/workflows/ci.ymlruns lint before typecheck and invokes each Bun command directly. CI also includes install and build steps. Describebin/checkas a local validation entry point, and update the equivalent wording in lines 23–28. Reordering the script alone does not make it the script CI runs.🤖 Prompt for AI Agents