Put up fences around your TypeScript modules
Ivan Lesar
Posted on January 4, 2021
The author says it best...
"Good Fences is a tool that allows you to segment a TypeScript project into conceptual areas and manage dependencies between those areas."
https://github.com/smikula/good-fences
Define what you import or export between Typescript files, directories and subdirectories with tagged fence.json files.
{
"tags": [ "tagA", "tagB" ],
"exports": [
"index",
{
"modules": "sample_directory/*",
"accessibleTo": "tagX"
}
],
"imports": [
"tagC",
"tagD"
]
}
And the most important feature... a human readable log with errors.
Good-fences violation in src/foo.ts:
Import not allowed: src/bar.ts
Fence: src/fence.json
What are your goto tools? Have you stumbled upon anything new and added it to your arsenal? ðŸ§
💖 💪 🙅 🚩
Ivan Lesar
Posted on January 4, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.