Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to Polymer 3, add events type definitions #179

Merged
merged 29 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ba1d609
Remove demo and related dependencies
web-padawan Feb 2, 2021
0d1a9e3
Convert to Polymer 3 with magi-cli
web-padawan Feb 2, 2021
87d6aa2
Sort package.json, add module entry
web-padawan Feb 2, 2021
4be7e8d
Commit typings to version control
web-padawan Feb 2, 2021
8de357a
Cleanup typings, extend HTMLElement
web-padawan Feb 2, 2021
d6528ce
Remove custom-style usage
web-padawan Feb 2, 2021
383c762
Remove polyfill workarounds
web-padawan Feb 2, 2021
2e5fa7e
Replace dom-module with registerStyles
web-padawan Feb 2, 2021
83e0cc5
Update dependencies to P3 alphas
web-padawan Feb 2, 2021
6faef97
Sort dependencies in package.json
web-padawan Feb 2, 2021
71b4910
Replace querySelector with ID usage
web-padawan Feb 2, 2021
7beebc8
Fix incorrect file in Material theme
web-padawan Feb 2, 2021
b4219d6
Convert visual tests to hermione-esm
web-padawan Feb 2, 2021
b85a046
Add web-dev-server and start script
web-padawan Feb 2, 2021
97c764f
Add default aria-label for drawer toggle
web-padawan Feb 2, 2021
057721c
Fire drawer toggle click on Enter and Space
web-padawan Feb 2, 2021
878de00
Convert unit tests to web-test-runner
web-padawan Feb 2, 2021
ea83e42
Add ESLint, Prettier, Stylelint and magi
web-padawan Feb 2, 2021
307dc75
Update copyright headers
web-padawan Feb 2, 2021
7eef44a
Cleanup and sort imports
web-padawan Feb 2, 2021
f5f0048
Cleanup JSDoc, remove demo mentions
web-padawan Feb 2, 2021
0398118
Reorganize and cleanup typings
web-padawan Feb 2, 2021
9056c2e
Update and cleanup README
web-padawan Feb 2, 2021
3a1568b
Fix API docs, add prestart script
web-padawan Feb 2, 2021
4ab1686
Build API docs with rollup
web-padawan Feb 2, 2021
f81c7be
Replace Travis with GitHub actions
web-padawan Feb 2, 2021
154df58
Fix prettier HTML formatting
web-padawan Feb 2, 2021
f029d50
Add type definitions for custom events
web-padawan Feb 2, 2021
ca48562
Add JSDoc annotations for custom events
web-padawan Feb 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"extends": "vaadin",
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": [
"html"
],
"globals": {
"Polymer": false,
"Vaadin": false
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020
}
}
22 changes: 0 additions & 22 deletions .gemini.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/sauce.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: sauce

on:
push:
branches:
- '**'
tags-ignore:
- '*.*'

jobs:
unit-tests:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: SauceLabs tests
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: npm run test:sauce

visual-tests:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: Visual tests
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: npm run test:visual
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: tests

on: [pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: Check version
run: npm run check-version

- name: Lint JavaScript
run: npm run lint:js

- name: Lint CSS
run: npm run lint:css

- name: Lint typings
run: npm run lint:types

unit-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Install dependencies
run: npm install

- name: Unit tests
run: npm test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
package-lock.json
yarn.lock
coverage
analysis.json
dist
analysis.json
21 changes: 21 additions & 0 deletions .hermione.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
browsers: {
chrome: {
baseUrl: 'http://localhost:8080/test/visual/',
screenshotsDir: () => 'test/visual/screens/vaadin-app-layout',
desiredCapabilities: {
browserName: 'chrome',
version: '85.0',
platform: 'Windows 10'
}
}
},
plugins: {
'hermione-esm': {
port: 8080
},
'hermione-sauce': {
verbose: false
}
}
};
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none",
"htmlWhitespaceSensitivity": "strict"
}
5 changes: 4 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "stylelint-config-vaadin"
"extends": [
"stylelint-config-vaadin",
"stylelint-config-prettier"
]
}
69 changes: 0 additions & 69 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion @types/interfaces.d.ts

This file was deleted.

86 changes: 27 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
[![npm version](https://badgen.net/npm/v/@vaadin/vaadin-app-layout)](https://www.npmjs.com/package/@vaadin/vaadin-app-layout)
[![Bower version](https://badgen.net/github/release/vaadin/vaadin-app-layout)](https://github.com/vaadin/vaadin-app-layout/releases)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-app-layout)
[![Build Status](https://travis-ci.org/vaadin/vaadin-app-layout.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-app-layout)
[![Coverage Status](https://coveralls.io/repos/github/vaadin/vaadin-app-layout/badge.svg?branch=master)](https://coveralls.io/github/vaadin/vaadin-app-layout?branch=master)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vaadin/web-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-app-layout)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadin-app-layout-directory-urlidentifier.svg)](https://vaadin.com/directory/component/vaadinvaadin-app-layout)


# <vaadin-app-layout>

[Live Demo ↗](https://vaadin.com/components/vaadin-app-layout/html-examples)
|
[API documentation ↗](https://vaadin.com/components/vaadin-app-layout/html-api)


[<vaadin-app-layout>](https://vaadin.com/components/vaadin-app-layout) is a Web Component providing a quick and easy way to get a common application layout structure done, part of the [Vaadin components](https://vaadin.com/components).

[![npm version](https://badgen.net/npm/v/@vaadin/vaadin-app-layout)](https://www.npmjs.com/package/@vaadin/vaadin-app-layout)
[![Build Status](https://travis-ci.org/vaadin/vaadin-app-layout.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-app-layout)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-app-layout)
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-app-layout)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadin-app-layout-directory-urlidentifier.svg)](https://vaadin.com/directory/component/vaadinvaadin-app-layout)
[![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)

```html
<vaadin-app-layout>
<vaadin-drawer-toggle slot="navbar touch-optimized"></vaadin-drawer-toggle>
Expand Down Expand Up @@ -47,30 +42,6 @@

## Installation

The Vaadin components are distributed as Bower and npm packages.
Please note that the version range is the same, as the API has not changed.
You should not mix Bower and npm versions in the same application, though.

Unlike the official Polymer Elements, the converted Polymer 3 compatible Vaadin components
are only published on npm, not pushed to GitHub repositories.

### Polymer 2 and HTML Imports compatible version

Install `vaadin-app-layout`:

```sh
bower i vaadin/vaadin-app-layout --save
```

Once installed, import it in your application:

```html
<link rel="import" href="bower_components/vaadin-app-layout/vaadin-app-layout.html">
<link rel="import" href="bower_components/vaadin-app-layout/vaadin-drawer.toggle.html">
```
### Polymer 3 and ES Modules compatible version


Install `vaadin-app-layout`:

```sh
Expand All @@ -94,55 +65,52 @@ To use the Material theme, import the correspondent file from the `theme/materia

- The components with the Lumo theme:

`theme/lumo/vaadin-app-layout.html`
`theme/lumo/vaadin-drawer-toggle.html`
`theme/lumo/vaadin-app-layout.js`
`theme/lumo/vaadin-drawer-toggle.js`

- The components with the Material theme:

`theme/material/vaadin-app-layout.html`
`theme/material/vaadin-drawer-toggle.html`

- Aliases for `theme/lumo/vaadin-app-layout.html` `theme/lumo/vaadin-drawer-toggle.html`
`theme/material/vaadin-app-layout.js`
`theme/material/vaadin-drawer-toggle.js`

`vaadin-app-layout.html`
`vaadin-drawer-toggle.html`
- Aliases for `theme/lumo/vaadin-app-layout.js` `theme/lumo/vaadin-drawer-toggle.js`

`vaadin-app-layout.js`
`vaadin-drawer-toggle.js`

## Running demos and tests in browser
## Running API docs and tests in a browser

1. Fork the `vaadin-app-layout` repository and clone it locally.

1. Make sure you have [npm](https://www.npmjs.com/) installed.
1. Make sure you have [node.js](https://nodejs.org/) 12.x installed.

1. When in the `vaadin-app-layout` directory, run `npm install` and then `bower install` to install dependencies.
1. Make sure you have [npm](https://www.npmjs.com/) installed.

1. Make sure you have [polymer-cli](https://www.npmjs.com/package/polymer-cli) installed globally: `npm i -g polymer-cli`.
1. When in the `vaadin-app-layout` directory, run `npm install` to install dependencies.

1. Run `polymer serve --open`, browser will automatically open the component API documentation.
1. Run `npm start`, browser will automatically open the component API documentation.

1. You can also open demo or in-browser tests by adding **demo** or **test** to the URL, for example:
1. You can also open visual tests, for example:

- http://127.0.0.1:8080/components/vaadin-app-layout/demo
- http://127.0.0.1:8080/components/vaadin-app-layout/test
- http://localhost:8000/test/visual/drawer.html


## Running tests from the command line

1. When in the `vaadin-app-layout` directory, run `polymer test`
1. When in the `vaadin-app-layout` directory, run `npm test`

## Debugging tests in the browser

1. Run `npm run debug`, then choose manual mode (M) and open the link in browser.

## Following the coding style

We are using [ESLint](http://eslint.org/) for linting JavaScript code. You can check if your code is following our standards by running `npm run lint`, which will automatically lint all `.js` files as well as JavaScript snippets inside `.html` files.
We are using [ESLint](http://eslint.org/) for linting JavaScript code. You can check if your code is following our standards by running `npm run lint`, which will automatically lint all `.js` files.


## Contributing

- Make sure your code is compliant with our code linters: `npm run lint`
- Check that tests are passing: `polymer test`
- [Submit a pull request](https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github) with detailed title and description
- Wait for response from one of Vaadin components team members

To contribute to the component, please read [the guideline](https://github.com/vaadin/vaadin-core/blob/master/CONTRIBUTING.md) first.

## License

Expand Down
Loading