Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
10000 commits
Select commit Hold shift + click to select a range
be34b79
feat: add "Always on Top" in window menu.
kidylee Sep 28, 2025
7c4111b
Added prettify-url? option to QuickCapture (#12409)
ivan-danilov May 11, 2026
8d44889
fix(e2e): stabilize basic suite (#12616)
tiensonqin May 12, 2026
3ae4d92
fix: invalid data from old graphs
tiensonqin May 12, 2026
e63bc56
Merge pull request #12470
Grandroot May 12, 2026
7cb9144
enhance(editor): support dollar autopair for markdown math (#12618)
megayu May 12, 2026
4c98cc6
fix: clear stale title when converting code block
megayu May 12, 2026
7194e54
fix(ux): incorrect reaction for the order list sibling blocks (#12617)
xyhp915 May 12, 2026
9c77efd
[codex] fix import of auto heading pre-blocks (#12612)
tiensonqin May 12, 2026
562e56e
fix: delete recycled node cleanup
tiensonqin May 12, 2026
96bf1f0
fix: align dark right sidebar header
tiensonqin May 12, 2026
1c061cc
fix: align heading bullets
tiensonqin May 12, 2026
1b9a199
fix: block selection while scrolling
tiensonqin May 12, 2026
250993c
ci: run cli tests in parallel
tiensonqin May 12, 2026
c9acb4d
fix(ci): cli e2e cache key
tiensonqin May 12, 2026
0096415
dev: run lint-and-test in parallel
tiensonqin May 12, 2026
c8d00f5
fix: dedupe node property choices
tiensonqin May 13, 2026
5809830
fix: stop cmdk sidebar shortcut propagation
tiensonqin May 13, 2026
e097ec8
fix(fsrs): cloze macro with superscript/subscript markup and render i…
megayu May 13, 2026
b2fc00b
fix: handle sidebar asset drops
tiensonqin May 13, 2026
cf24914
fix: dedupe raw node choices
tiensonqin May 13, 2026
d12beff
feat(graph-view): add task zoom-in view
RCmerci May 13, 2026
51c9c29
fix lint
RCmerci May 13, 2026
3f5b52c
feat(cli): unify backup impl for desktop and cli
RCmerci May 13, 2026
bf23ee5
enhance(skill): update logseq-review-workflow
RCmerci May 13, 2026
8a5aab6
enhance(skill): update logseq-review-workflow
RCmerci May 13, 2026
14b85b9
enhance(skill): add logseq-task-on-lambda
RCmerci May 13, 2026
9318205
fix: improve graph view interactions
tiensonqin May 13, 2026
89b11ff
dev: instaparse clj-kondo config
RCmerci May 13, 2026
0d16548
Update logseq task-on-lambda fetch workflow
RCmerci May 13, 2026
d1f764a
enhance: update lambda task skill workflow
tiensonqin May 13, 2026
1d7f416
enhance: record lambda task PR url
tiensonqin May 13, 2026
3dabc2d
enhance: refine lambda task status workflow
tiensonqin May 13, 2026
008d115
enhance: mention linked issue in task PR commits
tiensonqin May 13, 2026
64b78b6
fix: resolve uuid refs in breadcrumb labels (#12636)
megayu May 14, 2026
200a6da
deprecated block-ref (#12627)
megayu May 14, 2026
7838bec
fix: preserve code block language
tiensonqin May 13, 2026
8d83c79
[codex] hide class hierarchy (#12640)
tiensonqin May 14, 2026
03adb8c
fix: hide tag aliases from tag completion
tiensonqin May 13, 2026
4fe42af
fix: preserve markdown tag link aliases
tiensonqin May 12, 2026
3778978
fix: preserve block refs when merging hashtag link refs
RCmerci May 13, 2026
e97cc49
Potential fix for pull request finding
tiensonqin May 14, 2026
5638050
fix: record reproducible task choices
tiensonqin May 14, 2026
127356d
fix: keep published task bullets clear of status icons
tiensonqin May 14, 2026
1bfc6a7
Potential fix for pull request finding
tiensonqin May 14, 2026
c84e7de
fix: preserve spaces between refs in headings
megayu May 14, 2026
a209392
fix: preserve resized network image width
megayu May 14, 2026
f6e2ab9
fix(publish): set dir auto for mixed rtl/ltr content
yshalsager Apr 29, 2026
2169a86
fix: honor documented repeater cookie semantics (#12523)
crd May 14, 2026
e286370
Fix Windows file URL opening for block links (#12646)
megayu May 14, 2026
c37386e
fix: firefox paste
VictorVow Mar 16, 2026
1d16c9b
fix(dev): db-worker-node build don't copy publicdir
RCmerci May 14, 2026
4e6b9a2
fix: block property values deletion
RCmerci May 14, 2026
fc51c77
fix: prevent partial property value writes
RCmerci May 14, 2026
55123a6
enhance(skill): add logseq-answer-machine
RCmerci May 14, 2026
ce61af1
feat: add :asset property type with thumbnail picker (#12506)
VictorVow May 14, 2026
4914119
fix: speed scoped node property values (#12651)
tiensonqin May 14, 2026
5afaf32
fix: reparent closed values on conversion
RCmerci May 14, 2026
2de6597
fix: hide tag alias conversion action
tiensonqin May 14, 2026
a034f80
fix(regression): property config
tiensonqin May 14, 2026
35e3351
Coerce CLI content options to string
RCmerci May 14, 2026
ebb2278
Merge pull request #12650 from logseq/fix/residual-property-value
RCmerci May 14, 2026
5d229c2
Merge pull request #12653 from logseq/codex/cli-content-option-parse-…
RCmerci May 14, 2026
aef715a
fix(regression): icon/bullet alignment
tiensonqin May 14, 2026
c10a3b0
fix: preserve breadcrumb icon layout
tiensonqin May 14, 2026
e1c5025
fix: trim query invalid-query message
RCmerci May 14, 2026
2a0bf68
fix(cli): reject db-id datom clauses
RCmerci May 14, 2026
0a89a9e
Merge pull request #12654 from logseq/codex/cli-query-runtime-lint
RCmerci May 14, 2026
9396483
add download debug log
tiensonqin May 15, 2026
af5683f
fix: drop stale large title objects
tiensonqin May 15, 2026
1a8e06f
chore: remove debug log
tiensonqin May 15, 2026
ee9a667
fix(header): update breadcrumb label class for styling
megayu May 15, 2026
35aaaba
Fix left sidebar favorite ellipsis overlap
RCmerci May 15, 2026
18c69fe
fix: handle desktop sqlite binary export
tiensonqin May 15, 2026
d958d61
Merge pull request #12658 from logseq/codex/fix-left-sidebar-ellipsis
RCmerci May 15, 2026
20d13c8
enhance(skill): update logseq-task-on-lambda
RCmerci May 15, 2026
4eb012a
fix: scoped node property values (#12659)
tiensonqin May 15, 2026
a977855
fix(asset): handle external-url paths and plugin binary writes (#12656)
VictorVow May 15, 2026
fef89c1
fix(ui): incorrect background color for the pdf viewer toolbar
xyhp915 May 15, 2026
9dbb2ca
fix(i18n): include i18n keys in notification payload
megayu May 15, 2026
1ec64cd
enhance(skill): update logseq-task-on-lambda
RCmerci May 15, 2026
e9ea5ef
Fix sqlite FTS quote parsing
RCmerci May 15, 2026
302f798
fix(editor): open missing journal links from shortcut
tiensonqin May 15, 2026
658e672
fix(assets): improve handling of external and local asset URLs
xyhp915 May 15, 2026
daa876a
enhance(skill): update logseq-cli, logseq-task-on-lambda
RCmerci May 15, 2026
fe153af
fix(search): more cases of invalid fts search string
RCmerci May 15, 2026
80cb2d9
enhance(skill): update logseq-task-on-lambda
RCmerci May 15, 2026
e2aaba0
enhance(skill): update logseq-task-on-lambda
RCmerci May 16, 2026
4b8f4cb
fix(cli): hide empty property ids in show
RCmerci May 16, 2026
ccf60cc
enhance(cli): clarify sync upload help
RCmerci May 16, 2026
59456be
Merge pull request #12667 from logseq/codex/cli-sync-upload-help-info
RCmerci May 16, 2026
c6d1116
Merge pull request #12666 from logseq/codex/fix-cli-show-empty-proper…
RCmerci May 16, 2026
ef2c358
enhance(dev): enable claude to read project skills
logseq-cldwalker May 16, 2026
9ac459c
fix(cli): task --priority completion regression
logseq-cldwalker May 16, 2026
c89c7ea
fix: build-edn fails to export :build/class-properties that roundtrip
logseq-cldwalker May 17, 2026
6af3934
enhance: export-edn exports ::sqlite-export/graph-files
logseq-cldwalker May 17, 2026
d382380
fix: bound preview printing
RCmerci May 17, 2026
c673ff4
fix(cli): preserve deep preview values
RCmerci May 17, 2026
8cfe7b2
Merge pull request #12670 from logseq/codex/bounded-pr-str
RCmerci May 17, 2026
efea55b
fix: emoji doesn't show name on hover
logseq-cldwalker May 17, 2026
e3e548f
emove debug print
megayu May 18, 2026
e9d66de
fix(electron): install CLI launcher in local bin (#12664)
tiensonqin May 18, 2026
4cdb14e
fix(cli): normalize block content tree
tiensonqin May 18, 2026
466647e
[codex] improve sync onboarding (#12676)
tiensonqin May 18, 2026
efd9380
fix: path bookkeeping
tiensonqin May 18, 2026
6dd00b0
fix: stabilize mobile navigation stacks
tiensonqin May 18, 2026
5038cd0
fix: use https for ios mobile dev server
tiensonqin May 18, 2026
e6c3011
fix: navigation stack
tiensonqin May 18, 2026
b28cd24
fix: route mobile search results through home stack
tiensonqin May 18, 2026
4885e9a
fix: keep search result navigation in search stack
tiensonqin May 18, 2026
66711b4
fix: smooth ios search exit
tiensonqin May 18, 2026
ae0a675
fix: smooth mobile search transitions
tiensonqin May 18, 2026
96fbf5b
fix: focus mobile search immediately
tiensonqin May 18, 2026
326eebe
fix: speed up ios search focus
tiensonqin May 18, 2026
0d79279
fix: avoid search exit on app background
tiensonqin May 18, 2026
c879671
fix: smooth bottom sheet
tiensonqin May 18, 2026
92c2b09
fix: wrap native notifications
tiensonqin May 18, 2026
2b950ba
fix: show graph download progress from switcher
tiensonqin May 18, 2026
7259ce4
fix: native ios graphs view
tiensonqin May 18, 2026
4803a30
fix: avoid web graphs flash on ios
tiensonqin May 18, 2026
3852d18
fix: mask native tab transition briefly
tiensonqin May 18, 2026
32f3fd5
fix: prevent calendar double redirect
tiensonqin May 18, 2026
0f352a8
enhance: pull to refresh graphs
tiensonqin May 18, 2026
05ea21e
fix: remove unused navigation binding
tiensonqin May 18, 2026
df6a83d
fix: address ios native review issues
tiensonqin May 18, 2026
519bdf3
fix: port
tiensonqin May 18, 2026
7efb9aa
enhance(mobile): improve flashcards tab
tiensonqin May 19, 2026
0e87a83
feat: comments (#12672)
tiensonqin May 19, 2026
f94c241
disable ssl by default
tiensonqin May 19, 2026
4afc961
chore: remove :block/content usage from publish worker
tiensonqin May 19, 2026
29854b9
enhance: tag comment blocks
tiensonqin May 19, 2026
8e48079
fix: comment issues
tiensonqin May 19, 2026
553f15a
fix: comment icon alignment
tiensonqin May 19, 2026
2260913
fix: undo lost created-by
tiensonqin May 19, 2026
d68cbce
enhance(ux): able to edit #Comments title
tiensonqin May 19, 2026
910a76f
fix: sync migration txs (#12687)
tiensonqin May 20, 2026
07e81c7
fix: AppImage CLI launcher popup (#12686)
tiensonqin May 20, 2026
7950eb1
fix: upload map form sync txs
tiensonqin May 20, 2026
9b548a1
enhance(mobile): add language setting
tiensonqin May 20, 2026
93d2bf1
fix: add mobile selection comment action
tiensonqin May 20, 2026
469bb18
fix: improve mobile flashcards layout
tiensonqin May 20, 2026
6b16efc
fix: avatar initials for non-latin usernames (#12692)
tiensonqin May 20, 2026
ed3be1a
fix: skip comments in publish payload (#12694)
tiensonqin May 20, 2026
bb04428
update publish version
tiensonqin May 20, 2026
f791ecc
publish style tweaks
tiensonqin May 20, 2026
b1008c2
enhance(page): improve navigation handling for mobile and app (#12668)
megayu May 21, 2026
d130d72
Fix external asset rendering and journal import namespace handling (#…
megayu May 21, 2026
0a28fb4
fix: share block unique title for search (#12695)
tiensonqin May 21, 2026
c5c24d2
fix: stabilize cmdk page result test id
tiensonqin May 21, 2026
ec0c01f
enhance: use graph identity in URLs (#12693)
tiensonqin May 21, 2026
3deaf74
fix: mobile search should show normalized title
tiensonqin May 21, 2026
7e2062f
enhance: update flashcards icon
tiensonqin May 21, 2026
4ae733b
fix: mobile toolbar action width
tiensonqin May 21, 2026
3899511
fix: `:fix` pending txs no-op during reverse
tiensonqin May 21, 2026
0a895e4
fix: wrong url when open another graph
tiensonqin May 21, 2026
3a7c25c
fix: don't submit comment when composing
tiensonqin May 21, 2026
31886f8
chore: remove tests
tiensonqin May 21, 2026
10ccc2c
fix: keep search visible on iOS tabs
tiensonqin May 21, 2026
94ccc71
fix: copy from comments
tiensonqin May 21, 2026
c48b699
fix: prevent deleting only demo graph
tiensonqin May 21, 2026
b2dee8c
fix: guard graph transfer concurrency
tiensonqin May 21, 2026
b3c2002
Enforce strict page alias ownership and improve alias search (#12662)
megayu May 21, 2026
7f063d9
fix(editor): show add-block button on block-rooted views
VictorVow May 21, 2026
b3ab321
fix: start of week
tiensonqin May 21, 2026
96d35c7
refactor: use block content indent class
tiensonqin May 21, 2026
3173364
fix(sync): drop stale asset ops
tiensonqin May 22, 2026
a504078
enhance(android ): ux improvements (#12665)
xyhp915 May 22, 2026
507a39f
feat(cli): agent bridge
RCmerci May 19, 2026
5f3e213
fix agent bridge concurrent codex exec routing
RCmerci May 20, 2026
b940287
feat(cli): agent bridge support comment block trigger
RCmerci May 20, 2026
1712bff
enhance(cli): update agent bridge, prompt store in graph
RCmerci May 20, 2026
26f2fba
enhance(cli): register agent-name page
RCmerci May 21, 2026
07c5aa9
enhance(skill): update logseq-review-workflow
RCmerci May 21, 2026
5688b40
fix: issues found by logseq-review-workflow
RCmerci May 21, 2026
73fccfb
enhance: update :logseq.property.agent/session-id
RCmerci May 21, 2026
203ca43
fix: agent bridge and logging
RCmerci May 22, 2026
b6b182f
fix: add codex exec options
RCmerci May 22, 2026
a2a1381
fix lint
RCmerci May 22, 2026
5efb867
enhance: update :logseq.property/assignee definition
RCmerci May 22, 2026
43dd736
fix(apis): refine schema handling for property visibility and type
xyhp915 May 22, 2026
aeeb329
fix: :logseq.property/assignee definition
RCmerci May 22, 2026
d1e4c3a
fix: create-graph bootstrap
RCmerci May 22, 2026
b39adf0
fix: comment shortcut focus from editing block
tiensonqin May 22, 2026
3a8c24a
fix(cli): command-specific options don't autocomplete after global op…
logseq-cldwalker May 22, 2026
9f3d6c7
fix lint
RCmerci May 22, 2026
8c71f2c
fix(cli): handle inline block properties
RCmerci May 22, 2026
f5d94ec
fix(cli): handle inline block properties atomically
RCmerci May 22, 2026
e9e4445
Merge pull request #12682 from logseq/codex/agent-bridge
RCmerci May 22, 2026
b22fa0c
fix: stabilize asset block editing
tiensonqin May 22, 2026
d3518ae
chore: remove cli qmd support
tiensonqin May 22, 2026
e81c8c8
dev(skill): remove logseq-task-on-lambda
RCmerci May 22, 2026
aae14bb
fix: allow moving comments block as sibling
tiensonqin May 22, 2026
d696a67
enhance(mobile): add selection bar reaction (#12712)
RCmerci May 22, 2026
c8b8bd3
fix: limit mobile comment toolbar (#12713)
RCmerci May 22, 2026
cd96ecb
enhance(cli): update agent-bridge prompt
RCmerci May 23, 2026
1e2848e
fix(build-edn): property with alias fails to build alias
logseq-cldwalker May 24, 2026
b71d290
Merge pull request #12707 from logseq/codex/fix-cli-block-inline-prop…
RCmerci May 24, 2026
95b3104
enhance(cli): update agent bridge prompt
RCmerci May 24, 2026
71a6672
fix test
RCmerci May 24, 2026
2f9d137
enhance(cli): set reaction and status when agent-bridge start working
RCmerci May 24, 2026
2efa164
fix: repair comment thread metadata
tiensonqin May 25, 2026
c8ab870
fix: add Task tag when setting status
RCmerci May 25, 2026
3922e5d
fix: avoid shadowing cat in outliner test
RCmerci May 25, 2026
860904b
Merge pull request #12719 from logseq/fix/task-tag-status-767
RCmerci May 25, 2026
d7955dd
fix: mobile asset uploads (#12721)
tiensonqin May 25, 2026
6cb5d99
fix: start agent bridge tasks after session id
RCmerci May 25, 2026
30498f8
fix: route agent bridge tasks from id datoms
RCmerci May 25, 2026
2e8c749
fix: dedupe agent bridge startup routing
RCmerci May 25, 2026
ae2ba48
enhance: improve gallery view (#12698)
tiensonqin May 25, 2026
25e12de
fix: parse compatibility graph web urls
tiensonqin May 25, 2026
ef7730a
fix: mobile comment toolbar actions
RCmerci May 25, 2026
a4e423c
fix: keep comment editor open on save failure
tiensonqin May 25, 2026
0894f31
fix: align mobile reaction toolbar test
tiensonqin May 25, 2026
6d22c84
enhance(skill): add logseq-review-workflow-eval
RCmerci May 25, 2026
7d21931
fix: update mobile comment toolbar
tiensonqin May 25, 2026
d5ecaa0
enhance(mobile): add haptics for selection bar actions
tiensonqin May 25, 2026
774640d
fix: smooth iOS tab webview transitions
tiensonqin May 25, 2026
c077b55
Potential fix for pull request finding
tiensonqin May 25, 2026
2df31ef
fix(regression): block uuid should be replaced with title in search r…
tiensonqin May 26, 2026
073bbeb
fix: keep canonical page title in search results
tiensonqin May 26, 2026
626a0ff
fix: upload CLI assets
RCmerci May 26, 2026
969f0b4
fix: remove agent bridge list
RCmerci May 26, 2026
d21906d
fix: ensure local graph uuid
tiensonqin May 26, 2026
cbf1606
fix: edn export
tiensonqin May 27, 2026
9f59687
enhance(plugin): suppress API rate-limit notices; replace loader
xyhp915 May 27, 2026
e25a41a
fix: export scalar property values
tiensonqin May 27, 2026
0596129
fix: prevent block selection after released click
megayu May 27, 2026
d921807
refactor: rename pointer-down state APIs
Copilot May 27, 2026
fd1906a
feat: semantic search with zvec (#12710)
tiensonqin May 28, 2026
6b8e9d1
chore(dev): upgrade shadow cljs
xyhp915 May 28, 2026
b23dd71
Revert "chore(dev): upgrade shadow cljs"
xyhp915 May 28, 2026
9f618d9
fix(dev): shadow-cljs.edn
xyhp915 May 28, 2026
a3837bc
clean redundant class extends (#12735)
megayu May 28, 2026
53b7d9c
fix: allow repeated date picker selection (#12732)
tiensonqin May 28, 2026
693dd77
fix: use modern AppImage toolset for sandbox fallback
megayu May 28, 2026
92b9f39
fix: prune mobile stack on browser back (#12731)
tiensonqin May 28, 2026
97e1dfc
fix(plugin): marketplace related ui
xyhp915 May 28, 2026
bd1c637
fix: home/end/pageup/pagedown doesn't work
tiensonqin May 28, 2026
52398ac
chore: remove old cli (#12739)
tiensonqin May 28, 2026
fd5e004
refactor(cli): agent bridge
RCmerci May 28, 2026
3265245
fix: package zvec native bindings
tiensonqin May 28, 2026
19a9294
fix(i18n): correct Brazilian Portuguese search label
megayu May 29, 2026
bc13d20
ci: add snap publishing for desktop releases
megayu May 28, 2026
3801b4a
ci: prepare desktop release workflow for stable releases
megayu May 28, 2026
a53743f
ci: trigger Flathub release from desktop release workflow
megayu May 28, 2026
0d6c043
chore: update dependencies for linux snap publishing
megayu May 28, 2026
88d0832
fix(ci): generate snap config file instead of overriding via CLI args
megayu May 28, 2026
e6bdd9f
ci: align snap publish job with static artifact dependency
megayu May 28, 2026
ea7ec12
ci: decouple snap publishing from GitHub release
megayu May 28, 2026
a1d7c18
ci: decouple Flathub dispatch from release job
megayu May 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
216 changes: 216 additions & 0 deletions .agents/skills/esm-cjs-risk-scan/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
---
name: esm-cjs-risk-scan
description: Scan Logseq ClojureScript Node/Electron targets for npm module loading risks, especially ESM-only packages that may fail when loaded through js/require or shadow-cljs require-based shims. Use when changing Electron/main-process dependencies, debugging startup import errors, or auditing packages before dependency upgrades.
---

# ESM/CJS Risk Scan

Scan Node/Electron ClojureScript code for npm dependencies that may fail at runtime due to ESM/CJS incompatibility. Use when changing Electron dependencies, debugging startup import errors, or auditing before dependency upgrades.

## Quick Start

```bash
# Default scan (electron scope, human-readable table)
node .agents/skills/esm-cjs-risk-scan/scripts/scan_esm_cjs_risk.mjs

# Scan all Node targets
node .agents/skills/esm-cjs-risk-scan/scripts/scan_esm_cjs_risk.mjs --scope all-node

# Machine-readable TSV output
node .agents/skills/esm-cjs-risk-scan/scripts/scan_esm_cjs_risk.mjs --format tsv

# JSON output
node .agents/skills/esm-cjs-risk-scan/scripts/scan_esm_cjs_risk.mjs --format json

# Show full error details in probe results
node .agents/skills/esm-cjs-risk-scan/scripts/scan_esm_cjs_risk.mjs --verbose
```

## Parameters

| Parameter | Values | Default | Description |
|-----------|--------|---------|-------------|
| `--scope` | `electron`, `all-node` | `electron` | Which source directories and package locations to scan |
| `--format` | `table`, `tsv`, `json` | `table` | Output format. `table` is grouped and human-readable; `tsv` is tab-separated for machine parsing; `json` for programmatic use |
| `--verbose` / `-v` | (flag) | off | Show full error messages in probe results instead of abbreviated `ERR` |

### Scopes

| Scope | Source Directories | Description |
|-------|-------------------|--------------|
| `electron` | `src/electron/electron` | Electron main-process code only |
| `all-node` | See table below | All Node/server-side code across the repo |

**`all-node` source directories and their basis:**

| Directory | Build target / role |
|-----------|---------------------|
| `src/electron/electron` | `:electron` target — `:node-script` (Electron main process) |
| `src/test` | `:test` / `:test-no-worker` — `:node-test` (test runner) |
| `deps/cli/src` | CLI tool (nbb Node script, uses `fs-extra`, `path`) |
| `deps/db-sync/src`, `deps/db-sync/test` | DB sync server / Node adapter |
| `deps/db/script`, `deps/db/test` | DB utility scripts |
| `deps/graph-parser/src`, `test`, `script` | Graph parser CLI and tests |
| `deps/publishing/script`, `test` | Publishing CLI and tests |

Browser/Worker builds (`:app`, `:db-worker`, `:inference-worker`, `:mobile`) are intentionally excluded — their npm deps are resolved at bundle time and never `require()`-called directly in Node.
## What Gets Scanned

The scanner detects three import patterns in `.cljs` / `.cljc` / `.clj` files:

| Pattern | Kind | Example |
|---------|------|---------|
| `["pkg" :as x]` | `npm-import` | `["electron" :as e]` — shadow-cljs npm import (compiled to `require()` for Node targets) |
| `js/require "pkg"` | `js-require` | `(js/require "update-electron-app")` — Direct runtime `require()` call |
| `dynamic-import "pkg"` | `dynamic-import` | `(shadow.esm/dynamic-import "https-proxy-agent")` — Async ESM `import()` |

## Output

### Risk Levels

| Risk | Meaning | Action |
|------|---------|--------|
| **HIGH** | Package cannot be loaded by any mechanism. `js-require` with all probes failing; `dynamic-import` with import probe failing; or `npm-import` where **both** `require()` and `import()` fail (`esm-?` mode) | Must replace the package — no loading workaround exists |
| **MEDIUM** | `npm-import` where `require()` fails **but** `import()` works (`esm-imp` mode). Caused by packages whose `exports` map has **only** `"import"` conditionals with no `"require"` or top-level `"default"` fallback — Node's module resolver rejects `require()`. shadow-cljs generates `require()` which will fail | Switch to `dynamic-import` |
| **OK** | Package loads successfully from at least one probe CWD, or is `esm-req`/`esm-edep` — safe to use in ns-form require | No action needed |
| **INFO** | Relative path requires or Node builtins; always safe | Informational only |

### Table Columns (default format)

| Column | Description |
|--------|-------------|
| `PACKAGE` | npm package name as referenced in source code |
| `VER` | Version from package.json (`-` if not installed) |
| `KIND` | Import mechanism: `npm-import`, `js-require`, or `dynamic-import` |
| `TYPE` | Package `type` field: `cjs` (CommonJS), `esm` (ESM `type:module`), `blt` (Node builtin), `-` (unset) |
| `MODE` | Module load mode (see below). Abbreviated in table; full names in TSV/JSON |
| `REQUIRE` | Simplified require() probe results per CWD (see Probe Results below) |
| `FILE` | Source file containing the import |

HIGH/MEDIUM items additionally show: `exports` and `import` probe values.

### Module Modes

| Mode (full) | Table abbrev | Meaning |
|-------------|-------------|---|
| `cjs-or-nonmodule` | `cjs` | `type` is not `module`. CJS or unspecified — always works with `require()` |
| `module-require-compatible` | `esm-req` | `type: module` but `require()` still works (Node 22+ or dual-mode package) |
| `module-electron-dep` | `esm-edep` | `type: module`; probe fails only because Electron runtime (`electron` package) is absent. **Works fine in actual Electron.** |
| `module-import-only` | `esm-imp` | `type: module` and only loadable via `import()`. `require()` will fail |
| `module-unloadable` | `esm-?` | `type: module` and both `require()` and `import()` fail in current environment |
| `builtin` | `blt` | Node.js built-in module (fs, path, os, child_process, etc.) |

#### What actually makes require() fail for ESM packages?

Not merely `"type": "module"`. Node 22+ supports `require(esm)` for ESM modules without top-level `await`. The real determiner is the **`exports` map structure**:

| Package exports structure | require() behavior | Example |
|--------------------------|-------------------|---------|
| No `exports` field (only `main`) | ✅ Works in Node 22+ | `node-fetch@3.3.2` |
| `exports` has top-level `"default"` key | ✅ Works in Node 22+ | `electron-dl@4.0.0` (`{"types":…, "default":…}`) |
| `exports` has `"require"` key | ✅ Works (explicit CJS path) | Most dual-mode packages |
| `exports` has **only** `"import"` key, no `"default"` | ❌ Rejected by Node's module resolver | `https-proxy-agent` (`{"import":{…}}`) |

The scanner's **`esmOnly` flag** (in TSV/JSON output) marks the last case — exports explicitly restricts to import-only. Classification always uses probe results as the authoritative source.

### Probe Results

The scanner tests `require()` and `import()` from three CWD locations:

| Abbreviation | Directory | Role |
|--------------|-----------|------|
| `S` | `static/` | **Primary** Electron runtime directory |
| `R` | `resources/` | Secondary resources directory |
| `.` | repository root | Development directory |

**Compact display (default mode):**

| Display | Meaning |
|---------|---------|
| `ALL:OK` | Loads from all three CWDs |
| `ALL:ERR` | Fails from all three CWDs |
| `ALL:ERR(e-dep)` | All failures are electron-runtime errors; package loads fine in Electron |
| `S:OK R:ERR .:ERR` | Loads from static/ only (normal for Electron packages) |
| `S:ERR(e-dep) R:ERR(e-dep) .:ERR` | Probe fails because `electron` runtime is absent; package loads fine in Electron |
| `SKIP(electron)` | Skipped for `electron` runtime package |
| `BUILTIN` | Node.js built-in module |

Use `--verbose` (`-v`) for error details, e.g. `S:OK R:ERR(MODULE_NOT_FOUND) .:ERR(MODULE_NOT_FOUND)`.

### TSV Columns (--format=tsv)

All fields tab-separated, one row per usage:

`risk`, `kind`, `package`, `version`, `type`, `module_mode`, `exports_require`, `exports_import`, `require_probe`, `import_probe`, `file`

Probe columns contain raw probe strings (e.g. `static=OK;resources=ERR:MODULE_NOT_FOUND;.=ERR:MODULE_NOT_FOUND`).

## Workflow

1. Run the scanner.
2. Check the SUMMARY header for overall risk counts.
3. **HIGH**: Must fix. Package will crash at runtime.
4. **MEDIUM**: Review. Consider `dynamic-import` or CJS-compatible alternative.
5. **OK**: Verify `S:OK`-only packages are expected (installed in `static/node_modules` only).
6. For Electron code, also verify with runtime test:
```bash
pnpm exec electron static/electron.js
```

## Common Patterns & FAQ

### "S:OK R:ERR .:ERR" — Is this a problem?

**No.** This is normal for Electron-specific packages (e.g., `keytar`, `update-electron-app`, `electron-window-state`). They are installed in `static/node_modules/` (the Electron app directory). The `resources/` and root directories don't need them.

### "ERR:Electron failed to install correctly..."

This error appears when probing packages that depend on `electron` at runtime (e.g., `update-electron-app`) from directories where `electron` isn't properly available. **Not a real issue** — the package works fine from `static/` (`S:OK`), which is where Electron actually runs.

### Node builtins (fs, path, os, etc.)

Detected automatically and shown with `BUILTIN` probe status. Always work in Node/Electron targets. Classified as OK.

### `electron-*` package probing

Only the `electron` package itself (the runtime framework) skips probing. Other `electron-*` packages (`electron-log`, `electron-window-state`, `electron-dl`, etc.) are regular npm packages and are probed normally.

### ESM packages with `module-electron-dep` mode

Some ESM packages (e.g. `electron-dl v4`) internally call `import { BrowserWindow } from 'electron'`. When the scanner probes them with a plain Node.js `require()`, the call fails — not because the package is unloadable, but because the `electron` npm package (an installer shim) doesn't expose Electron's named runtime exports.

In the actual Electron runtime, the `electron` module IS the framework, so `BrowserWindow` and friends resolve correctly. The generated shadow.js shim (`shadow.js.nativeProvides["electron-dl"] = require("electron-dl")`) works fine at Electron startup.

**How the scanner detects this:** If every probe failure contains `'electron'` in the error message (the named-export failure pattern), the package is reclassified from `module-unloadable` → `module-electron-dep` and from MEDIUM/HIGH → **OK**. Probe column shows `ERR(e-dep)` to mark the probe location.

**When to verify manually:** If a new package shows `esm-edep` unexpectedly, inspect its source — it should contain `import ... from 'electron'` or use Electron APIs directly. You can also check the compiled Electron shim cache at `.shadow-cljs/builds/electron/dev/goog-js/` (Transit JSON, dev build) or `.shadow-cljs/builds/electron/release/closure-inputs/` (plain JS, release build) for `shadow.js.shim.module$<package>.js` files — their content will show `require("pkg")` if shadow-cljs successfully resolved the package for the Node/Electron target.

### Understanding the plain-Node probe limitation

The scanner runs `require()` and `import()` probes in a plain Node.js process (`node -e ...`), not inside a real Electron runtime. This means:
- Packages that depend on Electron APIs will fail the probe even if they work fine in the app
- The scanner uses the `module-electron-dep` heuristic to handle this case automatically
- For packages that use Electron APIs in unusual ways (not just `import ... from 'electron'`), a manual check may be needed

If a build has already been compiled, you can inspect `.shadow-cljs/builds/electron/release/closure-inputs/` for `shadow.js.shim.module$<package>.js` files (plain JS, immediately readable). The presence of `require("pkg")` in the shim content confirms shadow-cljs successfully resolved the package for the Electron Node target. This is the definitive ground truth; the scanner's probe is a pre-build approximation.

> **Note:** `static/js/cljs-runtime/` contains shims for browser worker targets that use `:js-provider :external` (currently `:db-worker` and `:inference-worker`). Those shims use `shadow$bridge("pkg")` — not `require()` — delegating actual module loading to the Webpack-bundled worker bundle. The `:app` target does not use `:js-provider :external` and its missing modules throw `"Module not provided"` at runtime instead. Electron (`:node-script`) shims never appear in this directory either.

## Recommended Fixes

For **HIGH** risk:
- Use a CJS-compatible subpath of the package if available
- Switch to `(shadow.esm/dynamic-import "pkg")` for ESM-only packages
- Pin a version that provides CJS support
- Use an alternative CJS-compatible package

For **MEDIUM** risk:
- Switch to `(shadow.esm/dynamic-import "pkg")`
- Find a CJS-compatible alternative
- Verify Node 22+ `require(esm)` covers your case (`module-require-compatible` mode)

Re-run the scanner after changes to verify fixes.

## Script

- Main script: [scan_esm_cjs_risk.mjs](./scripts/scan_esm_cjs_risk.mjs)
Loading