Simplify Server Import Paths for Common Code #361
Closed
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.
What does this change do?
This change adds
index.ts
files to some directories in the common and server projects, allowing for many classes and types to be represented as exports from the directory path itself. This allows severalimport
statements to be consolidated into a single statement, which this change also addresses.This change also leverages the
paths
feature in the TypeScript configuration file to alias the../common/src/
path as@common
. This shortens the target path for the import statements while not obfuscating the desired import target. To yield runnable Javascript output files, thetsc-alias
package was added as a developer dependency. All build commands were updated to usetsc-alias
to convert the path aliases back to relative paths in the resulting distributables.tsc-alias
The
[email protected]
dependency introduces transitive dependencies:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
How was this change regression tested?
server
code was rebuilt usingnpm run build
, which did not report any errors.node ./dist/server/src/server.js
. The following output was observed.Server Output
tests
code was rebuilt usingnpm run build
, which did not report any errors.validateDefinitions
test was run usingnpm run validateDefinitions
, which did not report any errors.