Skip to content

Commit 3213cd3

Browse files
committed
release: 1.2.0 [skip ci]
## [1.2.0](v1.1.0...v1.2.0) (2023-02-02) #### ✨ Features * `appendExtension` and `replaceExtensions` accept callbacks for advanced functionality ([618f4c3](618f4c3))
1 parent e42f369 commit 3213cd3

File tree

4 files changed

+107
-57
lines changed

4 files changed

+107
-57
lines changed

Diff for: CHANGELOG.md

+52-44
Original file line numberDiff line numberDiff line change
@@ -4,70 +4,78 @@ 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.1.0][3] (2023-01-29)
7+
## [1.2.0][3] (2023-02-02)
88

99
#### ✨ Features
1010

11-
- **src:** use more aesthetically appealing output format ([7390e3a][4])
11+
- `appendExtension` and `replaceExtensions` accept callbacks for advanced functionality ([618f4c3][4])
1212

13-
### [1.0.1][5] (2023-01-28)
13+
## [1.1.0][5] (2023-01-29)
14+
15+
#### ✨ Features
16+
17+
- **src:** use more aesthetically appealing output format ([7390e3a][6])
18+
19+
### [1.0.1][7] (2023-01-28)
1420

1521
#### 🪄 Fixes
1622

17-
- Use console.log for output, retire debug log function, improve type usage ([70e4053][6])
23+
- Use console.log for output, retire debug log function, improve type usage ([70e4053][8])
1824

1925
#### ⚙️ Build System
2026

21-
- Reorganize output distributables ([cb4346d][7])
27+
- Reorganize output distributables ([cb4346d][9])
2228

23-
## [1.0.0][8] (2023-01-27)
29+
## [1.0.0][10] (2023-01-27)
2430

2531
#### ✨ Features
2632

27-
- Add drone ci test pipeline ([ae66e28][9])
28-
- Add github action to lint and test ([dafd93f][10])
29-
- Add support for exports ([32188ab][11])
30-
- Add tests and update plugin version ([948baea][12])
31-
- Automate package publishing ([2fd6c22][13])
32-
- Handle ../ paths ([470b358][14])
33-
- Skip type-only imports and exports ([49fdd96][15])
34-
- Support ExportAllDeclaration ([8a39cf6][16])
33+
- Add drone ci test pipeline ([ae66e28][11])
34+
- Add github action to lint and test ([dafd93f][12])
35+
- Add support for exports ([32188ab][13])
36+
- Add tests and update plugin version ([948baea][14])
37+
- Automate package publishing ([2fd6c22][15])
38+
- Handle ../ paths ([470b358][16])
39+
- Skip type-only imports and exports ([49fdd96][17])
40+
- Support ExportAllDeclaration ([8a39cf6][18])
3541

3642
#### 🪄 Fixes
3743

38-
- ✅replace "false" extension value to "undefined" for default value tests ([054921e][17])
39-
- 🐛replace extension properly ([0609c35][18])
40-
- Add linter(standardjs) ([db0f337][19])
41-
- Don't exclude relative paths ([99668ab][20])
42-
- Make drone use npm ci instead of npm install ([1c2c16f][21])
43-
- Missing import ([3aa9d12][22])
44+
- ✅replace "false" extension value to "undefined" for default value tests ([054921e][19])
45+
- 🐛replace extension properly ([0609c35][20])
46+
- Add linter(standardjs) ([db0f337][21])
47+
- Don't exclude relative paths ([99668ab][22])
48+
- Make drone use npm ci instead of npm install ([1c2c16f][23])
49+
- Missing import ([3aa9d12][24])
4450

4551
#### ⚙️ Build System
4652

47-
- **readme:** update maintenance badge ([4d47b6e][23])
48-
- Update tooling ([74a87dd][24])
53+
- **readme:** update maintenance badge ([4d47b6e][25])
54+
- Update tooling ([74a87dd][26])
4955

5056
[1]: https://conventionalcommits.org
5157
[2]: https://semver.org
52-
[3]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.1...v1.1.0
53-
[4]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/7390e3adfea60a3ff0dc03b23f01d15467bc0ef2
54-
[5]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.0...v1.0.1
55-
[6]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/70e405373905799a7cc565d841f585fe87f12a26
56-
[7]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/cb4346dc02e9df632acf7ac734f85c5c76c6d51d
57-
[8]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/32188ab1317f1936e364d98658ff915f5d4dafd3...v1.0.0
58-
[9]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/ae66e28d2ff61c1207bfa65c37a6541031c9504d
59-
[10]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/dafd93fd33a5aab03734e64619ec84161ac42d73
60-
[11]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/32188ab1317f1936e364d98658ff915f5d4dafd3
61-
[12]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/948baeab189090375faf956397c370b62abc555a
62-
[13]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/2fd6c22cf181baa83e8c6eac2fbdd6653f57b423
63-
[14]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/470b358a0d749c1cee3ab0f3f5b649d3f05490ed
64-
[15]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/49fdd9684668b8437bd11c4c5f03b40c1af50acd
65-
[16]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/8a39cf60884d430c70be94183e70d11e25bb4ecd
66-
[17]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/054921ee3cacd13a60a1837c4ab302310a5c1422
67-
[18]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/0609c3524352763f743f9d3994f9e22847c28971
68-
[19]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/db0f337812e99cfd58c56d5f1fe3a320e60892e7
69-
[20]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/99668ab304703adcb329b60ff3ef29a88f5d3aad
70-
[21]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/1c2c16f27e37a8376acd50799f07e8ae00e88d73
71-
[22]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/3aa9d12066bd8469beee641a9d79007bacc1dd41
72-
[23]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/4d47b6e0b2e9892aa563a525ed61e9a5087c59bf
73-
[24]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/74a87ddcaeb6a3fae6ebeb0376910e1ad4408784
58+
[3]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.1.0...v1.2.0
59+
[4]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/618f4c3a161b526b09bcb5ba5f0eee81058a75bd
60+
[5]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.1...v1.1.0
61+
[6]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/7390e3adfea60a3ff0dc03b23f01d15467bc0ef2
62+
[7]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.0...v1.0.1
63+
[8]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/70e405373905799a7cc565d841f585fe87f12a26
64+
[9]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/cb4346dc02e9df632acf7ac734f85c5c76c6d51d
65+
[10]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/32188ab1317f1936e364d98658ff915f5d4dafd3...v1.0.0
66+
[11]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/ae66e28d2ff61c1207bfa65c37a6541031c9504d
67+
[12]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/dafd93fd33a5aab03734e64619ec84161ac42d73
68+
[13]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/32188ab1317f1936e364d98658ff915f5d4dafd3
69+
[14]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/948baeab189090375faf956397c370b62abc555a
70+
[15]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/2fd6c22cf181baa83e8c6eac2fbdd6653f57b423
71+
[16]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/470b358a0d749c1cee3ab0f3f5b649d3f05490ed
72+
[17]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/49fdd9684668b8437bd11c4c5f03b40c1af50acd
73+
[18]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/8a39cf60884d430c70be94183e70d11e25bb4ecd
74+
[19]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/054921ee3cacd13a60a1837c4ab302310a5c1422
75+
[20]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/0609c3524352763f743f9d3994f9e22847c28971
76+
[21]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/db0f337812e99cfd58c56d5f1fe3a320e60892e7
77+
[22]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/99668ab304703adcb329b60ff3ef29a88f5d3aad
78+
[23]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/1c2c16f27e37a8376acd50799f07e8ae00e88d73
79+
[24]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/3aa9d12066bd8469beee641a9d79007bacc1dd41
80+
[25]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/4d47b6e0b2e9892aa563a525ed61e9a5087c59bf
81+
[26]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/74a87ddcaeb6a3fae6ebeb0376910e1ad4408784

Diff for: docs/README.md

+52-10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ babel-plugin-transform-rewrite-imports
66

77
### Type Aliases
88

9+
- [Callback](README.md#callback)
910
- [Options](README.md#options)
1011

1112
### Variables
@@ -18,44 +19,85 @@ babel-plugin-transform-rewrite-imports
1819

1920
## Type Aliases
2021

22+
### Callback
23+
24+
Ƭ **Callback**<`ReturnType`\>: (`context`: { `capturingGroups`: `string`[] ; `specifier`: `string` }) => `ReturnType`
25+
26+
#### Type parameters
27+
28+
| Name |
29+
| :------ |
30+
| `ReturnType` |
31+
32+
#### Type declaration
33+
34+
▸ (`context`): `ReturnType`
35+
36+
A callback function provided as a value to `Options.appendExtension` or to an
37+
entry in `Options.replaceExtensions`.
38+
39+
##### Parameters
40+
41+
| Name | Type | Description |
42+
| :------ | :------ | :------ |
43+
| `context` | `Object` | - |
44+
| `context.capturingGroups` | `string`[] | An array of capturing groups returned by `String.prototype.match()` or an empty array if the matcher string was not a regular expression. |
45+
| `context.specifier` | `string` | The import/export specifier being evaluated by babel. |
46+
47+
##### Returns
48+
49+
`ReturnType`
50+
51+
#### Defined in
52+
53+
[index.ts:15](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/e42f369/src/index.ts#L15)
54+
55+
___
56+
2157
### Options
2258

2359
Ƭ **Options**: `Object`
2460

61+
The options that can be passed to this plugin from babel.
62+
2563
#### Type declaration
2664

27-
| Name | Type |
28-
| :------ | :------ |
29-
| `appendExtension?` | `string` |
30-
| `recognizedExtensions?` | `string`[] |
31-
| `replaceExtensions?` | `Record`<`string`, `string`\> |
32-
| `silent?` | `boolean` |
33-
| `verbose?` | `boolean` |
65+
| Name | Type | Description |
66+
| :------ | :------ | :------ |
67+
| `appendExtension?` | `string` \| [`Callback`](README.md#callback)<`string` \| `undefined`\> | This string will be appended to all relative import specifiers that do not already have a recognized extension. Also accepts a callback function for advanced use cases. **`Default`** undefined |
68+
| `recognizedExtensions?` | `string`[] | Members of this array will be considered a "recognized extension". **`Default`** defaultRecognizedExtensions |
69+
| `replaceExtensions?` | `Record`<`string`, `string` \| [`Callback`](README.md#callback)<`string`\>\> | Map of specifiers to their replacements. Specifiers can be strings or regular expressions (i.e. strings that start with ^ and/or end with $). If a specifier is a regular expression, capturing group notation can be used in the replacement. Replacements can either be a string or a callback function that returns a string. **`Default`** |
70+
| `silent?` | `boolean` | If true, this plugin will generate no output. **`Default`** false |
71+
| `verbose?` | `boolean` | If true, this plugin will generate more output than usual. **`Default`** false |
3472

3573
#### Defined in
3674

37-
[index.ts:10](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/a50db17/src/index.ts#L10)
75+
[index.ts:30](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/e42f369/src/index.ts#L30)
3876

3977
## Variables
4078

4179
### defaultRecognizedExtensions
4280

4381
`Const` **defaultRecognizedExtensions**: readonly [``".js"``, ``".jsx"``, ``".mjs"``, ``".cjs"``, ``".json"``]
4482

83+
The default value of `Options.recognizedExtensions`.
84+
4585
#### Defined in
4686

47-
[index.ts:29](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/a50db17/src/index.ts#L29)
87+
[index.ts:83](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/e42f369/src/index.ts#L83)
4888

4989
## Functions
5090

5191
### default
5292

5393
**default**(): `PluginObj`<`State`\>
5494

95+
A babel plugin that reliably rewrites import (and export) specifiers.
96+
5597
#### Returns
5698

5799
`PluginObj`<`State`\>
58100

59101
#### Defined in
60102

61-
[index.ts:39](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/a50db17/src/index.ts#L39)
103+
[index.ts:96](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/e42f369/src/index.ts#L96)

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.1.0",
3+
"version": "1.2.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)