Commit Graph

2 Commits

Author SHA1 Message Date
Matiss Janis Aboltins
60c5d9b993 [AI] DX: replace ts-node with Node native TypeScript execution (#8304)
* [AI] Replace ts-node with Node native TypeScript execution

Node 22.18+ runs TypeScript files directly via type stripping, so the
ts-node dependency is no longer needed for the repo's helper scripts.

- Run bin/ and loot-core pack-hook scripts with `node` instead of `ts-node`
- Rename bin/*.ts scripts to .mts (unambiguous ESM, runs warning-free)
- ESM-ify validate-publish-imports: __dirname / require.main via import.meta
- Drop ts-node devDependency and the tsconfig ts-node override block
- Bump engines.node to >=22.18.0 (first release with stable type stripping)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019d6S7BWQdmtAcYg89WuAVd

* [AI] Use .mts import specifier and simplify release note

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019d6S7BWQdmtAcYg89WuAVd

* [AI] Bump .nvmrc to v22.18.0 to match engines floor

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019d6S7BWQdmtAcYg89WuAVd

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-22 21:41:00 +00:00
Matiss Janis Aboltins
4bc8ec876a [AI] Add publishConfig.imports sync validator with pre-commit integration (#7469)
* [AI] Add publishConfig.imports sync validator with pre-commit integration

Add a TypeScript script that validates publishConfig.imports stays in sync
with imports in all packages/*/package.json files. Runs automatically in
the pre-commit hook via lint-staged with --fix mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [AI] Add release notes for #7469

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [AI] Guard main() with require.main and respect lint-staged file args

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [AI] Handle non-string imports targets in derivePublishImports

- Add type guard to check for non-string values in imports
- Throw descriptive error when conditional imports are encountered
- Update type signature to accept Record<string, string | object>
- Add test case for non-string imports error handling

This prevents TypeError when packages have conditional imports (e.g., #browser-preload in desktop-client)

Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com>

* [AI] Limit resolvePackageJsonPaths scope to packages directory

- Add packagesRoot constant to restrict path resolution
- Update while loop condition to only traverse within packages directory
- Add additional check to ensure candidate paths are under packages/
- Prevents resolution to repo root package.json for missing/deleted files

This ensures the validator only processes package.json files under packages/* and avoids accidentally targeting the monorepo root manifest.

Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com>
2026-04-14 07:40:36 +00:00