-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from runem/refactor
Architectural improvements
- Loading branch information
Showing
230 changed files
with
109,006 additions
and
24,115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
out | ||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"env": { | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "prettier/@typescript-eslint"], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"no-console": "error", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/no-object-literal-type-assertion": "off", | ||
"@typescript-eslint/explicit-member-accessibility": "off", | ||
"@typescript-eslint/no-parameter-properties": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
"@typescript-eslint/interface-name-prefix": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/ban-types": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/prefer-interface": "off", | ||
"@typescript-eslint/no-empty-interface": "off", | ||
"no-dupe-class-members": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/) | ||
|
||
<!-- # Unreleased --> | ||
<!-- ### Added --> | ||
<!-- ### Changed --> | ||
<!-- ### Removed --> | ||
<!-- ### Fixed --> | ||
|
||
## [1.0.0] - 2019-12-01 | ||
|
||
### Added | ||
|
||
- Methods are now analyzed | ||
- `@private`, `@protected`, `@public` and `@access` jsdoc tags are now support ([#106](https://github.com/runem/web-component-analyzer/issues/106)), ([#126](https://github.com/runem/web-component-analyzer/issues/126)) ([#105](https://github.com/runem/web-component-analyzer/issues/105)) | ||
- It's now possible to choose if private and/or protected members should be included in the output using `--visibility protected` CLI option ([#112](https://github.com/runem/web-component-analyzer/issues/112)) | ||
- JSX typescript declaration files are now support (IntrinsicAttributes and IntrinsicElements) ([#116](https://github.com/runem/web-component-analyzer/issues/116)) | ||
- Support for extending HTMLElement with members using Typescript declaration files | ||
- A list of used mixins for a given component is now included in the markdown output | ||
- Support for the `@deprecated` jsdoc tag ([#103](https://github.com/runem/web-component-analyzer/issues/103)) | ||
- Support for specifying default css property values: `@cssproperty {Color} [--my-color=red]` | ||
- `default` is now included in the json format for attributes, properties and css custom properties | ||
- `deprecated` is now included in the json format for attributes, properties and events ([#103](https://github.com/runem/web-component-analyzer/issues/103)) | ||
- The library ships with different module formats `esm` and `cjs` split in two modules `api` and `cli`. This makes it possible to use WCA in the browser ([#118](https://github.com/runem/web-component-analyzer/issues/118)) | ||
- It's now possible to specify which featues should be analyzed | ||
- Emitted members now include metadata that flavors can add (eg. LitElement specific metadata) | ||
- Examples added using the `@example` jsdoc tag will be included in the markdown format. | ||
- Getter are now also analyzed, making it possible to emit `readonly` properties. | ||
- Support for the `@readonly` jsdoc tag | ||
- Support `@param` and `@returns` jsdoc tags | ||
- Support `@ignore` jsdoc tag | ||
- Add new flag to the CLI called `--outFiles`. This flag can take special values such as {dir}, {tagname} and {filename}. Read `--help` to learn more. | ||
- Add new flag to the CLI called `--dry` to test the analyzer without writing files. | ||
|
||
### Removed | ||
|
||
- It's no longer possible to emit diagnostics using the CLI | ||
- `jsDoc` has been removed from the json format | ||
|
||
### Fixed | ||
|
||
- Big internal refactor, including adding a lot of tests | ||
- Improved merging of component features ([#101](https://github.com/runem/web-component-analyzer/issues/101)), ([#124](https://github.com/runem/web-component-analyzer/issues/124)) | ||
- Improved performance by using caching and lazy evaluation where appropriate | ||
- Improved support for `@type` jsdoc ([#67](https://github.com/runem/web-component-analyzer/issues/67)) | ||
- Improved jsdoc tag parsing. Default notation like `@attr {string} [my-attr=123]` is now supported | ||
- Using an object literal as `default` value no longer truncates to the first letter ([#102](https://github.com/runem/web-component-analyzer/issues/102)) | ||
- Fixed problems with some default values ([#130](https://github.com/runem/web-component-analyzer/issues/130)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# The architecture | ||
|
||
This is an overview of the architecture. When analyzing a file, the analyzer goes through these steps using `flavors` to find components and features. | ||
|
||
<img src="https://user-images.githubusercontent.com/5372940/69460288-09342080-0d74-11ea-822e-2194f986115d.png" /> | ||
|
||
# Flavors | ||
|
||
Each flavor finds features on components. Features can be "properties", "attributes", "slot", eg. Flavors can be toggled on/off, but all are run as default. | ||
|
||
# Analyzing and Merging | ||
|
||
Multiple features can be emitted per property (eg. if you have both a constructor assignment and a class field that reference the same property). Here are some highlights of feature merging. | ||
|
||
**Highlights:** | ||
|
||
- Each feature emitted is emitted with a priority (low, medium, high) | ||
- Features are sorted and merged from highest to lowest priority | ||
- For example, properties found in the constructor are "low" priority and class fields are "high" priority | ||
- A given field on a feature (such as `required`) prefers the value of the first non-undefined value found (after priority-sort) | ||
- In TS-file the type checker is preferred over the `@type` JSDoc. In JS-file the `@type` JSDoc is preferred over the type checker | ||
- In TS-file constructor assignments are not checked (this is more aligned with what Typescript does) | ||
- An attribute with same name as a property is always connected to the property (this might however be unwanted behavior in some cases) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/usr/bin/env node | ||
|
||
require("./lib/index.cjs") | ||
require("./lib/cjs/cli.js") | ||
.cli() | ||
// eslint-disable-next-line no-console | ||
.catch(console.log); |
Oops, something went wrong.