diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fd482df..546f740 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,3 +62,7 @@ live outside the repository and are passed through `MXBLOCKS_PRIVATE_PATTERNS`. Never commit their actual values or an unsanitized match report. Current-tree privacy checks do not remove material from Git history, PRs, tags, or artifacts. Review those separately before changing repository visibility. + +The Element build uses Nix esbuild 0.27.2; keep its npm version matched to +the Nix binary. The newer npm 0.28 line cannot be combined with this Nix binary. +Node type definitions track the supported Node 24 runtime. diff --git a/README.md b/README.md index e213d29..2ab89c7 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ fallback for clients without the module. ## Development -Use Rust 1.88+, Node 24+, and the pnpm version pinned in `packageManager`. +Use Rust 1.88+, Node 24.21+, and the pnpm version pinned in `packageManager`. `nix develop` supplies the Rust/Node tools, pnpm, resvg, and fonts. ```sh diff --git a/docs/integration.md b/docs/integration.md index 7f342c3..758a516 100644 --- a/docs/integration.md +++ b/docs/integration.md @@ -57,7 +57,7 @@ pnpm add @talaagent/mxblocks-math pnpm exec mxblocks-math render --out formula.png 'x^2 + y^2 = z^2' ``` -The npm CLI requires Node 24+, `resvg`, and fonts. Configure +The npm CLI requires Node 24.21+, `resvg`, and fonts. Configure `MXBLOCKS_MATH_RESVG` and `MXBLOCKS_MATH_FONT_DIR` explicitly in a service. It reads TeX from stdin when the last argument is `-` and returns one JSON line containing `mimetype`, `w`, `h`, and `size`. `mxblocks_tex::Renderer` consumes this contract. diff --git a/flake.lock b/flake.lock index 9898059..493bb60 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1793795574, - "narHash": "sha256-pgG/CO+txdf2sA2z6DsM+2G3F9ajfIp/3BMC4wfKMDY=", + "lastModified": 1793977579, + "narHash": "sha256-WrSODdZFVIs/Hh2NzC0bY+ROByi0bATg8WfePX8dPj8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "13e53762c5afaf384d4614e94527a9ccfafe41d0", + "rev": "4fe25e12eb9f4c744966dd3de5a05246cf098601", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 7e4ad96..cad0952 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,7 @@ version = "0.1.0"; src = jsSrc; fetcherVersion = 5; - hash = "sha256-oPzRUen72Wz9k2zO9hyLViLl5A9UO4p0Vw5p5XStrUY="; + hash = "sha256-Js1HHFXMXO9B+UwCgDv9tNjaWxONpqEAEik+EDRngC4="; }; in { diff --git a/package.json b/package.json index 90d50d2..5b37e58 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "packageManager": "pnpm@12.9.0", "engines": { - "node": ">=24" + "node": ">=24.21.0" }, "scripts": { "build": "turbo run build", diff --git a/packages/mxblocks-element/package.json b/packages/mxblocks-element/package.json index 3ae95be..a80c4c4 100644 --- a/packages/mxblocks-element/package.json +++ b/packages/mxblocks-element/package.json @@ -15,14 +15,14 @@ "build": "esbuild src/index.tsx --bundle --format=esm --target=es2022 --minify --sourcemap --jsx=transform --jsx-factory=React.createElement --jsx-fragment=React.Fragment --loader:.css=text --outfile=dist/mxblocks-rich.js && mkdir -p dist/fonts && cp node_modules/katex/dist/fonts/*.woff2 dist/fonts/" }, "devDependencies": { - "@types/node": "^24.0.0", + "@types/node": "^24.19.2", "@types/react": "^19.1.0", - "katex": "^0.18.10", - "typescript": "^5.9.0", + "katex": "^0.19.1", + "typescript": "^7.0.2", "esbuild": "0.27.2" }, "engines": { - "node": ">=24" + "node": ">=24.21.0" }, "files": [ "dist", diff --git a/packages/mxblocks-math/README.md b/packages/mxblocks-math/README.md index dbedcdb..46b2956 100644 --- a/packages/mxblocks-math/README.md +++ b/packages/mxblocks-math/README.md @@ -8,7 +8,7 @@ mxblocks-math render --out formula.png 'x^2 + y^2 = z^2' printf '%s' '\frac{a}{b}' | mxblocks-math render --inline --out fraction.png - ``` -Node 24 or newer, `resvg`, and fonts are required. Set `MXBLOCKS_MATH_RESVG` and +Node 24.21 or newer, `resvg`, and fonts are required. Set `MXBLOCKS_MATH_RESVG` and `MXBLOCKS_MATH_FONT_DIR` when they are not available through the environment. `nix build .#mxblocks-math` provides a wrapper with pinned dependencies, fonts, and a wall-clock timeout. For development, `nix develop` supplies the same tools. diff --git a/packages/mxblocks-math/package.json b/packages/mxblocks-math/package.json index 7bec1db..34c55d7 100644 --- a/packages/mxblocks-math/package.json +++ b/packages/mxblocks-math/package.json @@ -21,7 +21,7 @@ "mathjax-full": "3.2.2" }, "engines": { - "node": ">=24" + "node": ">=24.21.0" }, "files": [ "src", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 83da17f..2a375ab 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -174,7 +174,7 @@ importers: packages/mxblocks-element: devDependencies: '@types/node': - specifier: ^24.0.0 + specifier: ^24.19.2 version: 24.19.2 '@types/react': specifier: ^19.1.0 @@ -183,11 +183,11 @@ importers: specifier: 0.27.2 version: 0.27.2 katex: - specifier: ^0.18.10 - version: 0.18.10 + specifier: ^0.19.1 + version: 0.19.1 typescript: - specifier: ^5.9.0 - version: 5.9.3 + specifier: ^7.0.2 + version: 7.0.2 packages/mxblocks-math: dependencies: @@ -389,6 +389,126 @@ packages: '@types/react@19.3.0': resolution: {integrity: sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==} + '@typescript/typescript-aix-ppc64@7.0.2': + resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [aix] + + '@typescript/typescript-darwin-arm64@7.0.2': + resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [darwin] + + '@typescript/typescript-darwin-x64@7.0.2': + resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [darwin] + + '@typescript/typescript-freebsd-arm64@7.0.2': + resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [freebsd] + + '@typescript/typescript-freebsd-x64@7.0.2': + resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [freebsd] + + '@typescript/typescript-linux-arm64@7.0.2': + resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [linux] + + '@typescript/typescript-linux-arm@7.0.2': + resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} + engines: {node: '>=16.20.0'} + cpu: [arm] + os: [linux] + + '@typescript/typescript-linux-loong64@7.0.2': + resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} + engines: {node: '>=16.20.0'} + cpu: [loong64] + os: [linux] + + '@typescript/typescript-linux-mips64el@7.0.2': + resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} + engines: {node: '>=16.20.0'} + cpu: [mips64el] + os: [linux] + + '@typescript/typescript-linux-ppc64@7.0.2': + resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [linux] + + '@typescript/typescript-linux-riscv64@7.0.2': + resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} + engines: {node: '>=16.20.0'} + cpu: [riscv64] + os: [linux] + + '@typescript/typescript-linux-s390x@7.0.2': + resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} + engines: {node: '>=16.20.0'} + cpu: [s390x] + os: [linux] + + '@typescript/typescript-linux-x64@7.0.2': + resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [linux] + + '@typescript/typescript-netbsd-arm64@7.0.2': + resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [netbsd] + + '@typescript/typescript-netbsd-x64@7.0.2': + resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [netbsd] + + '@typescript/typescript-openbsd-arm64@7.0.2': + resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [openbsd] + + '@typescript/typescript-openbsd-x64@7.0.2': + resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [openbsd] + + '@typescript/typescript-sunos-x64@7.0.2': + resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [sunos] + + '@typescript/typescript-win32-arm64@7.0.2': + resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [win32] + + '@typescript/typescript-win32-x64@7.0.2': + resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [win32] + '@xmldom/xmldom@0.9.12': resolution: {integrity: sha512-5AXjrcMClTryPe9LgZrygpB1lj7s0S9E0+W+AHaVKAVyHanafK86iPSvG5xHVSp/jC+VH1UXu0TAEmY279xH7A==} engines: {node: '>=14.6'} @@ -413,8 +533,8 @@ packages: resolution: {integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==} engines: {node: '>=6'} - katex@0.18.10: - resolution: {integrity: sha512-/B6p9eY9DX7aHBfpkHdpirDTZ5QH9xTwL9y837PWuzuv41O5jFdqNQwVQEQsimY0/iVNkwBY4+4hMfhQ7d4Dbw==} + katex@0.19.1: + resolution: {integrity: sha512-jG8uKntjSEcm2EpQOh0XturpPuuC9r3Sq5HLHdsFdWZT27E672SF19QEi+of0/YeOy15lDgRhKvr5614uRrEfA==} hasBin: true mathjax-full@3.2.2: @@ -435,9 +555,9 @@ packages: resolution: {integrity: sha512-3GJYwig8ygEI89oaOZdduJX8/aw6O9eRPYHoIt6T3FZl9hkKjiyIspufJoVgqXihPoJu8M5CSV0DlZvzfohBCw==} hasBin: true - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} - engines: {node: '>=14.17'} + typescript@7.0.2: + resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} + engines: {node: '>=16.20.0'} hasBin: true undici-types@7.24.6: @@ -552,6 +672,66 @@ snapshots: dependencies: csstype: 3.2.3 + '@typescript/typescript-aix-ppc64@7.0.2': + optional: true + + '@typescript/typescript-darwin-arm64@7.0.2': + optional: true + + '@typescript/typescript-darwin-x64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-x64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm@7.0.2': + optional: true + + '@typescript/typescript-linux-loong64@7.0.2': + optional: true + + '@typescript/typescript-linux-mips64el@7.0.2': + optional: true + + '@typescript/typescript-linux-ppc64@7.0.2': + optional: true + + '@typescript/typescript-linux-riscv64@7.0.2': + optional: true + + '@typescript/typescript-linux-s390x@7.0.2': + optional: true + + '@typescript/typescript-linux-x64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-sunos-x64@7.0.2': + optional: true + + '@typescript/typescript-win32-arm64@7.0.2': + optional: true + + '@typescript/typescript-win32-x64@7.0.2': + optional: true + '@xmldom/xmldom@0.9.12': {} commander@13.1.0: {} @@ -591,7 +771,7 @@ snapshots: esm@3.2.25: {} - katex@0.18.10: + katex@0.19.1: dependencies: commander: 15.0.0 @@ -621,7 +801,28 @@ snapshots: '@turbo/windows-64': 2.11.10 '@turbo/windows-arm64': 2.11.10 - typescript@5.9.3: {} + typescript@7.0.2: + optionalDependencies: + '@typescript/typescript-aix-ppc64': 7.0.2 + '@typescript/typescript-darwin-arm64': 7.0.2 + '@typescript/typescript-darwin-x64': 7.0.2 + '@typescript/typescript-freebsd-arm64': 7.0.2 + '@typescript/typescript-freebsd-x64': 7.0.2 + '@typescript/typescript-linux-arm': 7.0.2 + '@typescript/typescript-linux-arm64': 7.0.2 + '@typescript/typescript-linux-loong64': 7.0.2 + '@typescript/typescript-linux-mips64el': 7.0.2 + '@typescript/typescript-linux-ppc64': 7.0.2 + '@typescript/typescript-linux-riscv64': 7.0.2 + '@typescript/typescript-linux-s390x': 7.0.2 + '@typescript/typescript-linux-x64': 7.0.2 + '@typescript/typescript-netbsd-arm64': 7.0.2 + '@typescript/typescript-netbsd-x64': 7.0.2 + '@typescript/typescript-openbsd-arm64': 7.0.2 + '@typescript/typescript-openbsd-x64': 7.0.2 + '@typescript/typescript-sunos-x64': 7.0.2 + '@typescript/typescript-win32-arm64': 7.0.2 + '@typescript/typescript-win32-x64': 7.0.2 undici-types@7.24.6: {} diff --git a/scripts/package-artifacts b/scripts/package-artifacts index bc93fb5..fd74510 100755 --- a/scripts/package-artifacts +++ b/scripts/package-artifacts @@ -37,7 +37,7 @@ metadata = { "schema": 1, "packages": versions, "element": {"entrypoint": "mxblocks-rich.js", "fonts": "fonts/", "moduleApi": "^2.2.0"}, - "math": {"command": "mxblocks-math", "node": ">=24", "externalRequirements": ["resvg", "fonts"]}, + "math": {"command": "mxblocks-math", "node": json.loads((root / "packages/mxblocks-math/package.json").read_text())["engines"]["node"], "externalRequirements": ["resvg", "fonts"]}, "files": {p.name: hashlib.sha256(p.read_bytes()).hexdigest() for p in artifacts}, } manifest = out / "manifest.json"