Skip to content

feat(config): tsx, bundler resolution, verbatimModuleSyntax, noUncheckedIndexedAccess - #1693

Open
kalverra wants to merge 9 commits into
DX-5569/config-hygienefrom
DX-5569/dev-execution
Open

kalverra wants to merge 9 commits into
DX-5569/config-hygienefrom
DX-5569/dev-execution

Conversation

@kalverra

@kalverra kalverra commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Executes the remaining phases of the TS standards modernization plan (follow-up to #1688). Refs DX-5569. Plan: .agents/local/plans/update-ts-standards.md.

A3 — ts-node → tsx (+ ESM packaging)

  • All ts-node script invocations swapped to tsx; actions-dependencies-updater drops deprecated node --loader ts-node/esm.
  • "type": "module" on go-conditional-tests, go-mod-validator, update-action-versions; bundled CJS entrypoints renamed .cjs (dist/index.cjs, out/index.cjs) so node doesn't misread them as ESM. action.yaml main paths updated; dists rebuilt.
  • generate-gomod-fixtures.ts fixed for real ESM execution (default-import fs-extra, node:fs, import.meta.dirname).
  • Removed ts-node, @swc-node/register, @eslint/eslintrc devDeps.

B1 — Resolution + target

  • tsconfig.base.json: moduleResolution: "bundler", module: "esnext", target: "es2023"; deprecated baseUrl removed (paths made tsconfig-relative); ignoreDeprecations dropped from all 22 tsconfigs.
  • Exceptions: nx-chainlink (tsc → CJS dist) on nodenext/nodenext with explicit .js extensions ("type": "commonjs" keeps CJS emit); actions-dependencies-updater node16 → nodenext.

B2 — verbatimModuleSyntax

  • Enabled in base; esbuild/vite honor it. Mechanical import type fixes across actions/apps/libs, enforced by consistent-type-imports eslint rule (.mts now lint-covered). Types-only packages no longer load at runtime.

C1 — noUncheckedIndexedAccess

  • Enabled in base. ~50 reviewed null-handling fixes across adu, go-mod-validator, go-conditional-tests, update-action-versions, jira-tracing, signed-commits tests. Guards preserve behavior; malformed inputs now fail fast with clear errors instead of undefined propagation.

Deferred per plan: exactOptionalPropertyTypes (C2), ESM-first monorepo.

Validation

  • pnpm nx run-many -t build test lint 58/58 green after each phase.
  • Per-project tsc scratch typecheck: zero new errors vs baseline at every phase (all remaining errors are pre-existing latent — no tsc gate in CI).
  • Dist diffs audited line-by-line; smoke-runs of rebuilt actions (node dist/index.cjs) green; fixtures:gomods end-to-end; dists rebuilt and committed (covered by the pending dependency-modernization changeset).

Stack created with GitHub Stacks CLI • Give Feedback 💬

…pe:module packages

- Swap all ts-node script invocations to tsx (actions-dependencies-updater
  start drops deprecated node --loader ts-node/esm flag).
- Add "type": "module" to go-conditional-tests, go-mod-validator,
  update-action-versions; rename bundled CJS entrypoints to .cjs
  (dist/index.cjs, out/index.cjs) so node doesn't misread them as ESM.
  action.yaml main paths updated; dists rebuilt.
- Fix generate-gomod-fixtures.ts for real ESM execution: default-import
  fs-extra (named CJS re-exports not statically detectable), read/write
  from node:fs, import.meta.dirname.
- Remove ts-node, @swc-node/register, @eslint/eslintrc devDeps.
- Fix SC2155 shellcheck warnings in go-mod-validator test.sh.

Validation: nx run-many lint/test green; fixtures:gomods end-to-end run;
local/start scripts smoke-run; node dist/index.cjs smoke green.

Refs DX-5569
… drop ignoreDeprecations

- tsconfig.base.json: moduleResolution bundler + module esnext (matches
  esbuild semantics), target es2023. Remove deprecated baseUrl (TS5101
  under TS 6); paths made tsconfig-relative.
- Remove ignoreDeprecations "6.0" from all tsconfigs (node10 resolution
  and baseUrl deprecations gone with the switch).
- Exceptions:
  - libs/nx-chainlink (tsc -> CJS dist): module/moduleResolution nodenext;
    package "type": "commonjs" keeps CJS emit. Explicit .js extensions
    added to relative imports.
  - apps/actions-dependencies-updater: node16 -> nodenext (module +
    moduleResolution), target es2023; sources already use explicit .mjs
    extensions.
  - actions/*: standalone configs set esnext + bundler.
- Rebuilt dists: codeowners-review-analysis, gha-workflow-validator
  (es2022+ native class-field emit; behavior-identical).

Validation: nx run-many build/test/lint 58/58 green; per-project tsc
scratch typecheck vs baseline — zero new errors (all remaining are
pre-existing latent, no tsc gate in CI); nx-chainlink tsc dist still CJS;
dist smoke-runs green.

Refs DX-5569
- tsconfig.base.json: verbatimModuleSyntax true (B1 made this safe; esbuild
  and vite honor it).
- eslint.config.mjs: enforce @typescript-eslint/consistent-type-imports
  (separate-type-imports fixStyle, import() type annotations allowed);
  *.mts now covered by the TS lint blocks.
- Mechanical fixes across actions/apps/libs: type-only imports marked
  import type (types-only packages like @octokit/types no longer load at
  runtime under vite/vitest; esbuild no longer needs auto-elision).
- apps/actions-dependencies-updater: .mts sources and generated types use
  import type/export type.
- Remove fully unused 'import * as semver' in apidiff-go util.ts (verbatim
  semantics would otherwise preserve and bundle it).
- Signed-commits/apidiff-go/codeowners-review-analysis dists rebuilt
  (let->const and import cleanup; behavior-identical).

Validation: nx run-many build/test/lint 58/58 green; per-project tsc
scratch typecheck — zero new errors vs B1 baseline; dist diffs audited
line-by-line.

Refs DX-5569
…fixes

- tsconfig.base.json: noUncheckedIndexedAccess true.
- actions-dependencies-updater: guards for cache lookups (caches/github),
  tag parsing fallbacks (utils), extractDetailsFromActionIdentifier
  returns undefined for malformed identifiers instead of undefined
  fields, yaml file destructure guard, skip dependencies without pinned
  ref, ref params loosened where undefined already flowed at runtime.
- go-mod-validator: deps line-cache local capture, owner/repo defaults
  (guaranteed by depPrefix filter), git hunk header guard, cache
  lookups via undefined-check instead of 'in', getDefaultBranch throws
  clear error when default_branch missing, rest[0] fallback.
- go-conditional-tests: hash via Object.entries (no re-index), package
  line destructure with malformed-line skip, duplicate-check via local.
- update-action-versions: tag split defaults, action map entry guards,
  wm[file] ?? [] iteration.
- jira-tracing: changeset file capture with clear error when missing,
  first-issue guards.
- signed-commits: repo-tags test args optional chaining.
- Dists rebuilt for the three source-touched apps.

Validation: nx run-many build/test/lint 58/58 green; per-project tsc
scratch typecheck — all projects at or below pre-C1 baseline; each fix
reviewed for behavior preservation.

Refs DX-5569
@kalverra
kalverra added this pull request to stack #1694 October 8, 2026 19:45
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

💥 No Changeset

Latest commit: 4825144

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be included in a release's CHANGELOG, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

You can also use gocs to generate changeset files locally.

@kalverra kalverra changed the title DX 5569/dev execution feat(config): tsx, bundler resolution, verbatimModuleSyntax, noUncheckedIndexedAccess Oct 8, 2026
Prior dist in 9af18f5 was built before the prettier --write pass; rebuild
so committed artifacts match a fresh build (artifact-diff CI).

Refs DX-5569
Auto-fixed by local lefthook gofumpt hook (blank lines, func spacing,
EOF newlines).

Refs DX-5569
…push

- pre-commit: new code-lint command (eslint --fix then prettier --write on
  staged js/ts/mts files, dist/out excluded, auto-staged). Previously
  staged code files got no eslint or prettier fixes.
- prettier now invoked directly on staged files (pnpm prettier:write
  {staged_files} unioned with the script's repo-wide glob, formatting the
  whole tree every commit); glob extended to js/ts code files via
  code-lint.
- Fixers run sequentially before build-artifacts (was parallel: builds
  raced the fixers and committed stale dist bytes).
- build-artifacts and code-lint exclude dist/out bundles.
- New pre-push hook: pnpm test:affected (short, ~15s) gated on pushed
  code files.
- gitignore lefthook-local.yml (local extends, untracked).

Refs DX-5569
@kalverra
kalverra marked this pull request as ready for review October 8, 2026 20:16
@kalverra
kalverra requested a review from a team as a code owner October 8, 2026 20:16
@kalverra
kalverra force-pushed the DX-5569/dev-execution branch from 1ae50ed to 9312fef Compare October 8, 2026 20:53

@chainchad chainchad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each action that gets modified should get its own changeset - either a dedicated file or one changeset for all of the modified packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants