What changes did you make? List all distinct problems that this PR addresses. Explain any relevant
motivation or context.
Add barrel files
Change relative imports to absolute imports using module-alias
Changes
Barrel index.ts files on all folders that are imported
Barrel files themselves use regular relative imports including file name
All other imports use aliased barrel files (starting with @) even within the folder itself
New root level aliases.ts file programmatically adds aliases, this file is imported relatively
Also added to tsconfig.json to fix type hinting and jest.config.json because it uses its own aliases
Notes
Feedback and Event Validators have conflicting exports so they are currently unchanged
Because TypeScript already uses @types for special purposes, the alias for it is @customtypes
Tests folder has one alias with subfolders instead of having aliases for each subfolder for better organization and because some names collide
Similar thing with types folder for organization
The api/ subfolders each have their own alias due to their heavy usage
There are 3 points of entry: index.ts, ormconfig.ts, and Seeds.ts which each need to import the aliases because they are ran separately on different commands
Aliases are created programmatically rather than in package.json because build paths differ once it is compiled (untested)
Type of Change
[ ] Patch (non-breaking change/bugfix)
[ ] Minor (non-breaking change which adds functionality)
[ ] Major (fix or feature that would cause existing functionality to not work as
expected)
[ ] Documentation (A change to a README/description)
Thanks for contributing!
If you've made changes to the API's functionality, please make sure to bump the package
version—see this guide to semantic versioning for details—and
document those changes as appropriate.
Info
Closes #192.
Description
What changes did you make? List all distinct problems that this PR addresses. Explain any relevant motivation or context.
Changes
index.ts
files on all folders that are imported@
) even within the folder itselfaliases.ts
file programmatically adds aliases, this file is imported relativelytsconfig.json
to fix type hinting andjest.config.json
because it uses its own aliasesNotes
@types
for special purposes, the alias for it is@customtypes
api/
subfolders each have their own alias due to their heavy usageindex.ts
,ormconfig.ts
, andSeeds.ts
which each need to import the aliases because they are ran separately on different commandspackage.json
because build paths differ once it is compiled (untested)Type of Change
If you've selected Patch, Minor, or Major as your change type, make sure to bump the version before merging in
package.json
!Testing
I have tested that my changes fully resolve the linked issue ...
Checklist
package.json
file.Screenshots
Please include a screenshot of your Postman testing passing successfully.
Not sure if its necessary for this kind of change.