Skip to content

refactor: vendor json-format-highlight, drop npm dependency#61

Merged
khromov merged 8 commits into
mainfrom
vendor-json-highlight
May 27, 2026
Merged

refactor: vendor json-format-highlight, drop npm dependency#61
khromov merged 8 commits into
mainfrom
vendor-json-highlight

Conversation

@khromov

@khromov khromov commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Vendors json-format-highlight as a TypeScript source file in packages/mochi/src/vendor/json-format-highlight/
  • Switches the only consumer (IslandRow.svelte debug bar) to import from the vendored copy
  • Removes the json-format-highlight npm dependency and its ambient type declaration

Test plan

  • bun run checks passes (lint, format, typecheck, tests)
  • Open debug bar on dev site, expand an island row — JSON props should render with syntax highlighting

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Mochi review report

Try this PR

Expand instructions
gh run download -R khromov/mochi 26542314352 -n mochi-framework-pr -D /tmp/mochi-pr && bun i /tmp/mochi-pr/mochi-framework-pr.tgz

Download manually

Dependency report

Expand report
Direct: 13
Peer:   3 (svelte, @tailwindcss/node, @tailwindcss/oxide)
Dev:    8
Total unique packages reachable from production deps (roots + transitive): 31
Total on-disk size of those packages: 5.26 MB

Toplist — direct deps ranked by total size (self + transitive):
      total       self  count  package
    4.77 MB    2.71 MB     19  svelte
   534.0 kB   449.0 kB      1  magic-string
   189.0 kB   146.0 kB      1  stale-while-revalidate-cache
   180.6 kB   145.3 kB      1  chokidar
    51.2 kB    51.2 kB      0  devalue
    30.4 kB    30.4 kB      0  deepmerge
    28.0 kB    28.0 kB      0  negotiator
    25.8 kB    25.8 kB      0  mitt
    25.3 kB    25.3 kB      0  js-cookie
    13.4 kB    13.4 kB      0  nanoid
    12.3 kB    12.3 kB      0  zimmerframe
     8.4 kB     8.4 kB      0  debounce
     5.2 kB     5.2 kB      0  @types/negotiator

Transitive breakdown for the heaviest deps:

  svelte (19, 2.05 MB transitive): @jridgewell/gen-mapping (91.6 kB), @jridgewell/remapping (58.0 kB), @jridgewell/resolve-uri (51.9 kB), @jridgewell/sourcemap-codec (85.0 kB), @jridgewell/trace-mapping (143.3 kB), @sveltejs/acorn-typescript (194.2 kB), @types/estree (25.5 kB), @types/trusted-types (8.4 kB), acorn (545.5 kB), aria-query (172.8 kB), axobject-query (108.3 kB), clsx (8.4 kB), devalue (51.2 kB), esm-env (3.7 kB), esrap (86.1 kB), is-reference (3.9 kB), locate-character (5.2 kB), magic-string (449.0 kB), zimmerframe (12.3 kB)

  magic-string (1, 85.0 kB transitive): @jridgewell/sourcemap-codec (85.0 kB)

  stale-while-revalidate-cache (1, 43.0 kB transitive): emittery (43.0 kB)

  chokidar (1, 35.3 kB transitive): readdirp (35.3 kB)

Lines of code

packages/mochi
Category main PR Δ
Other 1893 1940 +47
Total 16175 16222 +47

Unchanged: src/**/*.test.ts (5401), src/Mochi.ts (1103), src/ComponentRegistry.ts (1516), src/hooks.ts (229), src/{requestContext,forms,errors}.ts (260), src/{events,log,logger}.ts (322), src/consoleLogger.ts (342), src/cookies*.ts (157), src/extensions.ts (191), src/cache.ts (60), src/middleware/** (81), src/enhance*.ts (184), src/build*.ts (250), src/proxy.ts (125), src/cli* (112), src/{csrf,serverIslandCrypto}.ts (240), src/{types.ts,*.d.ts} (608), src/web-components/** (445), src/debug-bar/** (1866), src/templates/** (790).

packages/docs
Category main PR Δ
Total 3588 3588 0

Unchanged: Docs (3588).

packages/site
Category main PR Δ
Total 9963 9963 0

Unchanged: src/demos/** (5616), src/components/** (2078), src/lib/** (938), src/stores/** (26), Other (1305).

packages/demos
Category main PR Δ
Total 3107 3107 0

Unchanged: src/hn/** (1085), Other (2022).

packages/minimal
Category main PR Δ
Total 538 538 0

Unchanged: Other (538).

packages/cli
Category main PR Δ
Total 479 479 0

Unchanged: src/**/*.test.ts (117), src/cli* (138), src/{create,templates,utils}.ts (220), Other (4).

@khromov khromov merged commit 0b88399 into main May 27, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request May 27, 2026
khromov pushed a commit that referenced this pull request May 29, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>mochi-framework: 0.5.0</summary>

##
[0.5.0](mochi-framework-v0.4.0...mochi-framework-v0.5.0)
(2026-05-28)


### Features

* hot-swap route handlers in dev mode
([#41](#41))
([106a4a2](106a4a2))
* opt-in route warmup to pre-warm static pages at startup
([#64](#64))
([9f28ede](9f28ede))
* replace highlight.js with Shiki
([#54](#54))
([3d2dc6a](3d2dc6a))


### Code Refactoring

* replace `cookie` npm package with Bun native cookie APIs
([#60](#60))
([4e0d953](4e0d953))
* run all tests in per-file isolation, drop .isolated.test.ts suffix
([#55](#55))
([68cdc06](68cdc06))
* vendor debounce, drop npm dependency
([#63](#63))
([d465fea](d465fea))
* vendor json-format-highlight, drop npm dependency
([#61](#61))
([0b88399](0b88399))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@khromov khromov deleted the vendor-json-highlight branch June 6, 2026 20:39
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