Skip to content

Studio: vendor shadcn's tailwind.css instead of installing the shadcn CLI - #15635

Merged
danielhanchen merged 1 commit into
mainfrom
studio-frontend-vendor-shadcn-css
Oct 28, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
studio-frontend-vendor-shadcn-css

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

shadcn is a runtime dependency of the Studio frontend only for one stylesheet: src/index.css does @import "shadcn/tailwind.css", which resolves to the package's 1.7 KB dist/tailwind.css (Tailwind @theme keyframes, @custom-variants and one utility). The package itself is the shadcn CLI, so every npm ci of the frontend (CI, studio/setup.sh source installs, developers) installs it and its dependency tree: 272 packages and about 73 MB of node_modules, roughly a quarter of the frontend's installed packages.

What changes

  • New studio/frontend/src/shadcn-tailwind.css: shadcn 4.7.0's dist/tailwind.css (the version the lockfile pins), byte for byte below a header carrying its MIT notice.
  • src/index.css imports ./shadcn-tailwind.css instead of shadcn/tailwind.css.
  • tests/sidebar-inset-selectors.test.ts reads the vendored file instead of resolving it from the package.
  • npm uninstall shadcn. components.json stays, so npx shadcn@latest add ... still works for adding components.

Results

main this PR
Packages installed by npm ci 1,061 789 (-272)
node_modules 926 MB 840 MB (-86 MB on this host)
Production dist/ 871 files 871 files, byte identical (sha256 of every file)

The lockfile only loses entries: no remaining package changes version or path. The added lines are "dev": true flags on packages that were previously also reachable from shadcn and are now only pulled in by dev dependencies.

Tests

  • Frontend suite: 14,249 passed, 0 failed (same as main). Typecheck passes.
  • scripts/check_frontend_dep_removal.py --base origin/main --enumerate-dead (the CI dependency-removal gate): passes, "all removed packages are safe to drop". tests/studio/test_frontend_dep_removal.py: 14/14 cases pass.

Not covered

  • A later shadcn release could change its tailwind.css; with the file vendored, picking that up is a manual copy. The file has not changed in substance across the 4.x releases the lockfile has used.

danielhanchen added a commit that referenced this pull request Oct 28, 2026
## Summary

`pip scan-packages :: extras` now fails on unrelated PRs (#15634,
#15635) with one unbaselined finding:

```
[1] HIGH  Advanced obfuscation (marshal/compile/zlib) + exec/eval
    Package:  triton
    File:     triton/_compile_warmup_pool.py
    Evidence: Obfusc: L149:  code = compile(jit_function.src, function.__name__, "exec")
    Evidence: Exec: L151:    exec(code, namespace)
```

`triton/_compile_warmup_pool.py` is new in triton 3.9.0, which the
extras lane now resolves.

## Review

Lines 131-156 of that file, in
`_JITFunctionPickler._reduce_jit_codegen_fn`:
- When triton cloudpickles a `@triton.jit` function to its
compile-warmup process pool and the function's code object name differs
from its own name, it recompiles that function's own source
(`jit_function.src`).
- It runs that source in a scratch namespace built from the function's
globals, to discover which globals the pickled function needs.
- No downloaded or external input reaches `compile` / `exec`.

It is the same first-party codegen pattern as the already-baselined
`triton/runtime/interpreter.py` entry, so it is baselined rather than
pinned away.

## Change

`scripts/scan_packages_baseline.json`: one entry for `(triton,
triton/_compile_warmup_pool.py, "Advanced obfuscation
(marshal/compile/zlib) + exec/eval")` with evidence hash `d9e13c23...`.
- The entry was generated by `scan_packages.py triton==3.9.0
--write-baseline` and inserted after the other triton entries.
- The rest of the file is byte-identical.
- If the matched code changes, the hash stops matching and the finding
reopens.

## Testing

- `python scripts/scan_packages.py triton==3.9.0`: `1 HIGH`, exit 1, on
main; exit 0 with this entry (only 3 MEDIUM remain).
- `tests/security/test_scan_packages.py` and
`tests/studio/install/test_diffusers_pin.py`: 209 passed.
@danielhanchen danielhanchen self-assigned this Oct 28, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-28T07:10:53.681438Z
We couldn’t complete this review. Comment @codex review to try again.
97da557 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 97da55759c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen marked this pull request as ready for review October 28, 2026 07:10
@danielhanchen
danielhanchen merged commit b648802 into main Oct 28, 2026
69 of 98 checks passed
@danielhanchen
danielhanchen deleted the studio-frontend-vendor-shadcn-css branch October 28, 2026 07:10
danielhanchen added a commit that referenced this pull request Oct 28, 2026
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 28, 2026
)

Bumps `zod` 4.4.3 -> 4.6.7 in `studio/frontend/package-lock.json`
(transitive, via `@assistant-ui/react` and `eslint-plugin-react-hooks`).
Closes GHSA-mrhx (high).

Narrowed from the Dependabot group (the same pair was proposed in
unslothai#15636, which Dependabot closed after main dropped the shadcn CLI):

- **shadcn**: unslothai#15635 removed the shadcn CLI and vendored its
`tailwind.css`, which also removed the CLI's dependency tree
(body-parser, hono, qs, fast-uri, ...) and their advisories.
- **katex**: stays on 0.16.47. katex 0.18 renamed 20 CSS classes
(`.base`, `.strut`, `.sizing`, `.tag`, ...) that the 0.16 renderers used
by rehype-katex, @streamdown/math, mermaid and micromark-extension-math
still emit, so math would lose its styles. 0.18 also does not close the
katex advisory.

zod 4.6.7 was published 2026-10-12, so it passes `.npmrc`'s
`min-release-age=7`; the lockfile integrity matches the registry.

## Checks (current main vs this branch)

- `npm ci`, `npm run build`: pass on both.
- Built `dist/`: same file set, every file byte-identical.
- `npm test`: 14332 passed on both; the same single test (`text and
lines head away from whatever they are drawn on`) fails on main and
here.
- `npm audit`: 10 (2 high, 8 low) -> 9 (1 high, 8 low). The remaining
high is node-forge GHSA-86w9 (its fix, 1.4.2, is a day old); the lows
are the katex chain with no 0.16.x fix.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Han <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant