This repository has been archived by the owner on Aug 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: transform export declarations (#5)
* refactor(typescript): `TrextNodePath` add ExportAllDeclaration and ExportNamedDeclaration as TrextNodePath#node types * feat(plugins): `Trextel#ExportAllDeclaration` * feat(typescript): `TrextNodeType`, `TrextNode` * feat: `TrextOptions#mandatory` * feat(plugins): `Trextel#ExportNamedDeclaration` * feat(plugins): `Trextel.getCode` * docs: mandatory file extensions * build: export `plugins` and `utils` from package entry point
- Loading branch information
1 parent
4d1f246
commit f937db0
Showing
20 changed files
with
568 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Hub } from '@babel/traverse' | ||
|
||
/** | ||
* @file Test Fixture - Hub | ||
* @module tests/fixtures/Hub | ||
*/ | ||
|
||
export default new Hub() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { program } from '@babel/types' | ||
|
||
/** | ||
* @file Test Fixture - program | ||
* @module tests/fixtures/program | ||
*/ | ||
|
||
export default program([]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { TrextOptions } from '@flex-development/trext' | ||
import { trext } from '@flex-development/trext' | ||
import { inspect } from 'util' | ||
|
||
/** | ||
* @file Examples - Disabling Mandatory File Extensions (By Node) | ||
* @module docs/examples/mandatory-by-node | ||
*/ | ||
|
||
const TREXT_OPTIONS: TrextOptions<'js', 'mjs'> = { | ||
from: 'js', | ||
mandatory: { | ||
call: false, | ||
exportAll: true, | ||
exportNamed: false, | ||
import: true | ||
}, | ||
pattern: /.js$/, | ||
to: 'mjs' | ||
} | ||
|
||
trext('mjs/', TREXT_OPTIONS) | ||
.then(results => console.info(inspect(results, false, null))) | ||
.catch(error => console.error(inspect(error, false, null))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { TrextOptions } from '@flex-development/trext' | ||
import { trext } from '@flex-development/trext' | ||
import { inspect } from 'util' | ||
|
||
/** | ||
* @file Examples - Disabling Mandatory File Extensions | ||
* @module docs/examples/mandatory | ||
*/ | ||
|
||
const TREXT_OPTIONS: TrextOptions<'js', 'mjs'> = { | ||
from: 'js', | ||
mandatory: false, | ||
pattern: /.js$/, | ||
to: 'mjs' | ||
} | ||
|
||
trext('esm/', TREXT_OPTIONS) | ||
.then(results => console.info(inspect(results, false, null))) | ||
.catch(error => console.error(inspect(error, false, null))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.