Skip to content

Releases: typescript-nameof/nameof

TypeScript `nameof` v0.0.10

05 May 22:54
Compare
Choose a tag to compare

TypeScript nameof v0.0.10

Fixed

  • Woodpecker pipelines and publishing process

Show differences

TypeScript `nameof` v0.0.9

05 May 22:18
Compare
Choose a tag to compare

TypeScript nameof v0.0.9

Fixed

  • An error where expressions such as !function(){}() would cause compilations to fail (#11)
  • Thanks, @Ixonal for reporting!
  • Documentation to address the babel configuration properly
    Thanks, @philsherry for reporting

Updated

  • All dependencies
  • Improved performance (#6)
    Thanks, @lahma!
  • The plugin to skip parsing nodes unnecessarily
  • The README file in general

Show differences

TypeScript `nameof` v0.0.7

15 Sep 07:58
Compare
Choose a tag to compare

TypeScript nameof v0.0.7

Fixed

  • The nameof.typed function for optional properties
  • Non-functional unit tests

Updated

  • All dependencies

Show differences

TypeScript `nameof` v0.0.6

14 Sep 13:41
Compare
Choose a tag to compare

TypeScript nameof v0.0.6

Fixed

  • Language service plugin to improve accuracy of error messages

Updated

  • The IndexOutOfBoundError message to show proper bounds
  • Adapter to report errors for malformed, nested nameof calls
  • CI configuration to add .vsix files to future releases
  • All dependencies

Removed

  • Unnecessary files from vscode extension

Show differences

TypeScript `nameof` v0.0.5

13 Sep 18:58
Compare
Choose a tag to compare

TypeScript nameof v0.0.5

Fixed

  • Non-functioning vscode extension

Updated

  • All dependencies

Show differences

TypeScript `nameof` v0.0.4

13 Sep 17:42
Compare
Choose a tag to compare

TypeScript nameof v0.0.4

Added

  • A TypeScript Language Service plugin and a corresponding vscode extension to show nameof()-related issues in the IDE

Updated

  • The README file to include more reasonable examples

Show differences

TypeScript `nameof` v0.0.3

10 Sep 13:16
Compare
Choose a tag to compare

TypeScript nameof v0.0.3

Added

  • A function nameof.typed to get strictly typed key names
    What, you don't need such a thing!? idc, I do!

    Usage:

    nameof.typed<Console>().warn;
    // or
    nameof.typed(() => process).exit;
    // or
    nameof.typed((module: NodeJS.Module) => module.require).resolve;

Updated

  • All dependencies
  • Babel components for streamlining node transformation order

Show differences

TypeScript `nameof` v0.0.2

29 Aug 21:37
Compare
Choose a tag to compare

TypeScript nameof v0.0.2

Fixed

  • Type declaration collision by removing unnecessary dependency
  • Typos in the README files

Show differences

TypeScript `nameof` v0.0.1

28 Aug 11:32
Compare
Choose a tag to compare

TypeScript nameof v0.0.1

This is it! Words cannot describe how happy I am to be finally done rewriting the infamous, great ts-nameof project!
Not only does this release bring TypeScript v5 support but there are also tons of more features waiting for you.

Thanks to everyone who is showing interest in this project!

Let's head right into the...

Highlights

Drop-In Replacement

The type declaration and the API of the TypeScript nameof are completely compatible with ts-nameof.

If you used to transform your nameof calls using the ts-nameof project, all you need to do is replace ts-nameof and @types/ts-nameof with the packages of this project as described in the setup guide in the README.

Self-Contained Type Declarations

Up until now, type declarations for ts-nameof were hosted by the DefinitelyTyped project. However, this meant that the type declarations had to go through DefinitelyTyped's workflow for them to be updated.

For @typescript-nameof, these type declarations are hosted in this very repository and are thus always sure to be up-to-date with their corresponding version.

Less Strict Parsing

Previously, the whole expression passed to nameof was parsed and would cause errors if some part of the expression was unsupported.

The new @typescript-nameof implementations will only throw errors if the part that is necessary to get the (full) name is unsupported.

Following code used to cause errors but is supported now:

console.log(nameof((13 * 37).toFixed)); // Logs `toFixed`

One Package For Everything

The number of packages in this project has been minimized. You can now use a single package @typescript-nameof/babel both for the plugin-integration and macro-integration for Babel.js.

For all other purposes, all you need to install is @typescript-nameof/types and @typescript-nameof/nameof according to the setup guide in the README file.

Error Reporting

In the latest version of ts-nameof TypeScript compilers such as ts-patch and ttypescript would exit while watching files if an error related to nameof calls occurred.

Furthermore, the old implementation would only report the code causing an error without giving a hint on the line- or column number the non-functioning code is located at.

This issue is now fixed for ts-patch. Errors are now reported to ts-patch and thus displayed in your editor during watched compilations.

So far, @typescript-nameof supports error reporting for ts-patch and ts-jest which are the only ecosystems providing an API for reporting errors. Other ecosystems will print error messages and the corresponding file names, line- and column numbers to the console.

Solid Testing

Every tiniest aspect of the @typescript-nameof packages are proven to work by tons of unit tests.