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(build): generate TypeScript declaration file #31

Merged
merged 1 commit into from
Feb 10, 2019

Conversation

buschtoens
Copy link
Contributor

This PR extracts the flags definitions for the debug plugin into a separate file, so that a TypeScript declaration file can be generated from them in the prepack step, that is executed right before the addon is published to npm.

@buschtoens
Copy link
Contributor Author

buschtoens commented Jan 10, 2019

The generated index.d.ts looks like this:

export function gte(version: string): boolean;
export function lte(version: string): boolean;
export const HAS_UNDERSCORE_ACTIONS: boolean;
export const HAS_MODERN_FACTORY_INJECTIONS: boolean;
export const HAS_DESCRIPTOR_TRAP: boolean;
export const HAS_NATIVE_COMPUTED_GETTERS: boolean;
export const IS_GLIMMER_2: boolean;
export const IS_RECORD_DATA: boolean;
export const SUPPORTS_FACTORY_FOR: boolean;
export const SUPPORTS_GET_OWNER: boolean;
export const SUPPORTS_SET_OWNER: boolean;
export const SUPPORTS_NEW_COMPUTED: boolean;
export const SUPPORTS_INVERSE_BLOCK: boolean;
export const SUPPORTS_CLOSURE_ACTIONS: boolean;
export const SUPPORTS_UNIQ_BY_COMPUTED: boolean;

@pzuraq
Copy link
Collaborator

pzuraq commented Jan 16, 2019

Should the generated types be included? Or is that done only on publish?

@buschtoens
Copy link
Contributor Author

buschtoens commented Jan 16, 2019

I've added /index.d.ts to the .gitignore to avoid having out of date / mismatching types in the repo, that would get overridden during publishing, because someone forgot to run a script. 😄

@pzuraq pzuraq merged commit 9079c88 into ember-cli:master Feb 10, 2019
@buschtoens buschtoens deleted the feat/typescript-types branch February 12, 2019 08:18
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.

2 participants