Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Run automation scripts with Node's built-in type stripping instead of ts-node. Utils becomes "type": "module" with an exports map, package scripts are renamed to .mts, and the changelog parsers are generated as ES modules with peggy 5.1.0.
…f compiling on prepare
b4b9747 to
bfbe914
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rui-prepare-release.ts was the only bin without a shebang, and three bins were not executable. tsconfig has noEmit, so outDir, declaration and noEmitOnError had no effect.
AI Code Review
What was reviewed
Skipped (out of scope): Findings🔶 Medium — Snyk security check failingFile: CI (
|
Pull request type
Refactoring (e.g. file rename, variable rename, etc.)
Dependency changes (any modification to dependencies in
package.json)Description
Moves
@mendix/automation-utils, the module build/release scripts and the MCP servers from ts-node/tsc builds and CommonJS to native ESM, run directly by Node 24's built-in type stripping. ts-node is removed. Also unifies how scripts are type-checked and linted across packages.automation/utils
"type": "module"plus anexportsmap;main/typesremoved.node file.ts; shebangs changed fromts-node-scripttonode.module/moduleResolution: NodeNext,allowImportingTsExtensions,erasableSyntaxOnlyandverbatimModuleSyntax, so tsc flags anything Node can't strip. It now also covers the root entry files (index.ts,shell.ts,steps.ts,utils.ts)..tsextensions, type-only imports use inlinetype,<T>xcasts becameas T, and constructor parameter properties became plain fields.__dirnamebecameimport.meta.dirname,require.mainbecameimport.meta.main, andpackage.jsonis read withreadFile+JSON.parseinstead of a dynamic import.lintis noweslint . package.json, sobin/andpackage.jsonare linted too. This fixed 7 errors that were already inbin/and addscauseto rethrown errors..prettierrc.jsis renamed to.prettierrc.cjs.Changelog parsers
--format esas.mjsfiles.prepareonly runstsc. Runpnpm run compile:parserafter editing a.pegjsgrammar; each grammar's header says so.compile:parser:moduleused to compile the widget grammar andcompile:parser:widgetthe module grammar. Each name now matches its output.Modules (calendar, data-widgets, file-uploader, google-tag, pusher, web-actions)
"type": "module"added topackage.json, so the scripts stay plain.tsand run asnode scripts/X.ts..prettierrc.jsis renamed to.prettierrc.cjs.lint(tsc --project scripts/tsconfig.json), and eachscripts/tsconfig.jsonsets"include": ["."]. Before, four of them inherited automation-utils'include, sotscchecked none of their scripts. ts-node used to type-check scripts on every run; this replaces that check.bundle-xlsx.tsare fixed for NodeNext typings.charts-web
scripts/build.mts. Widgets have no Node"type"field, and adding one would affect pluggable-widgets-tools, so.mtskeeps it ESM.MCP servers (e2e-mcp, marketplace-mcp)
src/index.ts; thebuild/dev/postinstalltsc steps are removed, sopnpm ino longer compiles them and.mcp.jsoncan't run a staledist/.lintis atsctype-check, and both are marked"private": true.dist/index.jsshould switch it tosrc/index.ts.Lint cleanups
eslint src/ package.json.eslint-config-web-widgets/.prettierrc.mjs. It used CommonJS inside an ES module and imported a file that doesn't exist; Prettier always picked the.prettierrc.jsnext to it.Docs
widget-to-module.mddescribes the new module setup. The release-widget skill no longer mentions ts-node.Notes
import.meta.mainrequires Node ≥ 24.2 (.nvmrcis 24.12).@mendix/pluggable-widgets-tools; nothing in this repo uses it directly.What should be covered while testing?
pnpm iruns utils'prepare(tsconly) and no longer builds the MCP servers.pnpm lintpasses for automation/utils, all modules, charts-web, calendar-web, automation/scripts and both MCP servers.rui-check-changelogsruns.build:modulefor web-actions, data-widgets, calendar, file-uploader and pusher; charts-webpnpm turbo build;rui-package-info;rui-verify-package-format; both MCP servers answer an MCP handshake via.mcp.json,pnpm startand their bins.build:modulefails, and it fails the same way on main:scripts/build.tscopiesGoogleTagActions.js, but the file isGoogleTagAction.js. Not fixed here.