This repository was archived by the owner on Aug 16, 2022. It is now read-only.
PR: Transform Export Declarations #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
✨ Features
TrextOptions#mandatoryto toggle mandatory file extensionsTrextel#ExportAllDeclarationandTrextel#ExportNamedDeclarationto transform export declarationsTrextel.getCodeto pull source code values fromTrextNodePathobjectsTrextNodeTypeandTrextNodetype definitions♻️ Code Improvements
Trextel.transformto handleExportAllDeclarationandExportNamedDeclarationnodesTrextNodePathto useTrextNode📖 Documentation
🔨 Build
pluginsandutilsto package entry point (and consequently bundle output)Tests
PASS trext src/plugins/__tests__/trextel.plugin.spec.ts unit:plugins/Trextel .getCode ✓ should return @flex-development/trext given CallExpression with 1 argument (3 ms) ✓ should return undefined given ExportNamedDeclaration without source ✓ should return ./imported.js given ImportDeclaration with source get plugin ✓ should return plugin object (1 ms) get visitor ✓ should return #CallExpression and #ImportDeclaration PASS trext src/plugins/__tests__/trextel.plugin.functional.spec.ts functional:plugins/Trextel #CallExpression ✓ should add extension to relative require statement (2 ms) ✓ should change extension in relative require statement (1 ms) ✓ should not change extension in absolute require statement (1 ms) ✓ should not change extension if require is not string literal ✓ should not ignore require statement if require is partial dirix (1 ms) ✓ should ignore require statement if require is partial dirix and file extensions are not mandatory (1 ms) ✓ should not ignore require statement if require is full dirix (1 ms) #ExportAllDeclaration ✓ should add extension to relative export all declaration (1 ms) ✓ should change extension in relative export all declaration (1 ms) ✓ should not change extension in absolute import ✓ should not ignore export all declaration if export is partial dirix (1 ms) ✓ should ignore export all declaration if export is partial dirix and file extensions are not mandatory ✓ should not ignore export all declaration if export is full dirix (5 ms) #ExportNamedDeclaration ✓ should add extension to relative named export declaration (1 ms) ✓ should change extension in relative named export declaration (1 ms) ✓ should not change extension in absolute named export ✓ should not ignore named export declaration if export is partial dirix (1 ms) ✓ should ignore named export declaration if export is partial dirix and file extensions are not mandatory ✓ should not ignore named export declaration if export is full dirix (1 ms) #ImportDeclaration ✓ should add extension to relative import declaration ✓ should change extension in relative import declaration (1 ms) ✓ should not change extension in absolute import ✓ should not ignore import declaration if import is partial dirix (1 ms) ✓ should ignore import declaration if import is partial dirix and file extensions are not mandatory (1 ms) ✓ should not ignore import declaration if import is full dirix Test Suites: 2 passed, 2 total Tests: 30 passed, 30 total Snapshots: 0 total Time: 2.802 s Ran all test suites matching /trextel/i.Additional context
Linked issues
None
Submission checklist
PR:(e.g:PR: User authentication)Update index.md)next