Skip to content

Commit c2615ed

Browse files
committed
release: 1.4.0 [skip ci]
## [1.4.0](v1.3.1...v1.4.0) (2024-10-28) #### ✨ Features * **src:** add support for `requireLikeFunctions` ([eafe348](eafe348)) #### 🪄 Fixes * **src:** use more robust specifier scanning for `CallExpression`s ([34eb5f4](34eb5f4))
1 parent cc466cb commit c2615ed

10 files changed

+129
-67
lines changed

Diff for: CHANGELOG.md

+71-58
Original file line numberDiff line numberDiff line change
@@ -4,99 +4,112 @@ All notable changes to this project will be documented in this auto-generated
44
file. The format is based on [Conventional Commits][1];
55
this project adheres to [Semantic Versioning][2].
66

7-
### [1.3.1][3] (2024-10-27)
7+
## [1.4.0][3] (2024-10-28)
8+
9+
#### ✨ Features
10+
11+
- **src:** add support for `requireLikeFunctions` ([eafe348][4])
12+
13+
#### 🪄 Fixes
14+
15+
- **src:** use more robust specifier scanning for `CallExpression`s ([34eb5f4][5])
16+
17+
### [1.3.1][6] (2024-10-27)
818

919
#### 🪄 Fixes
1020

11-
- Ensure debug output is consistent and meaningful ([19e1588][4])
21+
- Ensure debug output is consistent and meaningful ([19e1588][7])
1222

13-
## [1.3.0][5] (2024-10-27)
23+
## [1.3.0][8] (2024-10-27)
1424

1525
#### ✨ Features
1626

17-
- Make `filepath` available in replacer context and add support for `TSImportType` replacements ([0be1eda][6])
27+
- Make `filepath` available in replacer context and add support for `TSImportType` replacements ([0be1eda][9])
1828

1929
#### ⚙️ Build System
2030

21-
- **husky:** update commit hooks ([5719706][7])
31+
- **husky:** update commit hooks ([5719706][10])
2232

23-
## [1.2.0][8] (2023-02-02)
33+
## [1.2.0][11] (2023-02-02)
2434

2535
#### ✨ Features
2636

27-
- `appendExtension` and `replaceExtensions` accept callbacks for advanced functionality ([618f4c3][9])
37+
- `appendExtension` and `replaceExtensions` accept callbacks for advanced functionality ([618f4c3][12])
2838

29-
## [1.1.0][10] (2023-01-29)
39+
## [1.1.0][13] (2023-01-29)
3040

3141
#### ✨ Features
3242

33-
- **src:** use more aesthetically appealing output format ([7390e3a][11])
43+
- **src:** use more aesthetically appealing output format ([7390e3a][14])
3444

35-
### [1.0.1][12] (2023-01-28)
45+
### [1.0.1][15] (2023-01-28)
3646

3747
#### 🪄 Fixes
3848

39-
- Use console.log for output, retire debug log function, improve type usage ([70e4053][13])
49+
- Use console.log for output, retire debug log function, improve type usage ([70e4053][16])
4050

4151
#### ⚙️ Build System
4252

43-
- Reorganize output distributables ([cb4346d][14])
53+
- Reorganize output distributables ([cb4346d][17])
4454

45-
## [1.0.0][15] (2023-01-27)
55+
## [1.0.0][18] (2023-01-27)
4656

4757
#### ✨ Features
4858

49-
- Add drone ci test pipeline ([ae66e28][16])
50-
- Add github action to lint and test ([dafd93f][17])
51-
- Add support for exports ([32188ab][18])
52-
- Add tests and update plugin version ([948baea][19])
53-
- Automate package publishing ([2fd6c22][20])
54-
- Handle ../ paths ([470b358][21])
55-
- Skip type-only imports and exports ([49fdd96][22])
56-
- Support ExportAllDeclaration ([8a39cf6][23])
59+
- Add drone ci test pipeline ([ae66e28][19])
60+
- Add github action to lint and test ([dafd93f][20])
61+
- Add support for exports ([32188ab][21])
62+
- Add tests and update plugin version ([948baea][22])
63+
- Automate package publishing ([2fd6c22][23])
64+
- Handle ../ paths ([470b358][24])
65+
- Skip type-only imports and exports ([49fdd96][25])
66+
- Support ExportAllDeclaration ([8a39cf6][26])
5767

5868
#### 🪄 Fixes
5969

60-
- ✅replace "false" extension value to "undefined" for default value tests ([054921e][24])
61-
- 🐛replace extension properly ([0609c35][25])
62-
- Add linter(standardjs) ([db0f337][26])
63-
- Don't exclude relative paths ([99668ab][27])
64-
- Make drone use npm ci instead of npm install ([1c2c16f][28])
65-
- Missing import ([3aa9d12][29])
70+
- ✅replace "false" extension value to "undefined" for default value tests ([054921e][27])
71+
- 🐛replace extension properly ([0609c35][28])
72+
- Add linter(standardjs) ([db0f337][29])
73+
- Don't exclude relative paths ([99668ab][30])
74+
- Make drone use npm ci instead of npm install ([1c2c16f][31])
75+
- Missing import ([3aa9d12][32])
6676

6777
#### ⚙️ Build System
6878

69-
- **readme:** update maintenance badge ([4d47b6e][30])
70-
- Update tooling ([74a87dd][31])
79+
- **readme:** update maintenance badge ([4d47b6e][33])
80+
- Update tooling ([74a87dd][34])
7181

7282
[1]: https://conventionalcommits.org
7383
[2]: https://semver.org
74-
[3]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.3.0...v1.3.1
75-
[4]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/19e1588c04e6526fdd6fd5327755da13326abcaa
76-
[5]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.2.0...v1.3.0
77-
[6]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/0be1eda4a2b30709c0755c0ffd994f51ba295498
78-
[7]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/5719706662031be27d19e940d41b502973d329fa
79-
[8]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.1.0...v1.2.0
80-
[9]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/618f4c3a161b526b09bcb5ba5f0eee81058a75bd
81-
[10]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.1...v1.1.0
82-
[11]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/7390e3adfea60a3ff0dc03b23f01d15467bc0ef2
83-
[12]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.0...v1.0.1
84-
[13]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/70e405373905799a7cc565d841f585fe87f12a26
85-
[14]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/cb4346dc02e9df632acf7ac734f85c5c76c6d51d
86-
[15]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/32188ab1317f1936e364d98658ff915f5d4dafd3...v1.0.0
87-
[16]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/ae66e28d2ff61c1207bfa65c37a6541031c9504d
88-
[17]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/dafd93fd33a5aab03734e64619ec84161ac42d73
89-
[18]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/32188ab1317f1936e364d98658ff915f5d4dafd3
90-
[19]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/948baeab189090375faf956397c370b62abc555a
91-
[20]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/2fd6c22cf181baa83e8c6eac2fbdd6653f57b423
92-
[21]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/470b358a0d749c1cee3ab0f3f5b649d3f05490ed
93-
[22]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/49fdd9684668b8437bd11c4c5f03b40c1af50acd
94-
[23]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/8a39cf60884d430c70be94183e70d11e25bb4ecd
95-
[24]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/054921ee3cacd13a60a1837c4ab302310a5c1422
96-
[25]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/0609c3524352763f743f9d3994f9e22847c28971
97-
[26]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/db0f337812e99cfd58c56d5f1fe3a320e60892e7
98-
[27]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/99668ab304703adcb329b60ff3ef29a88f5d3aad
99-
[28]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/1c2c16f27e37a8376acd50799f07e8ae00e88d73
100-
[29]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/3aa9d12066bd8469beee641a9d79007bacc1dd41
101-
[30]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/4d47b6e0b2e9892aa563a525ed61e9a5087c59bf
102-
[31]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/74a87ddcaeb6a3fae6ebeb0376910e1ad4408784
84+
[3]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.3.1...v1.4.0
85+
[4]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/eafe34854380e6d047cf3e785a59a8da7630093a
86+
[5]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/34eb5f476d6ab5e523a705589f6f7579694a233a
87+
[6]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.3.0...v1.3.1
88+
[7]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/19e1588c04e6526fdd6fd5327755da13326abcaa
89+
[8]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.2.0...v1.3.0
90+
[9]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/0be1eda4a2b30709c0755c0ffd994f51ba295498
91+
[10]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/5719706662031be27d19e940d41b502973d329fa
92+
[11]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.1.0...v1.2.0
93+
[12]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/618f4c3a161b526b09bcb5ba5f0eee81058a75bd
94+
[13]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.1...v1.1.0
95+
[14]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/7390e3adfea60a3ff0dc03b23f01d15467bc0ef2
96+
[15]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.0...v1.0.1
97+
[16]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/70e405373905799a7cc565d841f585fe87f12a26
98+
[17]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/cb4346dc02e9df632acf7ac734f85c5c76c6d51d
99+
[18]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/32188ab1317f1936e364d98658ff915f5d4dafd3...v1.0.0
100+
[19]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/ae66e28d2ff61c1207bfa65c37a6541031c9504d
101+
[20]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/dafd93fd33a5aab03734e64619ec84161ac42d73
102+
[21]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/32188ab1317f1936e364d98658ff915f5d4dafd3
103+
[22]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/948baeab189090375faf956397c370b62abc555a
104+
[23]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/2fd6c22cf181baa83e8c6eac2fbdd6653f57b423
105+
[24]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/470b358a0d749c1cee3ab0f3f5b649d3f05490ed
106+
[25]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/49fdd9684668b8437bd11c4c5f03b40c1af50acd
107+
[26]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/8a39cf60884d430c70be94183e70d11e25bb4ecd
108+
[27]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/054921ee3cacd13a60a1837c4ab302310a5c1422
109+
[28]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/0609c3524352763f743f9d3994f9e22847c28971
110+
[29]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/db0f337812e99cfd58c56d5f1fe3a320e60892e7
111+
[30]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/99668ab304703adcb329b60ff3ef29a88f5d3aad
112+
[31]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/1c2c16f27e37a8376acd50799f07e8ae00e88d73
113+
[32]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/3aa9d12066bd8469beee641a9d79007bacc1dd41
114+
[33]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/4d47b6e0b2e9892aa563a525ed61e9a5087c59bf
115+
[34]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/74a87ddcaeb6a3fae6ebeb0376910e1ad4408784

Diff for: docs/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88

99
- [Callback](type-aliases/Callback.md)
1010
- [Options](type-aliases/Options.md)
11+
- [State](type-aliases/State.md)
1112

1213
## Variables
1314

1415
- [defaultRecognizedExtensions](variables/defaultRecognizedExtensions.md)
16+
- [defaultRequireLikeFunctions](variables/defaultRequireLikeFunctions.md)
1517

1618
## Functions
1719

Diff for: docs/functions/default.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
# Function: default()
88

9-
> **default**(): `PluginObj`\<`State`\>
9+
> **default**(): `PluginObj`\<[`State`](../type-aliases/State.md)\>
1010
1111
A babel plugin that reliably rewrites import (and export) specifiers.
1212

1313
## Returns
1414

15-
`PluginObj`\<`State`\>
15+
`PluginObj`\<[`State`](../type-aliases/State.md)\>
1616

1717
## Defined in
1818

19-
[index.ts:101](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/19e1588c04e6526fdd6fd5327755da13326abcaa/src/index.ts#L101)
19+
[index.ts:127](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/cc466cb56f228ce8aca09d6383b0447e1eb55e3d/src/index.ts#L127)

Diff for: docs/type-aliases/Callback.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ The import/export specifier being evaluated by Babel.
3939

4040
## Defined in
4141

42-
[index.ts:28](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/19e1588c04e6526fdd6fd5327755da13326abcaa/src/index.ts#L28)
42+
[index.ts:43](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/cc466cb56f228ce8aca09d6383b0447e1eb55e3d/src/index.ts#L43)

Diff for: docs/type-aliases/Options.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ function that returns a string.
5454
{}
5555
```
5656

57+
### requireLikeFunctions?
58+
59+
> `optional` **requireLikeFunctions**: `string`[]
60+
61+
Members of this array will be considered as "require-like functions," or
62+
functions that should be treated as if they were CJS `require(...)` (or ESM
63+
`import(...)`) functions. This is useful when, for instance, you want
64+
Jest's `jest.mock` and `jest.requireActual` functions to have their import
65+
specifiers transformed.
66+
67+
If not overridden, `requireLikeFunctions` defaults to
68+
[defaultRequireLikeFunctions](../variables/defaultRequireLikeFunctions.md).
69+
5770
### silent?
5871

5972
> `optional` **silent**: `boolean`
@@ -80,4 +93,4 @@ false
8093

8194
## Defined in
8295

83-
[index.ts:48](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/19e1588c04e6526fdd6fd5327755da13326abcaa/src/index.ts#L48)
96+
[index.ts:63](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/cc466cb56f228ce8aca09d6383b0447e1eb55e3d/src/index.ts#L63)

Diff for: docs/type-aliases/State.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[**babel-plugin-transform-rewrite-imports**](../README.md)**Docs**
2+
3+
***
4+
5+
[babel-plugin-transform-rewrite-imports](../README.md) / State
6+
7+
# Type Alias: State
8+
9+
> **State**: `PluginPass` & `object`
10+
11+
The shape of the internal state of the Babel plugin itself.
12+
13+
## Type declaration
14+
15+
### opts
16+
17+
> **opts**: [`Options`](Options.md)
18+
19+
## Defined in
20+
21+
[index.ts:37](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/cc466cb56f228ce8aca09d6383b0447e1eb55e3d/src/index.ts#L37)

Diff for: docs/variables/defaultRecognizedExtensions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ The default value of `Options.recognizedExtensions`.
1212

1313
## Defined in
1414

15-
[index.ts:90](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/19e1588c04e6526fdd6fd5327755da13326abcaa/src/index.ts#L90)
15+
[index.ts:116](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/cc466cb56f228ce8aca09d6383b0447e1eb55e3d/src/index.ts#L116)

Diff for: docs/variables/defaultRequireLikeFunctions.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[**babel-plugin-transform-rewrite-imports**](../README.md)**Docs**
2+
3+
***
4+
5+
[babel-plugin-transform-rewrite-imports](../README.md) / defaultRequireLikeFunctions
6+
7+
# Variable: defaultRequireLikeFunctions
8+
9+
> `const` **defaultRequireLikeFunctions**: readonly [`"require"`, `"require.resolve"`, `"System.import"`, `"jest.genMockFromModule"`, `"jest.mock"`, `"jest.unmock"`, `"jest.doMock"`, `"jest.dontMock"`, `"jest.requireActual"`]
10+
11+
## Defined in
12+
13+
[index.ts:13](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/cc466cb56f228ce8aca09d6383b0447e1eb55e3d/src/index.ts#L13)

Diff for: package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "babel-plugin-transform-rewrite-imports",
3-
"version": "1.3.1",
3+
"version": "1.4.0",
44
"description": "Add an extension to import specifiers that do not already have one, replace the extensions of those that do, or even rewrite specifiers entirely.",
55
"keywords": [
66
"babel",

0 commit comments

Comments
 (0)