ts-evaluator

An interpreter for Typescript that can evaluate an arbitrary Node within a Typescript AST

MIT License

Downloads
1.9M
Stars
88
ts-evaluator - Latest Release

Published by wessberg about 1 year ago

  • feat: add TypeScript v5.1 support. Add support for newer JSDOM versions 6f06ef0
  • Merge pull request #14 from astahmer/chore/update-deps f7ade86
  • feat: add Typescript v[4.9.5 ; 5.1.6] support b699f23

https://github.com/wessberg/ts-evaluator/compare/v1.1.0...v1.2.0

ts-evaluator -

Published by wessberg almost 2 years ago

  • feat: add TypeScript v4.9 support 590293c

https://github.com/wessberg/ts-evaluator/compare/v1.0.7...v1.1.0

ts-evaluator -

Published by wessberg about 2 years ago

  • chore: add null-check 3b365dd
  • chore: update lock file deb1e34

https://github.com/wessberg/ts-evaluator/compare/v1.0.6...v1.0.7

ts-evaluator -

Published by wessberg about 2 years ago

  • feat: change error handling to a continuation function approach 8f7cfdb
  • test: add an additional test b67b873

https://github.com/wessberg/ts-evaluator/compare/v1.0.5...v1.0.6

ts-evaluator -

Published by wessberg over 2 years ago

  • fix: add null-check to avoid runtime exceptions under some circumstances on returned values d89671c

https://github.com/wessberg/ts-evaluator/compare/v1.0.4...v1.0.5

ts-evaluator -

Published by wessberg over 2 years ago

  • feat: add 'ModuleOverrides' option. e121d66

https://github.com/wessberg/ts-evaluator/compare/v1.0.3...v1.0.4

ts-evaluator -

Published by wessberg over 2 years ago

  • feat: make evaluating identifiers more robust 8436f68
  • feat: make behavior when not passing in a typechecker far more robust 5f6634f

https://github.com/wessberg/ts-evaluator/compare/v1.0.2...v1.0.3

ts-evaluator -

Published by wessberg over 2 years ago

  • feat: make passing in a typechecker optional and document its operation 3966d4b
  • chore: update lockfile 7e5078c

https://github.com/wessberg/ts-evaluator/compare/v1.0.1...v1.0.2

ts-evaluator -

Published by wessberg over 2 years ago

New Features

ts-evaluator is now based on ESM and requires Node v14.19.0 (BREAKING CHANGE)

Now that TypeScript v4.7 is out, it has finally received great support for ES modules in a Node.js environment that aligns with how it has been implemented across Node.js and browsers.

Because of this, now is a good time to make ts-evaluator a type: "module" package. However, it still provides a CommonJS fallback. If your codebase is still based on CommonJS, you should be fine. Please know however, that ts-evaluator requires an environment running Node v14.19.0 or newer going forward.

TypeScript v4.7 support

ts-evaluator now supports TypeScript v4.7 and its new features.

New presets: NODE_CJS and NODE_ESM

Nowadays, Node.js files may either be based on CommonJS or ES Modules, and depending on which it is, the execution environment has some differences. For example, in a CommonJS based Node.js file, globals like require, __dirname, and __filename is available, whereas import.meta is available in an ES Module based Node.js file.

To reflect this, two new Lexical Environment presets have been added to ts-evaluator:

  • NODE_CJS - An alias for NODE.
  • NODE_ESM - Assumes an ESM-based Node.js environment. This means that built-in modules such as fs and path can be resolved, and Node-specific globals such as process is present, as well as ones that are only present in an ESM-based Node.js environment, such as import.meta.

Support for evaluating new.target and import.meta

ts-evaluator can now handle new.target syntax, as well as import.meta syntax inside ES Modules.

https://github.com/wessberg/ts-evaluator/compare/v1.0.0...v1.0.1

ts-evaluator -

Published by wessberg over 2 years ago

  • feat: add TypeScript v4.7 support. Add new sponsor: scrubtheweb 1e91aab
  • feat: fix issues with ShorthandPropertyAssignments. Move jsdom and chalk to optional peer dependencies d963c22

https://github.com/wessberg/ts-evaluator/compare/v0.1.0...v0.2.0

ts-evaluator -

Published by wessberg over 3 years ago

  • chore(build): update tsconfig 64415e4
  • chore(build): update dependencies ecd7dc7
  • BREAKING CHANGE: rename package from @wessberg/ts-evaluator to ts-evaluator e2b221c
  • perf: remove runtime dependency on tslib 684fe07

https://github.com/wessberg/ts-evaluator/compare/v0.0.29...v0.1.0

ts-evaluator -

Published by wessberg over 3 years ago

  • feat(typescript): add support for TypeScript 4.3 a955f91

https://github.com/wessberg/ts-evaluator/compare/v0.0.28...v0.0.29

ts-evaluator -

Published by wessberg over 3 years ago

  • feat(typescript): add TypeScript 4.2 support e87b496

https://github.com/wessberg/ts-evaluator/compare/v0.0.27...v0.0.28

ts-evaluator -

Published by wessberg about 4 years ago

ts-evaluator -

Published by wessberg about 4 years ago

  • feat(logical assignment): add support for Logical Assignments 639bc5c
  • chore(build): move typings into devDependencies since these are not present in the declarations 12d0d24
  • test: run every test for every supported minor version of TypeScript to ensure stability across versions 64fba7d

https://github.com/wessberg/ts-evaluator/compare/v0.0.25...v0.0.26

ts-evaluator -

Published by wessberg over 4 years ago

  • test(github actions): setup Github Actions 3d106e0
  • feat: add support for TypeScript v3.8. Add support for passing a specific TypeScript version to the evaluate function. Remove dependency on deasync. Return a Promise when evaluating an await-expression. Disallow evaluating async iterators with the synchronous variant of evaluate c19e1cc

https://github.com/wessberg/ts-evaluator/compare/v0.0.24...v0.0.25

ts-evaluator -

Published by wessberg almost 5 years ago

  • chore(package): add FUNDING c96e892
  • chore(package): update scripts c62d3c0
  • feat(optional chaining): add support for optional chaining and nullish coalescing 7a79b34

https://github.com/wessberg/ts-evaluator/compare/v0.0.23...v0.0.24

ts-evaluator -

Published by wessberg about 5 years ago

  • chore(dependencies): bump dependencies 5a320ca
  • feat(deasync): make the deasync module an optional dependency since not all environments support it 814e2f8

https://github.com/wessberg/ts-evaluator/compare/v0.0.22...v0.0.23

ts-evaluator -

Published by wessberg about 5 years ago

  • chore(dependencies): add rollup as a devDependency a7ab05f
  • chore(dependencies): update dependencies 0f58aea

https://github.com/wessberg/ts-evaluator/compare/v0.0.21...v0.0.22

ts-evaluator -

Published by wessberg over 5 years ago