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

Automatically export all definitions from *.type.ts files #7

Open
1 of 2 tasks
parzhitsky opened this issue Oct 5, 2021 · 2 comments
Open
1 of 2 tasks

Automatically export all definitions from *.type.ts files #7

parzhitsky opened this issue Oct 5, 2021 · 2 comments
Labels
Change: patch [Issue / PR] describes a small non-breaking change, such as bugfix or an optimization Domain: meta [Issue / PR] describes change in the development process, documentation, maintenance etc. Pending: blocked [Issue / PR] cannot be addressed until another issue is resolved Priority: medium [Issue / PR] should be addressed without delay Type: improvement [Issue / PR] addresses lack of a functionality or an open possibility of enhancement

Comments

@parzhitsky
Copy link
Member

parzhitsky commented Oct 5, 2021

Currently, when another entity definition is added to a *.type.ts file, to re-export it through entry-point index.ts file it is necessary to reference this definition again via export { Entity } from "entity.type.ts"; statement:

export type Type1 = any;
+ export type Type2 = any;
export {
  Type1,
+ Type2,
} from "module.type.ts";

To comply to D.R.Y., the export statement should automatically pick up and re-export all definitions:

export * from "module.type.ts";

However, the latest version of TypeScript (4.4.x) preserves this export for type entities, causing runtime error due to these entities missing.

@parzhitsky parzhitsky added Change: patch [Issue / PR] describes a small non-breaking change, such as bugfix or an optimization Domain: meta [Issue / PR] describes change in the development process, documentation, maintenance etc. Pending: blocked [Issue / PR] cannot be addressed until another issue is resolved Priority: medium [Issue / PR] should be addressed without delay Type: improvement [Issue / PR] addresses lack of a functionality or an open possibility of enhancement labels Oct 5, 2021
@parzhitsky parzhitsky added Pending: blocked [Issue / PR] cannot be addressed until another issue is resolved and removed Pending: blocked [Issue / PR] cannot be addressed until another issue is resolved labels Jun 10, 2023
@parzhitsky
Copy link
Member Author

parzhitsky commented Jun 10, 2023

This is now achievable since TypeScript 5.0, but unless Virtual-Finland-Development/codesets updates to it from TypeScript 4.9, it is a breaking change for them.

@lsipii ^

@parzhitsky
Copy link
Member Author

By the way, @lsipii, huge thanks for using the library! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Change: patch [Issue / PR] describes a small non-breaking change, such as bugfix or an optimization Domain: meta [Issue / PR] describes change in the development process, documentation, maintenance etc. Pending: blocked [Issue / PR] cannot be addressed until another issue is resolved Priority: medium [Issue / PR] should be addressed without delay Type: improvement [Issue / PR] addresses lack of a functionality or an open possibility of enhancement
Projects
None yet
Development

No branches or pull requests

1 participant