@pob/codemods 0.9.4 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/bin/migrate.mjs +5 -1
- package/lib/transforms/jest-to-node-runner.cjs +6 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.10.1](https://github.com/christophehurpeau/pob/compare/@pob/codemods@0.10.0...@pob/codemods@0.10.1) (2025-08-24)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* exclude node_modules from glob search in migrate script for improved file matching ([46b951d](https://github.com/christophehurpeau/pob/commit/46b951dcfd953e7300c2214c25d208a5b27c2be0))
|
|
11
|
+
|
|
12
|
+
## [0.10.0](https://github.com/christophehurpeau/pob/compare/@pob/codemods@0.9.4...@pob/codemods@0.10.0) (2025-08-24)
|
|
13
|
+
|
|
14
|
+
### ⚠ BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* drop node 20
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* drop node 20 ([bb57350](https://github.com/christophehurpeau/pob/commit/bb573502c71f7316a54b4ce75203c05c0ba2e681))
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* enhance warning for unsupported expect properties in jest-to-node-runner transform ([f297134](https://github.com/christophehurpeau/pob/commit/f29713468a8fa7dcdf44b104f336d511b461e6bd))
|
|
25
|
+
* properly import before instead of beforeAll ([9c5fbd1](https://github.com/christophehurpeau/pob/commit/9c5fbd171ad9f9a39adc06f0f3a53ba9fbec4fdb))
|
|
26
|
+
|
|
6
27
|
## [0.9.4](https://github.com/christophehurpeau/pob/compare/@pob/codemods@0.9.3...@pob/codemods@0.9.4) (2025-08-23)
|
|
7
28
|
|
|
8
29
|
Note: no notable changes
|
package/bin/migrate.mjs
CHANGED
|
@@ -25,7 +25,11 @@ if (!transformerName || !globPaths) {
|
|
|
25
25
|
const transformPath = fileURLToPath(
|
|
26
26
|
new URL(`../lib/transforms/${transformerName}.cjs`, import.meta.url),
|
|
27
27
|
);
|
|
28
|
-
const paths = await Array.fromAsync(
|
|
28
|
+
const paths = await Array.fromAsync(
|
|
29
|
+
glob(globPaths, {
|
|
30
|
+
exclude: ["**/node_modules/**"],
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
29
33
|
|
|
30
34
|
if (paths.length === 0) {
|
|
31
35
|
throw new Error(`No files found matching ${globPaths}`);
|
|
@@ -52,12 +52,10 @@ module.exports = (file, api, options) => {
|
|
|
52
52
|
})
|
|
53
53
|
.replaceWith((p) => {
|
|
54
54
|
const { value } = p;
|
|
55
|
-
|
|
55
|
+
const replaceValue = jestToNodeGlobalMethods[value.callee.name];
|
|
56
|
+
topLevelMethodsUsed.add(replaceValue);
|
|
56
57
|
|
|
57
|
-
return j.callExpression(
|
|
58
|
-
j.identifier(jestToNodeGlobalMethods[value.callee.name]),
|
|
59
|
-
value.arguments,
|
|
60
|
-
);
|
|
58
|
+
return j.callExpression(j.identifier(replaceValue), value.arguments);
|
|
61
59
|
});
|
|
62
60
|
|
|
63
61
|
if (topLevelMethodsUsed.size > 0) {
|
|
@@ -95,7 +93,9 @@ module.exports = (file, api, options) => {
|
|
|
95
93
|
}
|
|
96
94
|
|
|
97
95
|
if (!propertiesMap[propertyName]) {
|
|
98
|
-
console.warn(
|
|
96
|
+
console.warn(
|
|
97
|
+
`Unsupported expect property: ${propertyName} in ${file.path}`,
|
|
98
|
+
);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pob/codemods",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "codemods for pob",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Christophe Hurpeau <302891+christophehurpeau@users.noreply.github.com> (https://christophe.hurpeau.com)",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"homepage": "https://github.com/christophehurpeau/pob",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": ">=22.
|
|
16
|
+
"node": ">=22.18.0"
|
|
17
17
|
},
|
|
18
18
|
"bin": {
|
|
19
19
|
"pob-migrate": "./bin/migrate.mjs"
|