Skip to content

Commit

Permalink
Merge pull request #112 from runem/1.2.0
Browse files Browse the repository at this point in the history
WIP: Performance improvements and more
  • Loading branch information
runem authored Jul 15, 2020
2 parents b7fe1b4 + 67da64b commit bb6ea6d
Show file tree
Hide file tree
Showing 210 changed files with 12,152 additions and 7,039 deletions.
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
out
lib
lib
dist
dev
28 changes: 20 additions & 8 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,51 @@
name: Main Workflow

on: [push, pull_request]
on:
pull_request:
push:
branches:
- master

jobs:
run:
name: Run

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-latest, ubuntu-latest]
node: [10, 12]

steps:
- name: Checkout code
uses: actions/checkout@master

- name: Set Node.js 10.x
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 10.x
node-version: ${{ matrix.node }}

- name: Install
run: npm ci

- name: Lint
run: npm run lint

- name: Build
run: npm run bootstrap
- name: Prettier
if: matrix.os == 'ubuntu-latest' && matrix.node == 12
run: npm run prettier:check

- name: Test
run: npm test
run: npm run test:all

- name: Package vscode plugin
run: npm run copylink && npx lerna run package --scope lit-plugin && mkdir vscode-lit-plugin && mv packages/vscode-lit-plugin/lit-plugin-*.vsix vscode-lit-plugin
if: matrix.os == 'ubuntu-latest' && matrix.node == 12
run: npx lerna run package --scope lit-plugin && mkdir vscode-lit-plugin && mv packages/vscode-lit-plugin/lit-plugin-*.vsix vscode-lit-plugin

- name: Upload artifacts
uses: actions/upload-artifact@master
if: matrix.os == 'ubuntu-latest' && matrix.node == 12
with:
name: vscode-lit-plugin
path: vscode-lit-plugin
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/.vsCode
.vscode
.idea
.editorconfig
node_modules
*.txt
*.tgz
*.log
todo.md
.DS_Store
lib
dist
Expand Down
82 changes: 72 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,76 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)

<!-- ### Added -->
<!-- ### Changed -->
<!-- ### Removed -->
<!-- ### Fixed -->

## [1.1.11] - 2020-05-21
## [1.2.0] - 15/7/2020

### Added

- Added new rule `no-property-visibility-mismatch`. This rule will ensure public properties use `@property` and non-public properties use `@internalProperty` ([#100](https://github.com/runem/lit-analyzer/pull/100))
- Added new rule `no-missing-element-type-definition` This rule will ensure that custom elements are registered on the
`HTMLElementTagNameMap` Typescript interface ([#73](https://github.com/runem/lit-analyzer/issues/73))
- It's now possible to configure how many modules deep dependencies are followed to determine whether a custom element is available in the current file. When `-1` is used, dependencies will be followed infinitely deep. This can be configured for both external dependencies and project dependencies with `maxNodeModuleImportDepth` & `maxProjectImportDepth` ([#116](https://github.com/runem/lit-analyzer/pull/116))
- In addition to extending `HTMLElementTagNameMap` it's now also possible extend the `HTMLElementEventMap` interface and the `HTMLElement` interface ([#53](https://github.com/runem/lit-analyzer/issues/53))

**Example:**

```
declare global {
interface HTMLElementTagNameMap {
"my-element": HTMLElement;
}
interface HTMLElementEventMap {
"my-event": Event;
}
}
/**
* @attr my-attr
*/
interface HTMLElement {
myProperty: string;
}
```

- Added autocompletion for CSS shadow parts and CSS custom properties in CSS. It's possible to document those using JSDoc ([dd1ffc78](https://github.com/runem/lit-analyzer/pull/112/commits/dd1ffc78d4fb6ccbe49b7cf91c11ba02d8b0dfa5))
- The [role](https://www.w3.org/TR/role-attribute/) and [controlslist](https://wicg.github.io/controls-list/html-output/multipage/embedded-content.html#attr-media-controlslist) attributes are now correctly type checked ([#89](https://github.com/runem/lit-analyzer/issues/89))

**Example:**

```
/**
* @cssprop {Color} --border-color - Sets the color of the border
* @csspart content - The content of my element
*/
class MyElement extends HTMLElement {
}
```

### Fixed and changed

- Quick fix for missing imports now generates correct path on Windows ([#110](https://github.com/runem/lit-analyzer/pull/110))
- **Type checking is now up to 15 times faster**
- `is-assignable-in-boolean-binding` now also accepts "null" and "undefined" types in boolean bindings. Example: `<input ?required="${undefined}" />`
- "Fix message" is now included in the output for the CLI -`no-unknown-property-converter` has been removed and `no-incompatible-property-type` can be used instead.
- Improved JSDoc support
- Improved mixin support
- Private and protected members are now also analyzed
- All diagnostics in vscode are now reported as `lit-plugin([RULE_ID])` and have unique diagnostic codes ([#108](https://github.com/runem/lit-analyzer/issues/108))
- When resolving imports for a given module, facade modules are always followed and do not increase depth ([#114](https://github.com/runem/lit-analyzer/pull/114))
- Improve codefix for 'no-missing-import' rule ([#117](https://github.com/runem/lit-analyzer/pull/117))

### Project

- Refactoring of rule modules
- Added more tests
- `lit-analyzer` now uses data from `vscode-web-custom-data`
- `cancellationToken` is now supported to prevent long running operations

## [1.1.11] - 21/5/2020

### Added

Expand All @@ -22,7 +84,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
- Better performance when using the `no-missing-imports` rule. `lit-analyzer` will still check imported modules in your project as usual, however, it will only follow imports 2 levels deep into any imported module from an external dependency (see [#93](https://github.com/runem/lit-analyzer/pull/93))
- The CLI-option `maxWarnings` defaults to `-1` to avoid failing when the analysis found only warnings (see [#96](https://github.com/runem/lit-analyzer/pull/96))

## [1.1.10] - 2020-03-02
## [1.1.10] - 2/3/2020

### Added

Expand All @@ -35,7 +97,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
- Fixed problem where when input type is date, min and max should accept date string ([#77](https://github.com/runem/lit-analyzer/issues/77))
- Fixed `no-boolean-in-attribute-binding` to allow assigning booleans that are coerced to string to 'true'|'false' where appropriate ([#dc6cdc6db](https://github.com/runem/lit-analyzer/commit/dc6cdc6dbf5388e55d2d0b93fce21074deceeaad))

## [1.1.9] - 2019-10-17
## [1.1.9] - 17/10/2019

### Added

Expand All @@ -48,7 +110,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
- Fixed problem where closing tags weren't auto-completed properly ([#37cba351](https://github.com/runem/lit-analyzer/commit/37cba3519762a1b8c6f6522baa40842e1b5ac504))
- Fixed problem where lit-analyzer would crash when running with a newer version of Typescript ([#58](https://github.com/runem/lit-analyzer/issues/58))

## [1.1.8] - 2019-08-13
## [1.1.8] - 13/8/2019

### Added

Expand All @@ -59,7 +121,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)

- Fix problem where the value of attributes on the form attr='val' could get parsed incorrectly. ([#36](https://github.com/runem/lit-analyzer/issues/36))

## [1.1.4] - 2019-08-05
## [1.1.4] - 5/8/2019

### Added

Expand All @@ -77,7 +139,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
- The analyzer has been updated and should now be much more robust (see [web-component-analyzer](https://github.com/runem/web-component-analyzer)).
- The type checker has been updated and should now be much more robust (see [ts-simple-type](https://github.com/runem/ts-simple-type)).

## [1.0.0] - 2019-04-01
## [1.0.0] - 1/4/2019

### Added

Expand All @@ -99,7 +161,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)

- Temporarily disabled code formatting until issues with nested templates are solved.

## [0.1.0] - 2019-02-22
## [0.1.0] - 22/2/2019

### Added

Expand All @@ -116,7 +178,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
- Added various missing global built in elements.
- Added various missing global built in attributes like 'aria-\*' attributes.

## [0.0.24] - 2019-02-08
## [0.0.24] - 8/2/2019

### Added

Expand Down
96 changes: 48 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
<h1 align="center">lit-analyzer</h1>
<p align="center">
<b>Monorepo for tools that analyze lit-html templates</b></br>
<sub><sub>
</p>

<br />

<p align="center">
<a href="https://marketplace.visualstudio.com/items?itemName=runem.lit-plugin"><img alt="Downloads per Month" src="https://vsmarketplacebadge.apphb.com/downloads-short/runem.lit-plugin.svg?label=vscode-lit-plugin" height="20"/></a>
<a href="https://www.npmjs.com/package/lit-analyzer"><img alt="Downloads per Month" src="https://img.shields.io/npm/dm/lit-analyzer.svg?label=lit-analyzer" height="20"/></a>
<a href="https://www.npmjs.com/package/ts-lit-plugin"><img alt="Downloads per Month" src="https://img.shields.io/npm/dm/ts-lit-plugin.svg?label=ts-lit-plugin" height="20"/></a>
<a href="https://github.com/runem/lit-analyzer/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/runem/lit-analyzer" height="20"/></a>
</p>

This mono-repository consists of the following tools:

- [**`vscode-lit-plugin`**](/packages/vscode-lit-plugin) VS Code plugin that adds syntax highlighting, type checking and code completion for lit-html.

- [**`ts-lit-plugin`**](/packages/ts-lit-plugin) Typescript plugin that adds type checking and code completion to lit-html templates.

- [**`lit-analyzer`**](/packages/lit-analyzer) CLI that analyzes lit-html templates in your code to validate html and type check bindings.

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)](#rules)

## ➤ Rules

You can find a list of all rules [here](https://github.com/runem/lit-analyzer/blob/master/docs/readme/rules.md).

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)](#contributing)

## ➤ Contributing

If you are interested in contributing to this repository please read [`contributing.md`](/CONTRIBUTING.md)

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)](#contributors)

## ➤ Contributors

| [<img alt="Rune Mehlsen" src="https://avatars2.githubusercontent.com/u/5372940?s=460&v=4" width="100">](https://twitter.com/runemehlsen) | [<img alt="Andreas Mehlsen" src="https://avatars1.githubusercontent.com/u/6267397?s=460&v=4" width="100">](https://twitter.com/andreasmehlsen) | [<img alt="Peter Burns" src="https://avatars3.githubusercontent.com/u/1659?s=460&v=4" width="100">](https://twitter.com/rictic) | [<img alt="You?" src="https://joeschmoe.io/api/v1/random" width="100">](https://github.com/runem/lit-analyzer/blob/master/CONTRIBUTING.md) |
| :--------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------: |
| [Rune Mehlsen](https://twitter.com/runemehlsen) | [Andreas Mehlsen](https://twitter.com/andreasmehlsen) | [Peter Burns](https://twitter.com/rictic) | [You?](https://github.com/runem/lit-analyzer/blob/master/CONTRIBUTING.md) |

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)](#license)

## ➤ License

Licensed under [MIT](https://opensource.org/licenses/MIT).
<!-- ⚠️ This README has been generated from the file(s) "readme.blueprint.md" ⚠️--><h1 align="center">lit-analyzer</h1>
<p align="center">
<b>Monorepo for tools that analyze lit-html templates</b></br>
<sub><sub>
</p>

<br />

<p align="center">
<a href="https://marketplace.visualstudio.com/items?itemName=runem.lit-plugin"><img alt="Downloads per Month" src="https://vsmarketplacebadge.apphb.com/downloads-short/runem.lit-plugin.svg?label=vscode-lit-plugin" height="20"/></a>
<a href="https://www.npmjs.com/package/lit-analyzer"><img alt="Downloads per Month" src="https://img.shields.io/npm/dm/lit-analyzer.svg?label=lit-analyzer" height="20"/></a>
<a href="https://www.npmjs.com/package/ts-lit-plugin"><img alt="Downloads per Month" src="https://img.shields.io/npm/dm/ts-lit-plugin.svg?label=ts-lit-plugin" height="20"/></a>
<a href="https://github.com/runem/lit-analyzer/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/runem/lit-analyzer" height="20"/></a>
</p>

This mono-repository consists of the following tools:

- [**`vscode-lit-plugin`**](/packages/vscode-lit-plugin) VS Code plugin that adds syntax highlighting, type checking and code completion for lit-html.

- [**`ts-lit-plugin`**](/packages/ts-lit-plugin) Typescript plugin that adds type checking and code completion to lit-html templates.

- [**`lit-analyzer`**](/packages/lit-analyzer) CLI that analyzes lit-html templates in your code to validate html and type check bindings.

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)](#rules)

## ➤ Rules

You can find a list of all rules [here](https://github.com/runem/lit-analyzer/blob/master/docs/readme/rules.md).

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)](#contributing)

## ➤ Contributing

If you are interested in contributing to this repository please read [`contributing.md`](/CONTRIBUTING.md)

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)](#contributors)

## ➤ Contributors

| [<img alt="Rune Mehlsen" src="https://avatars2.githubusercontent.com/u/5372940?s=460&v=4" width="100">](https://twitter.com/runemehlsen) | [<img alt="Andreas Mehlsen" src="https://avatars1.githubusercontent.com/u/6267397?s=460&v=4" width="100">](https://twitter.com/andreasmehlsen) | [<img alt="Peter Burns" src="https://avatars3.githubusercontent.com/u/1659?s=460&v=4" width="100">](https://twitter.com/rictic) | [<img alt="You?" src="https://joeschmoe.io/api/v1/random" width="100">](https://github.com/runem/lit-analyzer/blob/master/CONTRIBUTING.md) |
| :--------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------: |
| [Rune Mehlsen](https://twitter.com/runemehlsen) | [Andreas Mehlsen](https://twitter.com/andreasmehlsen) | [Peter Burns](https://twitter.com/rictic) | [You?](https://github.com/runem/lit-analyzer/blob/master/CONTRIBUTING.md) |

[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)](#license)

## ➤ License

Licensed under [MIT](https://opensource.org/licenses/MIT).
7 changes: 3 additions & 4 deletions dev/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"html.experimental.customData": ["./html.json"],
"typescript.tsserver.log": "verbose",
"typescript.tsserver.trace": "verbose",
"typescript.tsserver.log": "normal",
"typescript.tsserver.trace": "messages",
"typescript.tsdk": "node_modules/typescript/lib"
}
}
Loading

0 comments on commit bb6ea6d

Please sign in to comment.