Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Releases: jordimarimon/ts-ast-parser

@ts-ast-parser/core@0.8.0

14 Mar 18:10
Compare
Choose a tag to compare

2024-03-14

Features

  • Support for TypeScript 5.4
  • Enable support for Node 21.x

🚨 Breaking Changes

  • The type ObjectLiteral has been renamed to TypeLiteral. The type PrimitiveType has been renamed
    to IntrinsicType. This has been done for consistency with the TypeScript compiler and the ecosystem
    (other tools that also work with the TypeScript compiler API).
  • Now the returning value of the parsing functions won't include
    the property formattedDiagnostics. Instead, the analyser in a future release will provide some
    type of logging that will be disabled by default and will have
    different levels of logging.

@ts-ast-parser/comment@0.2.0

14 Mar 18:09
Compare
Choose a tag to compare

2024-03-14

  • Drop support for Node 16.x and enable support for Node 21.x

@ts-ast-parser/core@0.7.0

22 Jan 15:55
Compare
Choose a tag to compare

2024-01-22

Features

  • Allow null or undefined to be used as arguments in the is utility that is used to narrow types.

Bug Fixes

  • Fix the return type of TypeAliasNode.getValue().
  • Resolve symlinks to support pnpm's node_modules layout.

@ts-ast-parser/core@0.6.3

20 Nov 16:05
Compare
Choose a tag to compare

2023-11-20

  • Drop support for Node 16.x

Bug Fixes

  • Remove unknown compiler option suppressOutputPathCheck

@ts-ast-parser/core@0.6.2

25 Oct 17:54
Compare
Choose a tag to compare

2023-10-25

Bug Fixes

  • Correctly reflect import specifiers that are type only. Before only import clauses where checked for type only and
    import specifiers were ignored. Something like import type { Foo } from './foo.js' was correctly reflected as
    type only, but if instead we had import { type Foo } from './foo.js', this wasn't reflected as type only.

@ts-ast-parser/core@0.6.1

01 Oct 17:15
Compare
Choose a tag to compare

2023-10-01

Bug Fixes

  • Remove the extra spaces in the start of each line in the JSDoc comments

@ts-ast-parser/core@0.6.0

01 Oct 16:37
Compare
Choose a tag to compare

2023-10-01

Bug Fixes

  • Create require function for Node environments where it's not available by default

Features

  • Reflect module level JSDoc comments
  • Reflect inline tags in JSDoc comments

🚨 Breaking Changes

A JSDoc parser has been implemented from scratch to be able to reflect comments that
follow the JSDoc or TSDoc spec.

This means that there are breaking changes on how JSDoc comments are reflected.

For example:

/**
 * This is the description. To see more information go to {@link https://www.example.com | Example}
 * 
 * @param {Boolean} [param1=false] - Description of param1. To see more information go 
 * to {@link https://www.google.com | Google}
 * @param param2 - Description of param2
 */

Before, the above comment, was reflected like this:

{
    "jsDoc": [
        {
            "kind": "description",
            "value": "This is the description. To see more information go to {@link https://www.example.com | Example}"
        },
        {
            "kind": "param",
            "value": {
                "default": "false",
                "optional": true,
                "type": "Boolean",
                "name": "param1",
                "description": "Description of param1. To see more information go \nto {@link https://www.google.com | Google}"
            }
        },
        {
            "kind": "param",
            "value": {
                "name": "param2",
                "description": "Description of param2"
            }
        }
    ]
}

Now it gets reflected like this:

{
    "jsDoc": [
        {
            "kind": "description",
            "text": [
                {
                    "kind": "text",
                    "text": "This is the description. To see more information go to"
                },
                {
                    "kind": "link",
                    "target": "https://www.example.com",
                    "targetText": "Example"
                }
            ]
        },
        {
            "kind": "param",
            "name": "param1",
            "text": [
                {
                    "kind": "text",
                    "text": "Description of param1. To see more information go\nto"
                },
                {
                    "kind": "link",
                    "target": "https://www.google.com",
                    "targetText": "Google"
                }
            ],
            "type": "Boolean",
            "optional": true,
            "default": "false"
        },
        {
            "kind": "param",
            "name": "param2",
            "text": "Description of param2"
        }
    ]
}

Basically the changes are the following ones:

  • The JSDoc description field has been renamed to text
  • The renamed JSDoc field text can be a string or an array depending on if it has inline tags or not.

@ts-ast-parser/comment@0.1.0

01 Oct 16:38
Compare
Choose a tag to compare

2023-10-01

Release of the first version of the package

v0.5.0

16 Aug 18:38
Compare
Choose a tag to compare

2023-08-16

core - 0.5.0

Bug Fixes

  • Use / as the base path when parsing the command line options in an in-memory file system
  • Add missing exports

Features

  • The reflected information about the constraint in a type parameter has been improved
  • The information that gets reflected about types has been improved
  • The type arguments in the types inside a heritage clause are reflected
  • The AnalyserResult contains also the errors formatted in case it's needed to show them in a UI
  • You can add new files in a project after the analysis (using the ProjectNode API)
  • You can update the entire contents of an existing file after the analysis (using the ProjectNode API)

🚨 Breaking Changes

  • The return type of all the parseFrom* functions has been updated. It now returns the following:

    interface AnalyserResult {
      project: ProjectNode | null;
      errors: AnalyserError[];
      formattedDiagnostics?: string;
    }
  • Now in a ParameterNode when calling the method getNamedElements() it will return an array of BindingElementNode[]
    instead of an array of NamedParameterElement[]. This change has been done for consistency with the rest of the
    library.

v0.4.0

11 Aug 10:29
Compare
Choose a tag to compare

2023-08-11

core - 0.4.0

Features

  • Reflect the output JS path of a given source file. Use the getOuputPath() method from the ModuleNode class.
  • Analyse an entire project with the new function parseFromProject().
  • Skip the semantic diagnostic check with the boolean option skipDiagnostics.
  • Be able to use any parseFrom* function inside the browser.
  • Reflect more information about types.

Bug Fixes

  • Don't remove reexport nodes when searching for duplicate exports.

🚨 Breaking Changes

  • The field path of a module has been renamed to sourcePath. This renaming is needed because now there is also
    available the outputPath field (the path where the JS file gets compiled).
  • All parserFrom* functions, now receive as second argument an object of type AnalyserOptions instead of
    the ts.CompilerOptions.
  • All parserFrom* functions are now asynchronous and will return a promise.
  • The reflection object of a type has changed
  • All parserFrom* functions now return an AnalyserResult<T> object