Files
markdown-converter/package.json
T
amitwh 111d36bf3d refactor(flowchart): build script generates bundle from pure modules (D1)
Before this commit, src/renderer/flowchart-bundle.js was a 1700+
line hand-maintained file with ~1100 lines of inlined copies of the
pure modules (shapes, mermaid, mermaid-parse, store, canvas,
clipboard, align). Every change to a pure module required a manual
re-sync, and the C17 multi-select commit had to be applied in two
places — drift between source and bundle was a real risk.

This refactor introduces scripts/build-flowchart-bundle.js that
reads each pure module from src/flowchart/ and concatenates them
into the final src/renderer/flowchart-bundle.js that the standalone
window loads as a single <script> tag.

Architecture:

  - src/renderer/flowchart-bundle.js — now auto-generated, gitignored
    only conceptually (still tracked so the standalone window works
    without running a build step in dev).
  - src/renderer/flowchart-bundle-tail.js — the unique code that
    was previously buried in the middle of the hand-maintained bundle:
    IIFE open, defensive checks, pure-module destructure, controller
    bootstrap, modal helpers, node-list panel, closing IIFE, and
    DOMContentLoaded bootstrap trigger.
  - scripts/build-flowchart-bundle.js — the generator. Reads 8 pure
    modules in dependency order (vsdx-export excluded — main-process
    only), wraps each in its own IIFE for scope isolation, rewrites
    canvas's CommonJS require() lines to use window globals, and
    rewrites bare 'module.exports = X' to 'window.FlowchartX = X'
    for modules without UMD guards.

Tests: 1386/1386 passing (no regressions). The pre-existing per-node
fill color test that was passing before now passes for the right
reason — the canvas source was updated to pass node.color through
to shapeSvg, which it always should have. The hand-maintained bundle
had been silently carrying a patched version that passed color but
was never backported to src/.

Amit Haridas
2026-10-01 07:31:37 +05:30

111 lines
4.0 KiB
JSON

{
"name": "markdown-converter",
"version": "4.13.0",
"description": "Professional Markdown editor and universal file converter with PDF editing, batch processing, and syntax highlighting",
"main": "src/main.js",
"desktopName": "MarkdownConverter",
"engines": {
"node": ">=22.0.0"
},
"scripts": {
"start": "electron .",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
"test:watch": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --watch",
"test:coverage": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage",
"lint": "eslint src tests",
"lint:fix": "eslint src tests --fix",
"format": "prettier --write src tests",
"format:check": "prettier --check src tests",
"build": "electron-builder --config electron-builder.config.js",
"build:win": "electron-builder --config electron-builder.config.js --win",
"build:win-signed": "cross-env CSC_LINK=code-signing-cert.pfx electron-builder --config electron-builder.config.js --win",
"build:win-unsigned": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --config electron-builder.config.js --win",
"create-cert": "powershell -ExecutionPolicy Bypass -File scripts/create-selfsigned-cert.ps1",
"build:mac": "electron-builder --config electron-builder.config.js --mac",
"build:linux": "electron-builder --config electron-builder.config.js --linux",
"build:linux-ci": "electron-builder --config electron-builder.config.js --linux deb AppImage",
"build:local": "electron-builder --config electron-builder.config.js --linux --win",
"dist": "electron-builder --config electron-builder.config.js --publish=never",
"dist:all": "electron-builder --config electron-builder.config.js -mwl",
"download-tools": "node scripts/download-tools.js",
"bundle:markitdown": "node scripts/bundle-markitdown.js",
"build:bundle": "node scripts/build-flowchart-bundle.js",
"generate-icons": "node scripts/generate-icons.js"
},
"keywords": [
"markdown",
"pandoc",
"converter",
"editor",
"pdf",
"audio",
"video",
"image"
],
"author": "ConcreteInfo <amit.wh@gmail.com>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/amitwh/markdown-converter"
},
"devDependencies": {
"@testing-library/dom": "^10.4.1",
"cross-env": "^10.0.0",
"electron": "^41.1.1",
"electron-builder": "^26.0.12",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"prettier": "^3.7.4"
},
"dependencies": {
"@cantoo/pdf-lib": "^2.9.1",
"@codemirror/autocomplete": "^6.20.1",
"@codemirror/commands": "^6.10.2",
"@codemirror/lang-css": "^6.3.1",
"@codemirror/lang-html": "^6.4.11",
"@codemirror/lang-javascript": "^6.2.5",
"@codemirror/lang-json": "^6.0.2",
"@codemirror/lang-markdown": "^6.5.0",
"@codemirror/lang-python": "^6.2.1",
"@codemirror/language": "^6.12.2",
"@codemirror/lint": "^6.9.5",
"@codemirror/search": "^6.6.0",
"@codemirror/state": "^6.5.4",
"@codemirror/theme-one-dark": "^6.1.3",
"@codemirror/view": "^6.39.16",
"@replit/codemirror-vim": "^6.4.0",
"codemirror": "^6.0.2",
"core-util-is": "^1.0.3",
"docx": "^9.6.0",
"dompurify": "^3.3.1",
"electron-store": "^10.1.0",
"electron-updater": "^6.6.2",
"ffmpeg-static": "^5.3.0",
"figlet": "^1.8.0",
"highlight.js": "^11.11.1",
"html2pdf.js": "^0.14.0",
"jszip": "^3.10.1",
"katex": "^0.18.5",
"marked": "^17.0.3",
"marked-footnote": "^1.4.0",
"marked-highlight": "^2.2.3",
"mermaid": "^11.12.3",
"pdfjs-dist": "^5.5.207",
"pdfkit": "^0.17.2",
"pizzip": "^3.2.0",
"sharp": "^0.35.4",
"simple-git": "^3.32.3",
"tslib": "^2.8.1"
},
"overrides": {
"jszip": "^3.10.1",
"nth-check": "^2.1.1",
"lodash.pick": "npm:lodash@^4.17.21",
"lodash-es": "^4.18.1",
"lodash": "^4.17.21"
}
}