This repository has been archived by the owner on Jun 15, 2024. It is now read-only.
Releases: jordimarimon/ts-ast-parser
Releases · jordimarimon/ts-ast-parser
@ts-ast-parser/core@0.8.0
2024-03-14
Features
- Support for TypeScript
5.4
- Enable support for Node
21.x
🚨 Breaking Changes
- The type
ObjectLiteral
has been renamed toTypeLiteral
. The typePrimitiveType
has been renamed
toIntrinsicType
. 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 propertyformattedDiagnostics
. 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
2024-03-14
- Drop support for Node
16.x
and enable support for Node21.x
@ts-ast-parser/core@0.7.0
2024-01-22
Features
- Allow
null
orundefined
to be used as arguments in theis
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
2023-11-20
- Drop support for Node
16.x
Bug Fixes
- Remove unknown compiler option
suppressOutputPathCheck
@ts-ast-parser/core@0.6.2
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 likeimport type { Foo } from './foo.js'
was correctly reflected as
type only, but if instead we hadimport { type Foo } from './foo.js'
, this wasn't reflected as type only.
@ts-ast-parser/core@0.6.1
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
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 totext
- The renamed JSDoc field
text
can be astring
or an array depending on if it has inline tags or not.
@ts-ast-parser/comment@0.1.0
2023-10-01
Release of the first version of the package
v0.5.0
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 methodgetNamedElements()
it will return an array ofBindingElementNode[]
instead of an array ofNamedParameterElement[]
. This change has been done for consistency with the rest of the
library.
v0.4.0
2023-08-11
core
- 0.4.0
Features
- Reflect the output JS path of a given source file. Use the
getOuputPath()
method from theModuleNode
class. - Analyse an entire project with the new function
parseFromProject()
. - Skip the semantic diagnostic check with the
boolean
optionskipDiagnostics
. - 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 tosourcePath
. This renaming is needed because now there is also
available theoutputPath
field (the path where the JS file gets compiled). - All
parserFrom*
functions, now receive as second argument an object of typeAnalyserOptions
instead of
thets.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 anAnalyserResult<T>
object