Releases: eps1lon/codemod-missing-await-act
v0.3.0
Minor Changes
-
#48
5898881
Thanks @eps1lon! - Add support for propagating through relative pathsThe import config (from
--import-config-path
) can now contain imports to absolute
paths prefixed as file URLs.
File URLs will be matched against relative imports.
Given this import configimport { render as render1 } from "file:///root/relative-paths/utils.js";
the import
import { render } from './utils'
in/root/index.test.js
will be
considered as newly async and each call ofrender
will be awaited. -
#49
00f35d5
Thanks @eps1lon! - Summarize follow-up items when codemod finishedWhen newly async functions are exported, the codemod will not automatically update
all references.
However, we now summarize at the end which files are impacted and generate an import
config that can be used to update the remaining references if these are imported
via relative imports.
However, if these exports are imported via package specifiers or other path aliases,
users need to manually adjust the import sources which is explained in the README.
Patch Changes
-
#26
c74e8af
Thanks @eps1lon! - Ensure different import configs can be used during module lifetime -
#32
eaefca3
Thanks @eps1lon! - Update Node.js support matrixCodemod officially supports all currently Node.js versions listed in https://nodejs.org/en/about/previous-releases#release-schedule.
-
#30
25492dd
Thanks @eps1lon! - Add support for files using import assertionsE.g.
import manifest from './package.json' assert { type: 'json' }
v0.2.0
Minor Changes
-
#20
b22e5ff
Thanks @eps1lon! - Codemod React Native Testing Library by default -
#14
408a664
Thanks @eps1lon! - Warn when a newly-async function is exportedThis codemod can only propagate newly async methods within a file.
Once a function is exported, we can't propagate that with a codemod.
We'll later add support for configuring detection mechanisms.
Once that is done, we'll instruct to rerun the codemod with updated configuration until no more warnings remain.
Patch Changes
-
#19
4608966
Thanks @eps1lon! - Skip.d.mts
filesWe already skiped
.d.ts
and.d.cts
. -
#15
3fd0c4e
Thanks @eps1lon! - Stop codemodding declaration files -
#12
8625705
Thanks @eps1lon! - Consider import aliasesPreviously, we didn't check if a call was from an import alias.
For example, givenimport { act as domAct } from '@testing-library/react'
, we didn't considerdomAct
to beasync
since we only looked for exports from@testing-library/dom
with the nameact
.
Now we properly map renames. -
#18
e844aba
Thanks @eps1lon! - Fix crash when import config used default imports -
#17
fc70a45
Thanks @eps1lon! - Warn on newly async if exported directE.g.
export function render() { act() }
used to not trigger warnings.
Only onexport { render }
.
Nowexport ...
correctly triggers a warning if the exported value is now an async function.