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

Remove TypeScript peer dependency [Blocking latest release] #249

Closed
dsherret opened this issue Feb 12, 2018 · 2 comments
Closed

Remove TypeScript peer dependency [Blocking latest release] #249

dsherret opened this issue Feb 12, 2018 · 2 comments

Comments

@dsherret
Copy link
Owner

My pre-release automated scripts caught a bug that I was about to release in 6.13.0 (kind of cool).

The problem is this library is now implementing features that require a peer dependency of the latest TS version (ex. jsx fragments, strict property initialization). I tried to get around this by generating "compiler polyfills", but this doesn't exactly work because I use ts.SyntaxKind literals in the source. Anyway, as I progress this is going to become more and more of a problem.

The solution I see around this is to provide my own declaration file for the TypeScript compiler along with the library. This would only include the relevant information from the compiler.

@dsherret
Copy link
Owner Author

Enums like SyntaxKind and ScriptElementKind should be easily accessible like so:

import {SyntaxKind, ScriptElementKind} from "ts-simple-ast";

But typescript compiler node definitions will be within a ts namespace:

import {ts} from "ts-simple-ast";

const compilerEnumDec: ts.EnumDeclaration;

dsherret added a commit that referenced this issue Feb 14, 2018
BREAKING CHANGE: Access the TypeScript compiler via `import {ts} from "ts-simple-ast";`
* NewLineKind is now the TypeScript compiler's enum.
@dsherret
Copy link
Owner Author

Done. This will make the library much easier to use and I won't have to bother supporting multiple versions of the compiler.

If you find something missing on ts that you'd like then please let me know...

dsherret added a commit that referenced this issue May 14, 2019
BREAKING CHANGE: Access the TypeScript compiler via `import {ts} from "ts-simple-ast";`
* NewLineKind is now the TypeScript compiler's enum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant