Skip to content

fix: declare swig as a real dependency, document browser-usage constraint - #3

Merged
timurbazhirov merged 1 commit into
mainfrom
fix/swig-manifest-dependency
Jul 11, 2026
Merged

fix: declare swig as a real dependency, document browser-usage constraint#3
timurbazhirov merged 1 commit into
mainfrom
fix/swig-manifest-dependency

Conversation

@timurbazhirov

Copy link
Copy Markdown
Member

Summary

  • `swig` was only in `devDependencies` despite `src/js/utils.ts` importing it at module load — any standalone consumer of `@mat3ra/jode` got MODULE_NOT_FOUND. It only worked for downstream packages (job-designer, workflow-designer) that happened to also declare swig themselves.
  • Added a comment documenting a real constraint: renderJinjaTemplate only ever compiles in-memory strings, never loads templates from disk, so it's safe in a browser bundle — swig's file-loading features (fs-based) are not.

Test plan

  • npm test — 21 passing
  • Verified downstream: jove's standalone demo (deep-imports a real @mat3ra/jode) builds and renders with 0 runtime errors after this fix

…aint

swig was only in devDependencies despite src/js/utils.ts importing it at
module load — any consumer installing @mat3ra/jode alone got
MODULE_NOT_FOUND. It only worked for downstream packages that happened to
also declare swig themselves (job-designer, workflow-designer).

No logic change: renderJinjaTemplate only ever compiles in-memory strings,
never loads templates from disk, so it's safe in a browser bundle. Added a
comment documenting that constraint (swig's file-loading features use fs,
which is an empty stub under browser polyfills).
@timurbazhirov
timurbazhirov force-pushed the fix/swig-manifest-dependency branch from 69474b5 to 7c750ef Compare July 11, 2026 07:55
@timurbazhirov
timurbazhirov merged commit 13eb164 into main Jul 11, 2026
9 checks passed
@timurbazhirov
timurbazhirov deleted the fix/swig-manifest-dependency branch July 11, 2026 08:00
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