@peaske7/readit 0.2.1 → 0.3.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +1111 -0
- package/dist/assets/_basePickBy-BMMA4Tou.js +1 -0
- package/dist/assets/_baseUniq-D40qku1I.js +1 -0
- package/dist/assets/arc-Ckg65iy8.js +1 -0
- package/dist/assets/architecture-YZFGNWBL-Dv3EY0zV.js +1 -0
- package/dist/assets/architectureDiagram-Q4EWVU46-ClRss4cm.js +36 -0
- package/dist/assets/array-Bjz-wYpJ.js +1 -0
- package/dist/assets/blockDiagram-DXYQGD6D-CBcFvoK1.js +132 -0
- package/dist/assets/c4Diagram-AHTNJAMY-D4d3ZLam.js +10 -0
- package/dist/assets/channel-D9EJxDy_.js +1 -0
- package/dist/assets/chunk-2KRD3SAO-DaFfaCGO.js +1 -0
- package/dist/assets/chunk-336JU56O-yLEQoF0v.js +2 -0
- package/dist/assets/chunk-426QAEUC-Uyzd4wAA.js +1 -0
- package/dist/assets/chunk-4BX2VUAB-DRuTD7x5.js +1 -0
- package/dist/assets/chunk-4TB4RGXK-3xbpIi_o.js +206 -0
- package/dist/assets/chunk-55IACEB6-BExiaAoD.js +1 -0
- package/dist/assets/chunk-5FUZZQ4R-DatVvHnF.js +62 -0
- package/dist/assets/chunk-5PVQY5BW-BKgvrGh8.js +2 -0
- package/dist/assets/chunk-67CJDMHE-DMt8LNEX.js +1 -0
- package/dist/assets/chunk-7N4EOEYR-CzLGefVf.js +1 -0
- package/dist/assets/chunk-AA7GKIK3-B6GFAk4U.js +1 -0
- package/dist/assets/chunk-BSJP7CBP-BK29yehL.js +1 -0
- package/dist/assets/chunk-CIAEETIT-D7hBXImP.js +1 -0
- package/dist/assets/chunk-Dlc7tRH4.js +1 -0
- package/dist/assets/chunk-EDXVE4YY-PYJdlmyH.js +1 -0
- package/dist/assets/chunk-ENJZ2VHE-DUHKBv6x.js +10 -0
- package/dist/assets/chunk-FMBD7UC4-2FWyCCAV.js +15 -0
- package/dist/assets/chunk-FOC6F5B3-DKFHrt4K.js +1 -0
- package/dist/assets/chunk-ICPOFSXX-Bh__D0ec.js +122 -0
- package/dist/assets/chunk-K5T4RW27-D51O7IkG.js +94 -0
- package/dist/assets/chunk-KGLVRYIC-DMHSCH4T.js +1 -0
- package/dist/assets/chunk-LIHQZDEY-C2aANxt9.js +1 -0
- package/dist/assets/chunk-ORNJ4GCN-Db_37NRX.js +1 -0
- package/dist/assets/chunk-OYMX7WX6-BltXOJLJ.js +231 -0
- package/dist/assets/chunk-QZHKN3VN-8Lcg9gti.js +1 -0
- package/dist/assets/chunk-U2HBQHQK-ByS6tilY.js +70 -0
- package/dist/assets/chunk-X2U36JSP-Bm-4Gqg_.js +1 -0
- package/dist/assets/chunk-XPW4576I-Bqbompq4.js +32 -0
- package/dist/assets/chunk-YZCP3GAM-CsC0imPb.js +1 -0
- package/dist/assets/chunk-ZZ45TVLE-CG-CqfPC.js +1 -0
- package/dist/assets/classDiagram-6PBFFD2Q-Jy1uFUk4.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-ChiLl3rR.js +1 -0
- package/dist/assets/clone-BBjvuERA.js +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-q90QeGKv.js +1 -0
- package/dist/assets/cytoscape.esm-BfXff3fb.js +321 -0
- package/dist/assets/dagre-KV5264BT-BQWiLFJB.js +4 -0
- package/dist/assets/dagre-nn_aIZ2E.js +1 -0
- package/dist/assets/defaultLocale-BwmRmqJp.js +1 -0
- package/dist/assets/diagram-5BDNPKRD-CJa7Y97H.js +10 -0
- package/dist/assets/diagram-G4DWMVQ6-tVQGBWfY.js +24 -0
- package/dist/assets/diagram-MMDJMWI5-CpimFldm.js +43 -0
- package/dist/assets/diagram-TYMM5635-D11WQVgy.js +24 -0
- package/dist/assets/dist-BNz65Ibc.js +1 -0
- package/dist/assets/erDiagram-SMLLAGMA-C2bLd0jS.js +85 -0
- package/dist/assets/flowDiagram-DWJPFMVM-Kw3fOOLT.js +162 -0
- package/dist/assets/ganttDiagram-T4ZO3ILL-fyMhyE2X.js +292 -0
- package/dist/assets/gitGraph-7Q5UKJZL-BGFRt2qs.js +1 -0
- package/dist/assets/gitGraphDiagram-UUTBAWPF-D4JoiOvg.js +106 -0
- package/dist/assets/graphlib-DGcD9J2L.js +1 -0
- package/dist/assets/index-Cow3qpoq.css +2 -0
- package/dist/assets/index-DUf7okYi.js +14 -0
- package/dist/assets/info-OMHHGYJF-DI6-Z9vh.js +1 -0
- package/dist/assets/infoDiagram-42DDH7IO-D1ZkeMBy.js +2 -0
- package/dist/assets/init-TPm5RB77.js +1 -0
- package/dist/assets/isArrayLikeObject-69BLnVNM.js +1 -0
- package/dist/assets/isEmpty-DUS28g5f.js +1 -0
- package/dist/assets/ishikawaDiagram-UXIWVN3A-Dv8hzjZB.js +70 -0
- package/dist/assets/journeyDiagram-VCZTEJTY-COeB7F5r.js +139 -0
- package/dist/assets/kanban-definition-6JOO6SKY-BbYmxCYU.js +89 -0
- package/dist/assets/katex-5SGEXwpi.js +261 -0
- package/dist/assets/line-_v2NGEdn.js +1 -0
- package/dist/assets/linear-CXMqTN8N.js +1 -0
- package/dist/assets/mermaid-config-C8a4L22x.js +1 -0
- package/dist/assets/mermaid-parser.core-CFmphzPP.js +4 -0
- package/dist/assets/mermaid.core-DnHAupTp.js +11 -0
- package/dist/assets/mindmap-definition-QFDTVHPH-D7_lIep7.js +96 -0
- package/dist/assets/ordinal-D7l-8DAO.js +1 -0
- package/dist/assets/packet-4T2RLAQJ-DidW3JFc.js +1 -0
- package/dist/assets/path-BVpCanzE.js +1 -0
- package/dist/assets/pie-ZZUOXDRM-Bff2e5hg.js +1 -0
- package/dist/assets/pieDiagram-DEJITSTG-DDvYHCT_.js +30 -0
- package/dist/assets/quadrantDiagram-34T5L4WZ-DcLcIrdi.js +7 -0
- package/dist/assets/radar-PYXPWWZC-CsdZBH3M.js +1 -0
- package/dist/assets/requirementDiagram-MS252O5E-DLX6ld7D.js +84 -0
- package/dist/assets/rough.esm-BoTisKeL.js +1 -0
- package/dist/assets/sankeyDiagram-XADWPNL6-D-1GtsHM.js +10 -0
- package/dist/assets/sequenceDiagram-FGHM5R23-Bwxs0YQg.js +157 -0
- package/dist/assets/src-CrmkjRpa.js +1 -0
- package/dist/assets/stateDiagram-FHFEXIEX-DW7rOcnQ.js +1 -0
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-Jm-24vQ2.js +1 -0
- package/dist/assets/timeline-definition-GMOUNBTQ-DVdHyzxS.js +120 -0
- package/dist/assets/treeView-SZITEDCU-DPKseaET.js +1 -0
- package/dist/assets/treemap-W4RFUUIX-DH-7GZe_.js +1 -0
- package/dist/assets/vennDiagram-DHZGUBPP-DJaC6xmI.js +34 -0
- package/dist/assets/wardley-RL74JXVD-AgyXyBN5.js +1 -0
- package/dist/assets/wardleyDiagram-NUSXRM2D-CTKERPKv.js +20 -0
- package/dist/assets/xychartDiagram-5P7HB3ND-BuExiLXc.js +7 -0
- package/{index.html → dist/index.html} +2 -1
- package/dist/index.js +2539 -0
- package/package.json +11 -1
- package/.agents/skills/remotion-best-practices/SKILL.md +0 -61
- package/.agents/skills/remotion-best-practices/rules/3d.md +0 -86
- package/.agents/skills/remotion-best-practices/rules/animations.md +0 -27
- package/.agents/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +0 -178
- package/.agents/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +0 -100
- package/.agents/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +0 -108
- package/.agents/skills/remotion-best-practices/rules/assets.md +0 -78
- package/.agents/skills/remotion-best-practices/rules/audio-visualization.md +0 -198
- package/.agents/skills/remotion-best-practices/rules/audio.md +0 -169
- package/.agents/skills/remotion-best-practices/rules/calculate-metadata.md +0 -134
- package/.agents/skills/remotion-best-practices/rules/can-decode.md +0 -75
- package/.agents/skills/remotion-best-practices/rules/charts.md +0 -120
- package/.agents/skills/remotion-best-practices/rules/compositions.md +0 -154
- package/.agents/skills/remotion-best-practices/rules/display-captions.md +0 -184
- package/.agents/skills/remotion-best-practices/rules/extract-frames.md +0 -229
- package/.agents/skills/remotion-best-practices/rules/ffmpeg.md +0 -38
- package/.agents/skills/remotion-best-practices/rules/fonts.md +0 -152
- package/.agents/skills/remotion-best-practices/rules/get-audio-duration.md +0 -58
- package/.agents/skills/remotion-best-practices/rules/get-video-dimensions.md +0 -68
- package/.agents/skills/remotion-best-practices/rules/get-video-duration.md +0 -60
- package/.agents/skills/remotion-best-practices/rules/gifs.md +0 -141
- package/.agents/skills/remotion-best-practices/rules/images.md +0 -134
- package/.agents/skills/remotion-best-practices/rules/import-srt-captions.md +0 -69
- package/.agents/skills/remotion-best-practices/rules/light-leaks.md +0 -73
- package/.agents/skills/remotion-best-practices/rules/lottie.md +0 -70
- package/.agents/skills/remotion-best-practices/rules/maps.md +0 -412
- package/.agents/skills/remotion-best-practices/rules/measuring-dom-nodes.md +0 -34
- package/.agents/skills/remotion-best-practices/rules/measuring-text.md +0 -140
- package/.agents/skills/remotion-best-practices/rules/parameters.md +0 -109
- package/.agents/skills/remotion-best-practices/rules/sequencing.md +0 -118
- package/.agents/skills/remotion-best-practices/rules/sfx.md +0 -26
- package/.agents/skills/remotion-best-practices/rules/subtitles.md +0 -36
- package/.agents/skills/remotion-best-practices/rules/tailwind.md +0 -11
- package/.agents/skills/remotion-best-practices/rules/text-animations.md +0 -20
- package/.agents/skills/remotion-best-practices/rules/timing.md +0 -179
- package/.agents/skills/remotion-best-practices/rules/transcribe-captions.md +0 -70
- package/.agents/skills/remotion-best-practices/rules/transitions.md +0 -197
- package/.agents/skills/remotion-best-practices/rules/transparent-videos.md +0 -106
- package/.agents/skills/remotion-best-practices/rules/trimming.md +0 -51
- package/.agents/skills/remotion-best-practices/rules/videos.md +0 -171
- package/.agents/skills/remotion-best-practices/rules/voiceover.md +0 -99
- package/.agents/skills/simple/SKILL.md +0 -52
- package/.agents/skills/vercel-react-best-practices/AGENTS.md +0 -3254
- package/.agents/skills/vercel-react-best-practices/README.md +0 -123
- package/.agents/skills/vercel-react-best-practices/SKILL.md +0 -141
- package/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
- package/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
- package/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
- package/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +0 -38
- package/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +0 -80
- package/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +0 -51
- package/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +0 -28
- package/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
- package/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -59
- package/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
- package/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
- package/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
- package/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +0 -50
- package/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
- package/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
- package/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
- package/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
- package/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
- package/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
- package/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +0 -50
- package/.agents/skills/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -60
- package/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
- package/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +0 -37
- package/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
- package/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
- package/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
- package/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
- package/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +0 -26
- package/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
- package/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
- package/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
- package/.agents/skills/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
- package/.agents/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
- package/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
- package/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
- package/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
- package/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
- package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
- package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
- package/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
- package/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
- package/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
- package/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +0 -44
- package/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
- package/.agents/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -82
- package/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
- package/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
- package/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
- package/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
- package/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
- package/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
- package/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +0 -76
- package/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
- package/.agents/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -142
- package/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
- package/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +0 -38
- package/.claude/CLAUDE.md +0 -184
- package/.claude/commands/review.md +0 -120
- package/.claude/commands/sync-docs.md +0 -71
- package/.claude/roadmap.md +0 -121
- package/.claude/rules/style-guide.md +0 -830
- package/.claude/settings.json +0 -18
- package/.claude/user-stories.md +0 -333
- package/AGENTS.md +0 -68
- package/Makefile +0 -32
- package/biome.json +0 -79
- package/bun.lock +0 -854
- package/bunfig.toml +0 -2
- package/docs/design.md +0 -563
- package/docs/perf-baseline.md +0 -130
- package/docs/plans/2026-03-13-client-mode-design.md +0 -86
- package/docs/plans/2026-03-13-client-mode-plan.md +0 -605
- package/docs/plans/2026-03-13-keyboard-shortcuts-design.md +0 -129
- package/docs/plans/2026-03-13-keyboard-shortcuts-plan.md +0 -1471
- package/docs/plans/2026-03-13-multi-document-design.md +0 -183
- package/docs/plans/2026-03-13-performance-benchmarks-design.md +0 -121
- package/docs/superpowers/plans/2026-03-26-surgical-pruning.md +0 -1176
- package/docs/superpowers/specs/2026-03-27-go-server-rewrite-design.md +0 -284
- package/e2e/comments.spec.ts +0 -81
- package/e2e/document-load.spec.ts +0 -32
- package/e2e/export.spec.ts +0 -58
- package/e2e/fixtures/sample.md +0 -7
- package/e2e/perf/add-comment.spec.ts +0 -116
- package/e2e/perf/fixtures/generate.ts +0 -327
- package/e2e/perf/initial-load.spec.ts +0 -49
- package/e2e/perf/perf.setup.ts +0 -23
- package/e2e/perf/perf.teardown.ts +0 -9
- package/e2e/perf/screenshot-final.png +0 -0
- package/e2e/perf/scroll.spec.ts +0 -39
- package/e2e/perf/tab-switch.spec.ts +0 -69
- package/e2e/perf/text-selection.spec.ts +0 -119
- package/e2e/perf/utils/metrics.ts +0 -350
- package/e2e/perf/utils/perf-cli.ts +0 -86
- package/e2e/persistence-file.spec.ts +0 -357
- package/e2e/utils/cli.ts +0 -84
- package/e2e/utils/selection.ts +0 -79
- package/go/cmd/readit/main.go +0 -416
- package/go/go.mod +0 -20
- package/go/go.sum +0 -41
- package/go/internal/server/anchor.go +0 -302
- package/go/internal/server/anchor_test.go +0 -111
- package/go/internal/server/comments.go +0 -390
- package/go/internal/server/documents.go +0 -113
- package/go/internal/server/embed.go +0 -17
- package/go/internal/server/headings.go +0 -33
- package/go/internal/server/headings_test.go +0 -75
- package/go/internal/server/htmltext.go +0 -123
- package/go/internal/server/markdown.go +0 -157
- package/go/internal/server/markdown_bench_test.go +0 -42
- package/go/internal/server/markdown_test.go +0 -79
- package/go/internal/server/server.go +0 -453
- package/go/internal/server/server_bench_test.go +0 -122
- package/go/internal/server/settings.go +0 -110
- package/go/internal/server/sse.go +0 -140
- package/go/internal/server/storage.go +0 -275
- package/go/internal/server/storage_test.go +0 -118
- package/go/internal/server/template.go +0 -66
- package/go/internal/server/types.go +0 -101
- package/go/internal/server/watcher.go +0 -74
- package/lefthook.yml +0 -8
- package/nvim-readit/lua/readit/health.lua +0 -64
- package/nvim-readit/lua/readit/init.lua +0 -463
- package/nvim-readit/plugin/readit.lua +0 -19
- package/playwright.config.ts +0 -34
- package/skills-lock.json +0 -20
- package/src/App.svelte +0 -881
- package/src/cli.ts +0 -881
- package/src/components/ActionsMenu.svelte +0 -95
- package/src/components/CommentBadge.svelte +0 -67
- package/src/components/CommentErrorBanner.svelte +0 -33
- package/src/components/CommentInput.svelte +0 -75
- package/src/components/CommentListItem.svelte +0 -95
- package/src/components/CommentManager.svelte +0 -129
- package/src/components/CommentNav.svelte +0 -109
- package/src/components/DocumentViewer.svelte +0 -218
- package/src/components/FloatingComment.svelte +0 -107
- package/src/components/Header.svelte +0 -76
- package/src/components/InlineEditor.svelte +0 -72
- package/src/components/MarginNote.svelte +0 -167
- package/src/components/MarginNotesContainer.svelte +0 -33
- package/src/components/RawModal.svelte +0 -126
- package/src/components/ReanchorConfirm.svelte +0 -30
- package/src/components/SettingsModal.svelte +0 -220
- package/src/components/ShortcutCapture.svelte +0 -82
- package/src/components/ShortcutList.svelte +0 -145
- package/src/components/TabBar.svelte +0 -52
- package/src/components/TableOfContents.svelte +0 -125
- package/src/components/ui/ActionLink.svelte +0 -40
- package/src/components/ui/Button.svelte +0 -53
- package/src/components/ui/Dialog.svelte +0 -97
- package/src/components/ui/DropdownMenu.svelte +0 -85
- package/src/components/ui/DropdownMenuItem.svelte +0 -38
- package/src/components/ui/DropdownMenuSeparator.svelte +0 -11
- package/src/components/ui/Text.svelte +0 -42
- package/src/env.d.ts +0 -6
- package/src/index.css +0 -754
- package/src/lib/__fixtures__/bench-data.ts +0 -114
- package/src/lib/anchor.bench.ts +0 -91
- package/src/lib/anchor.test.ts +0 -527
- package/src/lib/anchor.ts +0 -381
- package/src/lib/comment-storage.bench.ts +0 -49
- package/src/lib/comment-storage.test.ts +0 -632
- package/src/lib/comment-storage.ts +0 -222
- package/src/lib/export.bench.ts +0 -21
- package/src/lib/export.ts +0 -36
- package/src/lib/headings.test.ts +0 -103
- package/src/lib/headings.ts +0 -44
- package/src/lib/highlight/core.test.ts +0 -93
- package/src/lib/highlight/dom.ts +0 -187
- package/src/lib/highlight/highlight-registry.ts +0 -221
- package/src/lib/highlight/highlight.bench.ts +0 -92
- package/src/lib/highlight/highlighter.ts +0 -247
- package/src/lib/highlight/resolver.ts +0 -38
- package/src/lib/highlight/types.ts +0 -17
- package/src/lib/html-text.test.ts +0 -162
- package/src/lib/html-text.ts +0 -161
- package/src/lib/i18n/en.ts +0 -116
- package/src/lib/i18n/index.ts +0 -3
- package/src/lib/i18n/ja.ts +0 -118
- package/src/lib/i18n/translations.ts +0 -27
- package/src/lib/i18n/types.ts +0 -122
- package/src/lib/margin-layout.bench.ts +0 -61
- package/src/lib/margin-layout.ts +0 -71
- package/src/lib/markdown-renderer.test.ts +0 -154
- package/src/lib/markdown-renderer.ts +0 -177
- package/src/lib/mermaid-config.ts +0 -38
- package/src/lib/mermaid-renderer.ts +0 -162
- package/src/lib/mermaid-worker.ts +0 -60
- package/src/lib/positions.ts +0 -157
- package/src/lib/shortcut-registry.ts +0 -244
- package/src/lib/utils.ts +0 -15
- package/src/main.ts +0 -16
- package/src/schema.ts +0 -92
- package/src/server.ts +0 -1220
- package/src/stores/app.svelte.ts +0 -231
- package/src/stores/locale.svelte.ts +0 -46
- package/src/stores/settings.svelte.ts +0 -90
- package/src/stores/shortcuts.svelte.ts +0 -104
- package/src/stores/ui.svelte.ts +0 -12
- package/src/template.ts +0 -104
- package/src/test-setup.ts +0 -48
- package/svelte.config.js +0 -5
- package/test.md +0 -74
- package/tsconfig.cli.json +0 -12
- package/tsconfig.json +0 -20
- package/vite.config.ts +0 -47
- package/vitest.config.ts +0 -15
- package/vscode-readit/.mcp.json +0 -7
- package/vscode-readit/.vscodeignore +0 -7
- package/vscode-readit/bun.lock +0 -78
- package/vscode-readit/icon.svg +0 -10
- package/vscode-readit/package.json +0 -110
- package/vscode-readit/src/extension.ts +0 -117
- package/vscode-readit/src/server-manager.ts +0 -272
- package/vscode-readit/src/webview-provider.ts +0 -204
- package/vscode-readit/tsconfig.json +0 -20
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
package server
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"sync"
|
|
5
|
-
"time"
|
|
6
|
-
|
|
7
|
-
"github.com/fsnotify/fsnotify"
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
type Watcher struct {
|
|
11
|
-
fsWatcher *fsnotify.Watcher
|
|
12
|
-
debounce map[string]*time.Timer
|
|
13
|
-
onChange func(filePath string)
|
|
14
|
-
mu sync.Mutex
|
|
15
|
-
done chan struct{}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
func NewWatcher(onChange func(string)) (*Watcher, error) {
|
|
19
|
-
fsw, err := fsnotify.NewWatcher()
|
|
20
|
-
if err != nil {
|
|
21
|
-
return nil, err
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
w := &Watcher{
|
|
25
|
-
fsWatcher: fsw,
|
|
26
|
-
debounce: make(map[string]*time.Timer),
|
|
27
|
-
onChange: onChange,
|
|
28
|
-
done: make(chan struct{}),
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
go w.loop()
|
|
32
|
-
return w, nil
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
func (w *Watcher) loop() {
|
|
36
|
-
for {
|
|
37
|
-
select {
|
|
38
|
-
case event, ok := <-w.fsWatcher.Events:
|
|
39
|
-
if !ok {
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
if event.Has(fsnotify.Write) || event.Has(fsnotify.Create) {
|
|
43
|
-
w.debounceChange(event.Name)
|
|
44
|
-
}
|
|
45
|
-
case _, ok := <-w.fsWatcher.Errors:
|
|
46
|
-
if !ok {
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
case <-w.done:
|
|
50
|
-
return
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
func (w *Watcher) debounceChange(path string) {
|
|
56
|
-
w.mu.Lock()
|
|
57
|
-
defer w.mu.Unlock()
|
|
58
|
-
|
|
59
|
-
if t, ok := w.debounce[path]; ok {
|
|
60
|
-
t.Stop()
|
|
61
|
-
}
|
|
62
|
-
w.debounce[path] = time.AfterFunc(100*time.Millisecond, func() {
|
|
63
|
-
w.onChange(path)
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
func (w *Watcher) Add(path string) error {
|
|
68
|
-
return w.fsWatcher.Add(path)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
func (w *Watcher) Close() {
|
|
72
|
-
close(w.done)
|
|
73
|
-
_ = w.fsWatcher.Close()
|
|
74
|
-
}
|
package/lefthook.yml
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
-- Health check for readit.nvim
|
|
2
|
-
-- Run with :checkhealth readit
|
|
3
|
-
|
|
4
|
-
local M = {}
|
|
5
|
-
|
|
6
|
-
function M.check()
|
|
7
|
-
vim.health.start("readit.nvim")
|
|
8
|
-
|
|
9
|
-
-- Check bun
|
|
10
|
-
local readit = require("readit")
|
|
11
|
-
local bun_path = readit.config.bun_path or "bun"
|
|
12
|
-
local bun_exec = vim.fn.exepath(bun_path)
|
|
13
|
-
|
|
14
|
-
if bun_exec ~= "" then
|
|
15
|
-
local version = vim.fn.system(bun_path .. " --version")
|
|
16
|
-
vim.health.ok("bun found: " .. vim.trim(version) .. " (" .. bun_exec .. ")")
|
|
17
|
-
else
|
|
18
|
-
vim.health.error(
|
|
19
|
-
"bun not found",
|
|
20
|
-
{ "Install Bun: https://bun.sh", "Or set bun_path in setup()" }
|
|
21
|
-
)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
-- Check readit CLI
|
|
25
|
-
local readit_exec = vim.fn.exepath("readit")
|
|
26
|
-
if readit_exec ~= "" then
|
|
27
|
-
vim.health.ok("readit CLI found: " .. readit_exec)
|
|
28
|
-
else
|
|
29
|
-
local dist = vim.fn.expand("~/.readit/dist/index.js")
|
|
30
|
-
if vim.fn.filereadable(dist) == 1 then
|
|
31
|
-
vim.health.ok("readit dist found: " .. dist)
|
|
32
|
-
else
|
|
33
|
-
vim.health.warn(
|
|
34
|
-
"readit CLI not in PATH",
|
|
35
|
-
{ "Install: npm install -g @peaske7/readit", "Or: bun add -g @peaske7/readit" }
|
|
36
|
-
)
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
-- Check curl (needed for server communication)
|
|
41
|
-
if vim.fn.exepath("curl") ~= "" then
|
|
42
|
-
vim.health.ok("curl found")
|
|
43
|
-
else
|
|
44
|
-
vim.health.error("curl not found (required for server API calls)")
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
-- Check server status
|
|
48
|
-
if readit._server_port then
|
|
49
|
-
vim.health.ok("Server running on port " .. readit._server_port)
|
|
50
|
-
else
|
|
51
|
-
vim.health.info("Server not running (will start on :ReaditOpen)")
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
-- Check for comments directory
|
|
55
|
-
local comments_dir = vim.fn.expand("~/.readit/comments")
|
|
56
|
-
if vim.fn.isdirectory(comments_dir) == 1 then
|
|
57
|
-
local count = #vim.fn.glob(comments_dir .. "/**/*.comments.md", false, true)
|
|
58
|
-
vim.health.ok("Comments directory exists (" .. count .. " comment files)")
|
|
59
|
-
else
|
|
60
|
-
vim.health.info("No comments directory yet (~/.readit/comments/)")
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
return M
|
|
@@ -1,463 +0,0 @@
|
|
|
1
|
-
-- readit.nvim — Neovim plugin for rendering Markdown with readit
|
|
2
|
-
--
|
|
3
|
-
-- Manages a readit server process and opens documents in the browser
|
|
4
|
-
-- or a split terminal. Supports live-reload: edits in Neovim are
|
|
5
|
-
-- reflected in the browser automatically (via readit's file watcher).
|
|
6
|
-
|
|
7
|
-
local M = {}
|
|
8
|
-
|
|
9
|
-
--- @class ReaditConfig
|
|
10
|
-
--- @field bun_path string Path to bun executable
|
|
11
|
-
--- @field port number Preferred server port (0 = auto)
|
|
12
|
-
--- @field host string Server host
|
|
13
|
-
--- @field auto_open boolean Open browser automatically
|
|
14
|
-
--- @field auto_reload boolean Auto-reload on BufWritePost (enabled by default via readit's fs watcher)
|
|
15
|
-
--- @field open_cmd string|nil Custom browser open command
|
|
16
|
-
--- @field keymap_prefix string Key prefix for mappings
|
|
17
|
-
--- @field keymaps table<string, string|false> Keymap overrides (false to disable)
|
|
18
|
-
--- @field float_opts table Floating window options for terminal
|
|
19
|
-
|
|
20
|
-
--- @type ReaditConfig
|
|
21
|
-
M.config = {
|
|
22
|
-
bun_path = "bun",
|
|
23
|
-
port = 0,
|
|
24
|
-
host = "127.0.0.1",
|
|
25
|
-
auto_open = true,
|
|
26
|
-
auto_reload = true,
|
|
27
|
-
open_cmd = nil,
|
|
28
|
-
keymap_prefix = "<leader>r",
|
|
29
|
-
keymaps = {
|
|
30
|
-
open = "o", -- Open current file in readit
|
|
31
|
-
open_side = "s", -- Open in side browser (if available)
|
|
32
|
-
stop = "q", -- Stop the server
|
|
33
|
-
status = "i", -- Show server status
|
|
34
|
-
reload = "r", -- Force reload in browser
|
|
35
|
-
list = "l", -- List commented files
|
|
36
|
-
},
|
|
37
|
-
float_opts = {
|
|
38
|
-
relative = "editor",
|
|
39
|
-
width = 0.8,
|
|
40
|
-
height = 0.8,
|
|
41
|
-
border = "rounded",
|
|
42
|
-
},
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
--- @type number|nil
|
|
46
|
-
M._server_port = nil
|
|
47
|
-
--- @type number|nil
|
|
48
|
-
M._server_job_id = nil
|
|
49
|
-
--- @type table<string, boolean>
|
|
50
|
-
M._attached_files = {}
|
|
51
|
-
|
|
52
|
-
-- ── Setup ────────────────────────────────────────────────────────────
|
|
53
|
-
|
|
54
|
-
--- Setup the plugin with user configuration
|
|
55
|
-
--- @param opts? ReaditConfig
|
|
56
|
-
--- @type boolean
|
|
57
|
-
M._setup_done = false
|
|
58
|
-
|
|
59
|
-
function M.setup(opts)
|
|
60
|
-
M.config = vim.tbl_deep_extend("force", M.config, opts or {})
|
|
61
|
-
M._setup_commands()
|
|
62
|
-
M._setup_keymaps()
|
|
63
|
-
M._setup_autocmds()
|
|
64
|
-
M._setup_done = true
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
-- ── Server Management ────────────────────────────────────────────────
|
|
68
|
-
|
|
69
|
-
--- Discover an already-running readit server from ~/.readit/server.json
|
|
70
|
-
--- @return {port: number, pid: number}|nil
|
|
71
|
-
function M._discover_server()
|
|
72
|
-
local path = vim.fn.expand("~/.readit/server.json")
|
|
73
|
-
local ok, content = pcall(vim.fn.readfile, path)
|
|
74
|
-
if not ok or #content == 0 then
|
|
75
|
-
return nil
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
local decoded = vim.json.decode(table.concat(content, "\n"))
|
|
79
|
-
if not decoded or not decoded.port or not decoded.pid then
|
|
80
|
-
return nil
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
-- Check if the process is alive
|
|
84
|
-
local alive = vim.fn.system("kill -0 " .. decoded.pid .. " 2>/dev/null; echo $?")
|
|
85
|
-
if vim.trim(alive) ~= "0" then
|
|
86
|
-
return nil
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
-- Health check
|
|
90
|
-
local health = vim.fn.system(
|
|
91
|
-
"curl -sf http://127.0.0.1:" .. decoded.port .. "/api/health 2>/dev/null"
|
|
92
|
-
)
|
|
93
|
-
if health == "" or vim.v.shell_error ~= 0 then
|
|
94
|
-
return nil
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
return decoded
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
--- Start the readit server for a given file
|
|
101
|
-
--- @param file_path string Absolute path to the markdown file
|
|
102
|
-
--- @param callback? fun(port: number) Called when server is ready
|
|
103
|
-
function M.start_server(file_path, callback)
|
|
104
|
-
-- Check for existing server first
|
|
105
|
-
local existing = M._discover_server()
|
|
106
|
-
if existing then
|
|
107
|
-
M._server_port = existing.port
|
|
108
|
-
M._attach_file(file_path, callback)
|
|
109
|
-
return
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
-- If we already have a running job, attach to it
|
|
113
|
-
if M._server_job_id and vim.fn.jobwait({ M._server_job_id }, 0)[1] == -1 then
|
|
114
|
-
if M._server_port then
|
|
115
|
-
M._attach_file(file_path, callback)
|
|
116
|
-
return
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
local port = M.config.port
|
|
121
|
-
local args = {
|
|
122
|
-
M.config.bun_path,
|
|
123
|
-
"run",
|
|
124
|
-
"--bun",
|
|
125
|
-
vim.fn.expand("~/.readit/dist/index.js"), -- Try installed version first
|
|
126
|
-
file_path,
|
|
127
|
-
"--no-open",
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
-- Check if the global dist exists; otherwise try npx
|
|
131
|
-
if vim.fn.filereadable(vim.fn.expand("~/.readit/dist/index.js")) == 0 then
|
|
132
|
-
-- Try to find readit in the project or globally
|
|
133
|
-
local readit_bin = vim.fn.exepath("readit")
|
|
134
|
-
if readit_bin ~= "" then
|
|
135
|
-
args = { readit_bin, file_path, "--no-open" }
|
|
136
|
-
else
|
|
137
|
-
-- Fall back to bunx
|
|
138
|
-
args = { M.config.bun_path .. "x", "@peaske7/readit", file_path, "--no-open" }
|
|
139
|
-
end
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
if port > 0 then
|
|
143
|
-
table.insert(args, "--port")
|
|
144
|
-
table.insert(args, tostring(port))
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
vim.notify("readit: starting server...", vim.log.levels.INFO)
|
|
148
|
-
|
|
149
|
-
M._server_job_id = vim.fn.jobstart(args, {
|
|
150
|
-
on_stdout = function(_, data)
|
|
151
|
-
for _, line in ipairs(data) do
|
|
152
|
-
-- Parse the URL from server output
|
|
153
|
-
local found_port = line:match("URL:%s*http://[^:]+:(%d+)")
|
|
154
|
-
if found_port then
|
|
155
|
-
M._server_port = tonumber(found_port)
|
|
156
|
-
M._attached_files[file_path] = true
|
|
157
|
-
vim.notify("readit: server ready on port " .. M._server_port, vim.log.levels.INFO)
|
|
158
|
-
if callback then
|
|
159
|
-
vim.schedule(function()
|
|
160
|
-
callback(M._server_port)
|
|
161
|
-
end)
|
|
162
|
-
end
|
|
163
|
-
end
|
|
164
|
-
end
|
|
165
|
-
end,
|
|
166
|
-
on_stderr = function(_, data)
|
|
167
|
-
for _, line in ipairs(data) do
|
|
168
|
-
if line ~= "" then
|
|
169
|
-
vim.notify("readit: " .. line, vim.log.levels.WARN)
|
|
170
|
-
end
|
|
171
|
-
end
|
|
172
|
-
end,
|
|
173
|
-
on_exit = function(_, code)
|
|
174
|
-
M._server_job_id = nil
|
|
175
|
-
M._server_port = nil
|
|
176
|
-
M._attached_files = {}
|
|
177
|
-
if code ~= 0 then
|
|
178
|
-
vim.notify("readit: server exited with code " .. code, vim.log.levels.ERROR)
|
|
179
|
-
end
|
|
180
|
-
end,
|
|
181
|
-
detach = false,
|
|
182
|
-
})
|
|
183
|
-
|
|
184
|
-
if M._server_job_id <= 0 then
|
|
185
|
-
vim.notify("readit: failed to start server", vim.log.levels.ERROR)
|
|
186
|
-
M._server_job_id = nil
|
|
187
|
-
end
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
--- Attach a file to the running server via HTTP API
|
|
191
|
-
--- @param file_path string
|
|
192
|
-
--- @param callback? fun(port: number)
|
|
193
|
-
function M._attach_file(file_path, callback)
|
|
194
|
-
if M._attached_files[file_path] then
|
|
195
|
-
if callback and M._server_port then
|
|
196
|
-
callback(M._server_port)
|
|
197
|
-
end
|
|
198
|
-
return
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
if not M._server_port then
|
|
202
|
-
vim.notify("readit: no server running", vim.log.levels.WARN)
|
|
203
|
-
return
|
|
204
|
-
end
|
|
205
|
-
|
|
206
|
-
local cmd = string.format(
|
|
207
|
-
'curl -sf -X POST -H "Content-Type: application/json" -d \'{"path":"%s"}\' http://127.0.0.1:%d/api/documents 2>/dev/null',
|
|
208
|
-
file_path:gsub("'", "'\\''"),
|
|
209
|
-
M._server_port
|
|
210
|
-
)
|
|
211
|
-
|
|
212
|
-
vim.fn.jobstart({ "sh", "-c", cmd }, {
|
|
213
|
-
on_exit = function(_, code)
|
|
214
|
-
if code == 0 then
|
|
215
|
-
M._attached_files[file_path] = true
|
|
216
|
-
vim.schedule(function()
|
|
217
|
-
if callback and M._server_port then
|
|
218
|
-
callback(M._server_port)
|
|
219
|
-
end
|
|
220
|
-
end)
|
|
221
|
-
else
|
|
222
|
-
vim.schedule(function()
|
|
223
|
-
vim.notify("readit: failed to attach file", vim.log.levels.ERROR)
|
|
224
|
-
end)
|
|
225
|
-
end
|
|
226
|
-
end,
|
|
227
|
-
})
|
|
228
|
-
end
|
|
229
|
-
|
|
230
|
-
--- Stop the readit server
|
|
231
|
-
function M.stop_server()
|
|
232
|
-
if M._server_job_id then
|
|
233
|
-
vim.fn.jobstop(M._server_job_id)
|
|
234
|
-
M._server_job_id = nil
|
|
235
|
-
M._server_port = nil
|
|
236
|
-
M._attached_files = {}
|
|
237
|
-
vim.notify("readit: server stopped", vim.log.levels.INFO)
|
|
238
|
-
else
|
|
239
|
-
vim.notify("readit: no server running", vim.log.levels.INFO)
|
|
240
|
-
end
|
|
241
|
-
end
|
|
242
|
-
|
|
243
|
-
--- Get server status info
|
|
244
|
-
--- @return string
|
|
245
|
-
function M.server_status()
|
|
246
|
-
if M._server_port then
|
|
247
|
-
local files = vim.tbl_keys(M._attached_files)
|
|
248
|
-
return string.format(
|
|
249
|
-
"readit server running on port %d (%d file%s)",
|
|
250
|
-
M._server_port,
|
|
251
|
-
#files,
|
|
252
|
-
#files == 1 and "" or "s"
|
|
253
|
-
)
|
|
254
|
-
end
|
|
255
|
-
return "readit server not running"
|
|
256
|
-
end
|
|
257
|
-
|
|
258
|
-
-- ── Actions ──────────────────────────────────────────────────────────
|
|
259
|
-
|
|
260
|
-
--- Open the current markdown buffer in readit
|
|
261
|
-
--- @param opts? {browser?: boolean}
|
|
262
|
-
function M.open(opts)
|
|
263
|
-
opts = opts or { browser = true }
|
|
264
|
-
local bufname = vim.api.nvim_buf_get_name(0)
|
|
265
|
-
|
|
266
|
-
if bufname == "" then
|
|
267
|
-
vim.notify("readit: buffer has no file", vim.log.levels.WARN)
|
|
268
|
-
return
|
|
269
|
-
end
|
|
270
|
-
|
|
271
|
-
if not bufname:match("%.md$") and not bufname:match("%.markdown$") then
|
|
272
|
-
vim.notify("readit: not a markdown file", vim.log.levels.WARN)
|
|
273
|
-
return
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
-- Save the buffer first to ensure file watcher picks up latest
|
|
277
|
-
if vim.bo.modified then
|
|
278
|
-
vim.cmd("write")
|
|
279
|
-
end
|
|
280
|
-
|
|
281
|
-
local file_path = vim.fn.fnamemodify(bufname, ":p")
|
|
282
|
-
|
|
283
|
-
M.start_server(file_path, function(port)
|
|
284
|
-
if opts.browser and M.config.auto_open then
|
|
285
|
-
M._open_browser(port)
|
|
286
|
-
end
|
|
287
|
-
end)
|
|
288
|
-
end
|
|
289
|
-
|
|
290
|
-
--- Open the browser to the readit server
|
|
291
|
-
--- @param port number
|
|
292
|
-
function M._open_browser(port)
|
|
293
|
-
local url = "http://" .. M.config.host .. ":" .. port
|
|
294
|
-
|
|
295
|
-
if M.config.open_cmd then
|
|
296
|
-
vim.fn.system(M.config.open_cmd .. " " .. vim.fn.shellescape(url))
|
|
297
|
-
return
|
|
298
|
-
end
|
|
299
|
-
|
|
300
|
-
-- Platform-specific open
|
|
301
|
-
local open_cmd
|
|
302
|
-
if vim.fn.has("mac") == 1 then
|
|
303
|
-
open_cmd = "open"
|
|
304
|
-
elseif vim.fn.has("unix") == 1 then
|
|
305
|
-
open_cmd = "xdg-open"
|
|
306
|
-
elseif vim.fn.has("win32") == 1 then
|
|
307
|
-
open_cmd = "start"
|
|
308
|
-
end
|
|
309
|
-
|
|
310
|
-
if open_cmd then
|
|
311
|
-
vim.fn.jobstart({ open_cmd, url }, { detach = true })
|
|
312
|
-
end
|
|
313
|
-
end
|
|
314
|
-
|
|
315
|
-
--- Force reload the current document in the browser
|
|
316
|
-
function M.reload()
|
|
317
|
-
if not M._server_port then
|
|
318
|
-
vim.notify("readit: no server running", vim.log.levels.WARN)
|
|
319
|
-
return
|
|
320
|
-
end
|
|
321
|
-
|
|
322
|
-
-- Save first so the file watcher triggers reload
|
|
323
|
-
if vim.bo.modified then
|
|
324
|
-
vim.cmd("write")
|
|
325
|
-
end
|
|
326
|
-
|
|
327
|
-
vim.notify("readit: document will reload via file watcher", vim.log.levels.INFO)
|
|
328
|
-
end
|
|
329
|
-
|
|
330
|
-
--- List files with comments (in a floating window)
|
|
331
|
-
function M.list_comments()
|
|
332
|
-
local comments_dir = vim.fn.expand("~/.readit/comments")
|
|
333
|
-
if vim.fn.isdirectory(comments_dir) == 0 then
|
|
334
|
-
vim.notify("readit: no comments found", vim.log.levels.INFO)
|
|
335
|
-
return
|
|
336
|
-
end
|
|
337
|
-
|
|
338
|
-
local cmd = string.format(
|
|
339
|
-
"grep -rh '^source:' %s 2>/dev/null | sed 's/^source: *//' | sort -u",
|
|
340
|
-
vim.fn.shellescape(comments_dir)
|
|
341
|
-
)
|
|
342
|
-
local result = vim.fn.system(cmd)
|
|
343
|
-
local files = vim.split(vim.trim(result), "\n", { trimempty = true })
|
|
344
|
-
|
|
345
|
-
if #files == 0 then
|
|
346
|
-
vim.notify("readit: no comments found", vim.log.levels.INFO)
|
|
347
|
-
return
|
|
348
|
-
end
|
|
349
|
-
|
|
350
|
-
vim.ui.select(files, {
|
|
351
|
-
prompt = "readit: files with comments",
|
|
352
|
-
format_item = function(item)
|
|
353
|
-
return vim.fn.fnamemodify(item, ":~:.")
|
|
354
|
-
end,
|
|
355
|
-
}, function(choice)
|
|
356
|
-
if choice then
|
|
357
|
-
vim.cmd("edit " .. vim.fn.fnameescape(choice))
|
|
358
|
-
M.open()
|
|
359
|
-
end
|
|
360
|
-
end)
|
|
361
|
-
end
|
|
362
|
-
|
|
363
|
-
-- ── Commands ─────────────────────────────────────────────────────────
|
|
364
|
-
|
|
365
|
-
function M._setup_commands()
|
|
366
|
-
vim.api.nvim_create_user_command("ReaditOpen", function()
|
|
367
|
-
M.open()
|
|
368
|
-
end, { desc = "Open current markdown file in readit" })
|
|
369
|
-
|
|
370
|
-
vim.api.nvim_create_user_command("ReaditStop", function()
|
|
371
|
-
M.stop_server()
|
|
372
|
-
end, { desc = "Stop the readit server" })
|
|
373
|
-
|
|
374
|
-
vim.api.nvim_create_user_command("ReaditStatus", function()
|
|
375
|
-
vim.notify(M.server_status(), vim.log.levels.INFO)
|
|
376
|
-
end, { desc = "Show readit server status" })
|
|
377
|
-
|
|
378
|
-
vim.api.nvim_create_user_command("ReaditReload", function()
|
|
379
|
-
M.reload()
|
|
380
|
-
end, { desc = "Reload current document in readit" })
|
|
381
|
-
|
|
382
|
-
vim.api.nvim_create_user_command("ReaditList", function()
|
|
383
|
-
M.list_comments()
|
|
384
|
-
end, { desc = "List files with readit comments" })
|
|
385
|
-
|
|
386
|
-
vim.api.nvim_create_user_command("ReaditOpenFile", function(cmd_opts)
|
|
387
|
-
local file = cmd_opts.args
|
|
388
|
-
if file == "" then
|
|
389
|
-
vim.notify("readit: specify a file path", vim.log.levels.WARN)
|
|
390
|
-
return
|
|
391
|
-
end
|
|
392
|
-
local abs = vim.fn.fnamemodify(file, ":p")
|
|
393
|
-
M.start_server(abs, function(port)
|
|
394
|
-
if M.config.auto_open then
|
|
395
|
-
M._open_browser(port)
|
|
396
|
-
end
|
|
397
|
-
end)
|
|
398
|
-
end, {
|
|
399
|
-
nargs = 1,
|
|
400
|
-
complete = function(_, cmd_line, _)
|
|
401
|
-
-- Complete markdown files
|
|
402
|
-
local files = vim.fn.glob("**/*.md", false, true)
|
|
403
|
-
local markdown_files = vim.fn.glob("**/*.markdown", false, true)
|
|
404
|
-
vim.list_extend(files, markdown_files)
|
|
405
|
-
return files
|
|
406
|
-
end,
|
|
407
|
-
desc = "Open a specific file in readit",
|
|
408
|
-
})
|
|
409
|
-
end
|
|
410
|
-
|
|
411
|
-
-- ── Keymaps ──────────────────────────────────────────────────────────
|
|
412
|
-
|
|
413
|
-
function M._setup_keymaps()
|
|
414
|
-
local prefix = M.config.keymap_prefix
|
|
415
|
-
local maps = M.config.keymaps
|
|
416
|
-
|
|
417
|
-
local function map(suffix, action, desc)
|
|
418
|
-
if suffix == false then
|
|
419
|
-
return
|
|
420
|
-
end
|
|
421
|
-
vim.keymap.set("n", prefix .. suffix, action, {
|
|
422
|
-
desc = "readit: " .. desc,
|
|
423
|
-
silent = true,
|
|
424
|
-
})
|
|
425
|
-
end
|
|
426
|
-
|
|
427
|
-
if maps.open then
|
|
428
|
-
map(maps.open, function() M.open() end, "Open in readit")
|
|
429
|
-
end
|
|
430
|
-
if maps.open_side then
|
|
431
|
-
map(maps.open_side, function() M.open({ browser = true }) end, "Open in browser")
|
|
432
|
-
end
|
|
433
|
-
if maps.stop then
|
|
434
|
-
map(maps.stop, function() M.stop_server() end, "Stop server")
|
|
435
|
-
end
|
|
436
|
-
if maps.status then
|
|
437
|
-
map(maps.status, function() vim.notify(M.server_status()) end, "Server status")
|
|
438
|
-
end
|
|
439
|
-
if maps.reload then
|
|
440
|
-
map(maps.reload, function() M.reload() end, "Reload document")
|
|
441
|
-
end
|
|
442
|
-
if maps.list then
|
|
443
|
-
map(maps.list, function() M.list_comments() end, "List commented files")
|
|
444
|
-
end
|
|
445
|
-
end
|
|
446
|
-
|
|
447
|
-
-- ── Autocommands ─────────────────────────────────────────────────────
|
|
448
|
-
|
|
449
|
-
function M._setup_autocmds()
|
|
450
|
-
local group = vim.api.nvim_create_augroup("readit", { clear = true })
|
|
451
|
-
|
|
452
|
-
-- Clean up server on Neovim exit
|
|
453
|
-
vim.api.nvim_create_autocmd("VimLeavePre", {
|
|
454
|
-
group = group,
|
|
455
|
-
callback = function()
|
|
456
|
-
if M._server_job_id then
|
|
457
|
-
vim.fn.jobstop(M._server_job_id)
|
|
458
|
-
end
|
|
459
|
-
end,
|
|
460
|
-
})
|
|
461
|
-
end
|
|
462
|
-
|
|
463
|
-
return M
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
-- readit.nvim plugin loader
|
|
2
|
-
-- Auto-loaded by Neovim's plugin system
|
|
3
|
-
|
|
4
|
-
if vim.g.loaded_readit then
|
|
5
|
-
return
|
|
6
|
-
end
|
|
7
|
-
vim.g.loaded_readit = true
|
|
8
|
-
|
|
9
|
-
-- The plugin is configured via require("readit").setup({...}).
|
|
10
|
-
-- If the user hasn't called setup() (e.g. lazy.nvim with `ft`-trigger
|
|
11
|
-
-- and no `config`), bootstrap with defaults on the next event-loop
|
|
12
|
-
-- tick so any explicit setup({...}) in user config wins, but commands
|
|
13
|
-
-- and keymaps still register out of the box.
|
|
14
|
-
vim.schedule(function()
|
|
15
|
-
local ok, readit = pcall(require, "readit")
|
|
16
|
-
if ok and not readit._setup_done then
|
|
17
|
-
readit.setup()
|
|
18
|
-
end
|
|
19
|
-
end)
|
package/playwright.config.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { defineConfig, devices } from "@playwright/test";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
testDir: "./e2e",
|
|
5
|
-
fullyParallel: false, // Run sequentially to avoid port conflicts
|
|
6
|
-
forbidOnly: !!process.env.CI,
|
|
7
|
-
retries: process.env.CI ? 1 : 0,
|
|
8
|
-
workers: 1, // Single worker to avoid port conflicts
|
|
9
|
-
reporter: "html",
|
|
10
|
-
timeout: 30_000,
|
|
11
|
-
|
|
12
|
-
use: {
|
|
13
|
-
trace: "on-first-retry",
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
globalSetup: process.env.PERF_SETUP ? "./e2e/perf/perf.setup.ts" : undefined,
|
|
17
|
-
globalTeardown: process.env.PERF_SETUP
|
|
18
|
-
? "./e2e/perf/perf.teardown.ts"
|
|
19
|
-
: undefined,
|
|
20
|
-
|
|
21
|
-
projects: [
|
|
22
|
-
{
|
|
23
|
-
name: "chromium",
|
|
24
|
-
testIgnore: "**/perf/**",
|
|
25
|
-
use: { ...devices["Desktop Chrome"] },
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: "perf",
|
|
29
|
-
testDir: "./e2e/perf",
|
|
30
|
-
timeout: 120_000,
|
|
31
|
-
use: { ...devices["Desktop Chrome"] },
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
});
|
package/skills-lock.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"skills": {
|
|
4
|
-
"remotion-best-practices": {
|
|
5
|
-
"source": "remotion-dev/skills",
|
|
6
|
-
"sourceType": "github",
|
|
7
|
-
"computedHash": "9851afb52e1b892c43b2af973bda1776ce01fedfdfe704e0cfd70069a3a9c300"
|
|
8
|
-
},
|
|
9
|
-
"simple": {
|
|
10
|
-
"source": "roin-orca/skills",
|
|
11
|
-
"sourceType": "github",
|
|
12
|
-
"computedHash": "cfde9dde00c9b1f8934e0312440a5ae2ed76dbd81e49ba7433e0e63ea6551d13"
|
|
13
|
-
},
|
|
14
|
-
"vercel-react-best-practices": {
|
|
15
|
-
"source": "vercel-labs/agent-skills",
|
|
16
|
-
"sourceType": "github",
|
|
17
|
-
"computedHash": "afeca00ac2f492d88fdd010e73d91719a5b57c564bb4a73325b0bd77e11323ab"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|