Repository navigation
[scripts] Chore: Map the bare __tests__/utils alias to the index module only - #9482
Merged
Merged
Conversation
…le only
## Description
`update-tsconfig` maps `<pkg>/src/__tests__/utils` to every file matching
`src/__tests__/utils/*.{ts,tsx,mjs,jsx}`, and `Object.fromEntries` keeps the
last one. `packages/lexical/src/__tests__/utils` now also holds
`assertNodeType.ts` and `observedMutation.ts`, so the alias depends on glob
order. On the release runner, `update-packages` (run by `version.yml`)
rewrote `lexical/src/__tests__/utils` in `tsconfig.json` and
`tsconfig.test.json` to `assertNodeType.ts`. The unit tests and the test
typecheck then could not find `initializeUnitTest`, `createTestEditor` and
the other helpers exported by `index.tsx`.
The script now matches only `index.{ts,tsx,mjs,jsx}`, which is what every
alias on main already points to. Regenerating restores `index.tsx` in both
files.
## Test plan
### Before
CI on the v0.53.0 release branch:
```
TypeError: initializeUnitTest is not a function
Test Files 98 failed | 314 passed | 1 skipped (413)
Tests 414 failed | 8676 passed | 4 expected fail | 1 skipped (9095)
packages/lexical/src/__tests__/unit/LexicalEditorEmptyState.test.ts(10,9): error TS2305: Module '"lexical/src/__tests__/utils"' has no exported member 'createTestEditor'.
ERROR: "tsc" exited with 2.
```
### After
```
$ node scripts/update-tsconfig.mjs && git diff --stat origin/main -- tsconfig.json tsconfig.test.json packages/lexical-website/tsconfig.json
(no output: generated paths match main)
$ npx vitest --project unit --no-watch packages/lexical-mark/__tests__/unit/LexicalMarkNode.test.ts packages/lexical/src/__tests__/unit/CodeBlock.test.ts packages/lexical/src/__tests__/unit/HTMLCopyAndPaste.test.ts packages/lexical-playground/__tests__/unit/docSerialization.test.ts
Test Files 4 passed (4)
Tests 41 passed (41)
$ pnpm run tsc && pnpm run tsc-test
(both exit 0)
```
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zurfyx
requested review from
acywatson,
fantactuka,
ivailop7 and
potatowagon
as code owners
October 27, 2026 20:45
lexical
@lexical/a11y
@lexical/clipboard
@lexical/code
@lexical/code-core
@lexical/code-prism
@lexical/code-shiki
@lexical/compiler
@lexical/devtools-core
@lexical/dragon
@lexical/eslint-plugin
@lexical/extension
@lexical/fast-check
@lexical/file
@lexical/hashtag
@lexical/headless
@lexical/history
@lexical/html
@lexical/internal
@lexical/link
@lexical/list
@lexical/mark
@lexical/markdown
@lexical/mdast
@lexical/offset
@lexical/overflow
@lexical/plain-text
@lexical/react
@lexical/rich-text
@lexical/selection
@lexical/table
@lexical/tailwind
@lexical/text
@lexical/utils
@lexical/yjs
commit: |
etrepum
approved these changes
Oct 27, 2026
Merged
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
update-tsconfigmaps<pkg>/src/__tests__/utilsto every file matchingsrc/__tests__/utils/*.{ts,tsx,mjs,jsx}, andObject.fromEntrieskeeps thelast one.
packages/lexical/src/__tests__/utilsnow also holdsassertNodeType.tsandobservedMutation.ts, so the alias depends on globorder. On the release runner,
update-packages(run byversion.yml)rewrote
lexical/src/__tests__/utilsintsconfig.jsonandtsconfig.test.jsontoassertNodeType.ts. The unit tests and the testtypecheck then could not find
initializeUnitTest,createTestEditorandthe other helpers exported by
index.tsx.The script now matches only
index.{ts,tsx,mjs,jsx}, which is what everyalias on main already points to. Regenerating restores
index.tsxin bothfiles.
Test plan
Before
CI on the v0.53.0 release branch:
After