Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Export types used in the public interface (#22) #51

Merged
merged 1 commit into from
Apr 16, 2019

Conversation

yokuze
Copy link
Contributor

@yokuze yokuze commented Apr 16, 2019

Any type (class, interface, literal type, etc) that's used by Lambda
Express' public API as a method return type, parameter type, or property
type must be exported on src/index.ts so that it's available to be
used in client code.

Any type (class, interface, literal type, etc) that's used by Lambda
Express' public API as a method return type, parameter type, or property
type must be exported on `src/index.ts` so that it's available to be
used in client code.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.356% when pulling 8097fef on yokuze:export_types_22 into b0545d8 on silvermine:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.356% when pulling 8097fef on yokuze:export_types_22 into b0545d8 on silvermine:master.

StringUnknownMap,
KeyValueStringObject,
StringArrayOfStringsMap,
} from '@silvermine/toolbox';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first glance, it may seem odd to just re-export types from '@silvermine/toolbox', but I did this for two reasons:

  1. If we don't, then we'd be forcing clients of lambda-express to depend on '@silvermine/toolbox' directly if they want access to those types.
  2. A client may already depend on '@silvermine/toolbox' in their code, but at a different version with a different API. This would allow them to use the types from '@silvermine/toolbox' that their version of lambda-express uses internally as needed, and the types from their version of '@silvermine/toolbox'.

@@ -9,3 +9,37 @@ export {
Response,
Router,
};

// We need to export only types that are used in public interfaces (e.g. those used in
Copy link
Contributor Author

@yokuze yokuze Apr 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I doubled-checked this list against the output from Microsoft's API Extractor tool to ensure that all of the types used in the public API are exported here, but I opened #49 to make considering integrating that tool a separate task. Integrating it will not be simple, and I'm not certain it will even completely meet our needs (it doesn't support literal type definitions, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants