Skip to content

Commit

Permalink
release: 1.2.0 [skip ci]
Browse files Browse the repository at this point in the history
## [1.2.0](v1.1.0...v1.2.0) (2023-02-02)

#### ✨ Features

* `appendExtension` and `replaceExtensions` accept callbacks for advanced functionality ([618f4c3](618f4c3))
  • Loading branch information
Xunnamius committed Feb 2, 2023
1 parent e42f369 commit 3213cd3
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 57 deletions.
96 changes: 52 additions & 44 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,70 +4,78 @@ All notable changes to this project will be documented in this auto-generated
file. The format is based on [Conventional Commits][1];
this project adheres to [Semantic Versioning][2].

## [1.1.0][3] (2023-01-29)
## [1.2.0][3] (2023-02-02)

#### ✨ Features

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

### [1.0.1][5] (2023-01-28)
## [1.1.0][5] (2023-01-29)

#### ✨ Features

- **src:** use more aesthetically appealing output format ([7390e3a][6])

### [1.0.1][7] (2023-01-28)

#### 🪄 Fixes

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

#### ⚙️ Build System

- Reorganize output distributables ([cb4346d][7])
- Reorganize output distributables ([cb4346d][9])

## [1.0.0][8] (2023-01-27)
## [1.0.0][10] (2023-01-27)

#### ✨ Features

- Add drone ci test pipeline ([ae66e28][9])
- Add github action to lint and test ([dafd93f][10])
- Add support for exports ([32188ab][11])
- Add tests and update plugin version ([948baea][12])
- Automate package publishing ([2fd6c22][13])
- Handle ../ paths ([470b358][14])
- Skip type-only imports and exports ([49fdd96][15])
- Support ExportAllDeclaration ([8a39cf6][16])
- Add drone ci test pipeline ([ae66e28][11])
- Add github action to lint and test ([dafd93f][12])
- Add support for exports ([32188ab][13])
- Add tests and update plugin version ([948baea][14])
- Automate package publishing ([2fd6c22][15])
- Handle ../ paths ([470b358][16])
- Skip type-only imports and exports ([49fdd96][17])
- Support ExportAllDeclaration ([8a39cf6][18])

#### 🪄 Fixes

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

#### ⚙️ Build System

- **readme:** update maintenance badge ([4d47b6e][23])
- Update tooling ([74a87dd][24])
- **readme:** update maintenance badge ([4d47b6e][25])
- Update tooling ([74a87dd][26])

[1]: https://conventionalcommits.org
[2]: https://semver.org
[3]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.1...v1.1.0
[4]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/7390e3adfea60a3ff0dc03b23f01d15467bc0ef2
[5]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.0...v1.0.1
[6]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/70e405373905799a7cc565d841f585fe87f12a26
[7]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/cb4346dc02e9df632acf7ac734f85c5c76c6d51d
[8]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/32188ab1317f1936e364d98658ff915f5d4dafd3...v1.0.0
[9]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/ae66e28d2ff61c1207bfa65c37a6541031c9504d
[10]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/dafd93fd33a5aab03734e64619ec84161ac42d73
[11]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/32188ab1317f1936e364d98658ff915f5d4dafd3
[12]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/948baeab189090375faf956397c370b62abc555a
[13]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/2fd6c22cf181baa83e8c6eac2fbdd6653f57b423
[14]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/470b358a0d749c1cee3ab0f3f5b649d3f05490ed
[15]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/49fdd9684668b8437bd11c4c5f03b40c1af50acd
[16]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/8a39cf60884d430c70be94183e70d11e25bb4ecd
[17]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/054921ee3cacd13a60a1837c4ab302310a5c1422
[18]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/0609c3524352763f743f9d3994f9e22847c28971
[19]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/db0f337812e99cfd58c56d5f1fe3a320e60892e7
[20]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/99668ab304703adcb329b60ff3ef29a88f5d3aad
[21]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/1c2c16f27e37a8376acd50799f07e8ae00e88d73
[22]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/3aa9d12066bd8469beee641a9d79007bacc1dd41
[23]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/4d47b6e0b2e9892aa563a525ed61e9a5087c59bf
[24]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/74a87ddcaeb6a3fae6ebeb0376910e1ad4408784
[3]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.1.0...v1.2.0
[4]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/618f4c3a161b526b09bcb5ba5f0eee81058a75bd
[5]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.1...v1.1.0
[6]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/7390e3adfea60a3ff0dc03b23f01d15467bc0ef2
[7]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/v1.0.0...v1.0.1
[8]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/70e405373905799a7cc565d841f585fe87f12a26
[9]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/cb4346dc02e9df632acf7ac734f85c5c76c6d51d
[10]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/compare/32188ab1317f1936e364d98658ff915f5d4dafd3...v1.0.0
[11]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/ae66e28d2ff61c1207bfa65c37a6541031c9504d
[12]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/dafd93fd33a5aab03734e64619ec84161ac42d73
[13]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/32188ab1317f1936e364d98658ff915f5d4dafd3
[14]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/948baeab189090375faf956397c370b62abc555a
[15]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/2fd6c22cf181baa83e8c6eac2fbdd6653f57b423
[16]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/470b358a0d749c1cee3ab0f3f5b649d3f05490ed
[17]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/49fdd9684668b8437bd11c4c5f03b40c1af50acd
[18]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/8a39cf60884d430c70be94183e70d11e25bb4ecd
[19]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/054921ee3cacd13a60a1837c4ab302310a5c1422
[20]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/0609c3524352763f743f9d3994f9e22847c28971
[21]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/db0f337812e99cfd58c56d5f1fe3a320e60892e7
[22]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/99668ab304703adcb329b60ff3ef29a88f5d3aad
[23]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/1c2c16f27e37a8376acd50799f07e8ae00e88d73
[24]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/3aa9d12066bd8469beee641a9d79007bacc1dd41
[25]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/4d47b6e0b2e9892aa563a525ed61e9a5087c59bf
[26]: https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/commit/74a87ddcaeb6a3fae6ebeb0376910e1ad4408784
62 changes: 52 additions & 10 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ babel-plugin-transform-rewrite-imports

### Type Aliases

- [Callback](README.md#callback)
- [Options](README.md#options)

### Variables
Expand All @@ -18,44 +19,85 @@ babel-plugin-transform-rewrite-imports

## Type Aliases

### Callback

Ƭ **Callback**<`ReturnType`\>: (`context`: { `capturingGroups`: `string`[] ; `specifier`: `string` }) => `ReturnType`

#### Type parameters

| Name |
| :------ |
| `ReturnType` |

#### Type declaration

▸ (`context`): `ReturnType`

A callback function provided as a value to `Options.appendExtension` or to an
entry in `Options.replaceExtensions`.

##### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `context` | `Object` | - |
| `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. |
| `context.specifier` | `string` | The import/export specifier being evaluated by babel. |

##### Returns

`ReturnType`

#### Defined in

[index.ts:15](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/e42f369/src/index.ts#L15)

___

### Options

Ƭ **Options**: `Object`

The options that can be passed to this plugin from babel.

#### Type declaration

| Name | Type |
| :------ | :------ |
| `appendExtension?` | `string` |
| `recognizedExtensions?` | `string`[] |
| `replaceExtensions?` | `Record`<`string`, `string`\> |
| `silent?` | `boolean` |
| `verbose?` | `boolean` |
| Name | Type | Description |
| :------ | :------ | :------ |
| `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 |
| `recognizedExtensions?` | `string`[] | Members of this array will be considered a "recognized extension". **`Default`** defaultRecognizedExtensions |
| `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`** |
| `silent?` | `boolean` | If true, this plugin will generate no output. **`Default`** false |
| `verbose?` | `boolean` | If true, this plugin will generate more output than usual. **`Default`** false |

#### Defined in

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

## Variables

### defaultRecognizedExtensions

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

The default value of `Options.recognizedExtensions`.

#### Defined in

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

## Functions

### default

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

A babel plugin that reliably rewrites import (and export) specifiers.

#### Returns

`PluginObj`<`State`\>

#### Defined in

[index.ts:39](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/a50db17/src/index.ts#L39)
[index.ts:96](https://github.com/Xunnamius/babel-plugin-transform-rewrite-imports/blob/e42f369/src/index.ts#L96)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-transform-rewrite-imports",
"version": "1.1.0",
"version": "1.2.0",
"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.",
"keywords": [
"babel",
Expand Down

0 comments on commit 3213cd3

Please sign in to comment.