markdown-to-jsx 8.0.0 → 9.0.0

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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "markdown-to-jsx",
3
- "description": "Convert markdown to JSX with ease for React and React-like projects. Super lightweight and highly configurable.",
3
+ "description": "A very fast and versatile markdown toolchain. AST, React, and HTML output available with full customization.",
4
4
  "homepage": "https://markdown-to-jsx.quantizor.dev",
5
5
  "license": "MIT",
6
- "version": "8.0.0",
6
+ "version": "9.0.0",
7
7
  "publishConfig": {
8
8
  "access": "public",
9
9
  "mangle": {
@@ -17,17 +17,17 @@
17
17
  }
18
18
  },
19
19
  "engines": {
20
- "node": ">= 10"
20
+ "node": ">= 18"
21
21
  },
22
22
  "keywords": [
23
23
  "markdown",
24
- "markdown converter",
24
+ "markdown parser",
25
25
  "react",
26
26
  "preact",
27
27
  "jsx",
28
28
  "html"
29
29
  ],
30
- "author": "Evan Jacobs <x@quantizor.dev>",
30
+ "author": "Evan Jacobs <ej@quantizor.dev> (https://quantizor.dev)",
31
31
  "repository": {
32
32
  "type": "git",
33
33
  "url": "git+https://github.com/quantizor/markdown-to-jsx.git"
@@ -44,20 +44,47 @@
44
44
  ".": {
45
45
  "import": {
46
46
  "types": "./dist/index.d.ts",
47
- "node": "./dist/index.module.js",
48
- "default": "./dist/index.modern.js"
47
+ "default": "./dist/index.js"
49
48
  },
50
49
  "require": {
51
- "types": "./dist/index.cjs.d.ts",
50
+ "types": "./dist/index.d.cts",
52
51
  "default": "./dist/index.cjs"
53
52
  }
53
+ },
54
+ "./react": {
55
+ "import": {
56
+ "types": "./dist/react.d.ts",
57
+ "default": "./dist/react.js"
58
+ },
59
+ "require": {
60
+ "types": "./dist/react.d.cts",
61
+ "default": "./dist/react.cjs"
62
+ }
63
+ },
64
+ "./html": {
65
+ "import": {
66
+ "types": "./dist/html.d.ts",
67
+ "default": "./dist/html.js"
68
+ },
69
+ "require": {
70
+ "types": "./dist/html.d.cts",
71
+ "default": "./dist/html.cjs"
72
+ }
73
+ },
74
+ "./markdown": {
75
+ "import": {
76
+ "types": "./dist/markdown.d.ts",
77
+ "default": "./dist/markdown.js"
78
+ },
79
+ "require": {
80
+ "types": "./dist/markdown.d.cts",
81
+ "default": "./dist/markdown.cjs"
82
+ }
54
83
  }
55
84
  },
56
85
  "sideEffects": false,
57
86
  "main": "dist/index.cjs",
58
- "module": "dist/index.module.js",
59
- "source": "index.tsx",
60
- "unpkg": "./dist/index.umd.js",
87
+ "module": "dist/index.js",
61
88
  "types": "dist/index.d.ts",
62
89
  "devDependencies": {
63
90
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
@@ -66,36 +93,53 @@
66
93
  "@babel/plugin-transform-typescript": "^7.23.6",
67
94
  "@changesets/cli": "^2.27.1",
68
95
  "@matejmazur/react-katex": "^3.1.3",
69
- "@size-limit/preset-small-lib": "^11.0.1",
70
- "@types/jest": "^29.5.11",
71
- "@types/node": "^20.10.6",
72
- "@types/react": "^17.0.74",
96
+ "@tailwindcss/typography": "^0.5.19",
97
+ "@tailwindcss/vite": "^4.1.17",
98
+ "@types/benchmark": "^2.1.5",
99
+ "@types/bun": "^1.3.2",
100
+ "@types/node": "^24.10.1",
101
+ "@types/react": "^19.2.6",
102
+ "@types/react-dom": "^19.2.3",
103
+ "@vitejs/plugin-react": "^5.1.1",
104
+ "acorn": "^8.15.0",
105
+ "acorn-typescript": "^1.4.13",
73
106
  "benchtable": "^0.1.0",
107
+ "bunup": "^0.15.14",
74
108
  "cli-progress": "^3.12.0",
75
109
  "in-publish": "^2.0.1",
76
- "jest": "^29.7.0",
77
- "jest-environment-jsdom": "^29.7.0",
78
- "jest-serializer-html": "^7.1.0",
79
- "jest-watch-typeahead": "^2.2.2",
80
110
  "markdown-it": "^14.0.0",
81
- "markdown-to-jsx-latest": "npm:markdown-to-jsx@7.7.16",
111
+ "markdown-to-jsx-latest": "npm:markdown-to-jsx@8.0.0",
112
+ "marked": "^17.0.0",
82
113
  "microbundle": "^0.15.1",
83
114
  "microtime": "^3.1.1",
84
115
  "mkdirp": "^3.0.1",
85
116
  "preact": "^10.19.3",
86
- "prettier": "^2.0.0",
87
- "react": "^17.0.2",
88
- "react-dom": "^17.0.2",
89
- "rimraf": "^5.0.5",
117
+ "prettier": "^3.6.2",
118
+ "react": "^19.2.0",
119
+ "react-dom": "^19.2.0",
120
+ "react-markdown": "^10.1.0",
121
+ "recast": "^0.23.11",
122
+ "rehype-raw": "^7.0.0",
123
+ "rehype-react": "^8.0.0",
124
+ "remark": "^15.0.1",
125
+ "remark-directive": "^4.0.0",
126
+ "remark-gfm": "^4.0.1",
127
+ "remark-parse": "^11.0.0",
128
+ "remark-rehype": "^11.1.2",
129
+ "rimraf": "^6.1.0",
90
130
  "simple-markdown": "^0.7.3",
91
- "size-limit": "^11.0.1",
131
+ "source-map": "^0.7.6",
92
132
  "styled-components": "^6.1.6",
133
+ "tailwindcss": "^4.0.0",
93
134
  "theredoc": "^1.0.0",
94
- "ts-jest": "^29.1.1",
95
- "typescript": "^5.9.3"
135
+ "three": "^0.181.1",
136
+ "twgl": "^7.0.3",
137
+ "typescript": "^5.9.3",
138
+ "vite": "^7.2.2",
139
+ "yaml-js": "^0.3.1"
96
140
  },
97
141
  "peerDependencies": {
98
- "react": ">= 0.14.0"
142
+ "react": ">= 16.0.0"
99
143
  },
100
144
  "peerDependenciesMeta": {
101
145
  "react": {
@@ -104,51 +148,18 @@
104
148
  },
105
149
  "scripts": {
106
150
  "prepublish": "in-publish && npm run build && npm run release || not-in-publish",
107
- "prebuild": "rimraf dist && mkdirp dist",
108
- "build": "microbundle --tsconfig tsconfig.json -f cjs,umd index.cjs.tsx --name MarkdownToJSX --define process.env.NODE_ENV=production,process.env.DEBUG=0 --globals react=React && microbundle --tsconfig tsconfig.json -f es,modern --name MarkdownToJSX --define process.env.NODE_ENV=production,process.env.DEBUG=0 && microbundle --tsconfig tsconfig.json -f es --define process.env.NODE_ENV=production --no-compress -o dist/debug.mjs",
109
- "build-site": "microbundle site.tsx -o docs -f iife --tsconfig tsconfig.site.json --define process.env.NODE_ENV=production,process.env.DEBUG=0 --jsx React.createElement --external react,react-dom,styled-components,katex --globals react=React,react-dom=ReactDOM,styled-components=styled --no-pkg-main",
110
- "dev": "microbundle watch site.tsx -o docs -f iife --tsconfig tsconfig.site.json --define process.env.NODE_ENV=development --jsx React.createElement --external react,react-dom,styled-components,katex --globals react=React,react-dom=ReactDOM,styled-components=styled --no-pkg-main",
111
- "dev:debug": "microbundle watch --tsconfig tsconfig.json -f es --define process.env.NODE_ENV=production --no-compress -o dist/debug.mjs",
112
- "test": "jest --verbose",
113
- "test:fuzz": "jest fuzz.spec.ts --verbose",
114
- "metrics": "DEBUG=\"${DEBUG:-1}\" bun --expose-gc -e \"import fs from 'fs';import {performance}from 'perf_hooks';import {compiler} from './index.tsx';const markdown=fs.readFileSync('fixture.md','utf8');if(gc)gc();const baseline=process.memoryUsage();const before=process.memoryUsage();const t0=performance.now();compiler(markdown);const t1=performance.now();const during=process.memoryUsage();if(gc)gc();const after=process.memoryUsage();console.log('='.repeat(50));console.log('Input size:',Math.round(markdown.length/1024)+'KB');console.log('Parse time:',(t1-t0).toFixed(2)+'ms');console.log('='.repeat(50));console.log('Memory Usage:');console.log(' Baseline (Node + imports):',Math.round(baseline.heapUsed/1024)+'KB');console.log(' Peak (during parse):',Math.round(during.heapUsed/1024)+'KB');console.log(' Final (after GC):',Math.round(after.heapUsed/1024)+'KB');console.log('='.repeat(50));console.log('True Delta:');console.log(' Parsing allocated:',Math.round((during.heapUsed-before.heapUsed)/1024)+'KB');console.log(' GC freed:',Math.round((during.heapUsed-after.heapUsed)/1024)+'KB');console.log(' Final overhead:',Math.round((after.heapUsed-before.heapUsed)/1024)+'KB');console.log('='.repeat(50));\"",
115
- "profile": "node --cpu-prof --expose-gc profile.js && node profile.post.js",
116
- "size": "size-limit",
117
- "benchmark": "node benchmark.js",
118
- "benchmark:all": "node benchmark.js --all",
119
- "changeset-publish": "bun run build && changeset publish"
120
- },
121
- "size-limit": [
122
- {
123
- "path": "./dist/index.module.js",
124
- "limit": "8 kB"
125
- },
126
- {
127
- "path": "./dist/index.modern.js",
128
- "limit": "8 kB"
129
- }
130
- ],
131
- "jest": {
132
- "clearMocks": true,
133
- "testEnvironment": "jsdom",
134
- "transform": {
135
- "^.+\\.[tj]sx?$": [
136
- "ts-jest",
137
- {
138
- "diagnostics": {
139
- "ignoreCodes": [
140
- "TS151001"
141
- ]
142
- }
143
- }
144
- ]
145
- },
146
- "snapshotSerializers": [
147
- "jest-serializer-html"
148
- ],
149
- "watchPlugins": [
150
- "jest-watch-typeahead/filename",
151
- "jest-watch-typeahead/testname"
152
- ]
151
+ "build": "rimraf dist && bunup",
152
+ "build:debug": "rimraf dist && bunup --filter main --minifyIdentifiers=false --minifyWhitespace=false",
153
+ "build-site": "rimraf dist-site && vite build",
154
+ "dev": "vite dev --host",
155
+ "entities": "bun scripts/generate-entities.ts",
156
+ "fixture": "bun scripts/generate-fixture.ts",
157
+ "metrics": "bun --expose-gc scripts/metrics.ts",
158
+ "profile": "bun --cpu-prof --expose-gc scripts/profile.ts",
159
+ "bench": "bun --expose-gc scripts/benchmark.ts",
160
+ "analyze": "bun scripts/analyze-patterns.ts",
161
+ "bench:all": "bun scripts/benchmark.ts --all",
162
+ "bench:jsx": "bun scripts/benchmark.ts --jsx",
163
+ "changeset-publish": "bun run build && bun build-site && changeset publish"
153
164
  }
154
165
  }