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 #733

Merged
merged 38 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
dd178b1
Convert to Polymer 3 with magi-cli [skip ci]
web-padawan Sep 16, 2020
07e7efc
Remove demo and related dependencies [skip ci]
web-padawan Sep 16, 2020
a65ed3a
Generate TS defs for src only [skip ci]
web-padawan Sep 16, 2020
8c0862f
Sort package.json, add module entry [skip ci]
web-padawan Sep 16, 2020
f1e3a47
Replace dom-module with registerStyles [skip ci]
web-padawan Sep 16, 2020
a777e1c
Convert unit tests to web-test-runner
web-padawan Sep 18, 2020
56d6b54
Remove travis config from the repo
web-padawan Sep 18, 2020
b899595
Update TS defs config and run in CI
web-padawan Sep 18, 2020
7743d81
Bump web-test-runner version
web-padawan Sep 19, 2020
af91ea0
Update SauceLabs build config
web-padawan Sep 19, 2020
1a26763
Update web-test-runner config
web-padawan Sep 19, 2020
557c449
Convert visual tests to hermione
web-padawan Sep 21, 2020
354ad5c
Setup ESLint, Prettier and lint-staged
web-padawan Sep 21, 2020
db0d6cb
Add magi scripts to check version
web-padawan Sep 21, 2020
476066f
Add Stylelint script
web-padawan Sep 21, 2020
d2aa7f7
Update and move issue template
web-padawan Sep 21, 2020
38a5315
Refactor date helpers to methods
web-padawan Sep 21, 2020
d2f6897
Update gen-tsd.json
web-padawan Sep 21, 2020
cc6df36
Enable test coverage
web-padawan Sep 21, 2020
6e88a18
Update and cleanup README
web-padawan Sep 21, 2020
60aff88
Update copyright headers
web-padawan Sep 21, 2020
6c1396c
Update coverage thresholds
web-padawan Sep 21, 2020
2196fc5
Update JSDoc, fix API docs page
web-padawan Sep 21, 2020
5cebd91
Bump dependencies versions
web-padawan Sep 29, 2020
10ac63b
Bump test runner, test in Firefox
web-padawan Oct 5, 2020
ba6c806
Try to make tests pass
web-padawan Oct 5, 2020
d6eef79
Bump test runner and concurrency
web-padawan Oct 6, 2020
907f636
Restore concurrency to 1
web-padawan Oct 6, 2020
66e3b00
Bump dev dependencies versions
web-padawan Oct 12, 2020
31200d7
Bump test runner version
web-padawan Oct 15, 2020
bae3c11
Commit typings to version control
web-padawan Nov 4, 2020
b12ef24
Add type definitions for custom events
web-padawan Nov 4, 2020
9271580
Fix npm start script
web-padawan Nov 10, 2020
61460f3
Update README, add note about Node version
web-padawan Nov 10, 2020
f5fbe69
Reorganize type definitions
web-padawan Nov 10, 2020
848fa46
Align and format i18n JSDoc
web-padawan Nov 10, 2020
850fed4
Update dependencies versions
web-padawan Nov 10, 2020
77da811
Add debugging instructions
web-padawan Nov 16, 2020
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
20 changes: 8 additions & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
{
"extends": ["vaadin"],
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": [
"html"
],
"globals": {
"vaadin": false,
"CustomElements": false,
"HTMLImports": false,
"Polymer": false,
"WeakMap": false,
"Vaadin": false
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018
}
}
16 changes: 0 additions & 16 deletions .gemini-ff.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .gemini.yml

This file was deleted.

3 changes: 1 addition & 2 deletions ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Example: Overlay stays hidden. -->

### Live Demo
<!-- The template, click "Remix This" to edit it: https://glitch.com/edit/#!/desert-duckling -->
<!-- The template, click "Remix This" to edit it: https://glitch.com/edit/#!/vaadin-date-picker-issue -->

### Steps to reproduce
<!-- Example
Expand All @@ -23,6 +23,5 @@
- [ ] Firefox
- [ ] Safari
- [ ] Edge
- [ ] IE 11
- [ ] iOS Safari
- [ ] Android Chrome
40 changes: 40 additions & 0 deletions .github/workflows/sauce.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: sauce

on: [push]

jobs:
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: 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

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
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-date-picker',
desiredCapabilities: {
browserName: 'chrome',
version: '85.0',
platform: 'Windows 10'
}
}
},
plugins: {
'hermione-esm': {
port: 8080
},
'hermione-sauce': {
verbose: false
}
}
};
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none"
}
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

20 changes: 0 additions & 20 deletions @types/interfaces.d.ts

This file was deleted.

72 changes: 21 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![npm version](https://badgen.net/npm/v/@vaadin/vaadin-date-picker)](https://www.npmjs.com/package/@vaadin/vaadin-date-picker)
[![Bower version](https://badgen.net/github/release/vaadin/vaadin-date-picker)](https://github.com/vaadin/vaadin-date-picker/releases)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-date-picker)
[![Build Status](https://travis-ci.org/vaadin/vaadin-date-picker.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-date-picker)
[![Coverage Status](https://coveralls.io/repos/github/vaadin/vaadin-date-picker/badge.svg?branch=master)](https://coveralls.io/github/vaadin/vaadin-date-picker?branch=master)
Expand All @@ -16,17 +15,6 @@

[&lt;vaadin-date-picker&gt;](https://vaadin.com/components/vaadin-date-picker) is a Web Component providing a date selection field which includes a scrollable month calendar view, part of the [Vaadin components](https://vaadin.com/components).

<!--
```
<custom-element-demo height="550">
<template>
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="vaadin-date-picker.html">
<next-code-block></next-code-block>
</template>
</custom-element-demo>
```
-->
```html
<vaadin-date-picker label="Label" placeholder="Placeholder">
</vaadin-date-picker>
Expand All @@ -36,28 +24,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-date-picker`:

```sh
bower i vaadin/vaadin-date-picker --save
```

Once installed, import it in your application:

```html
<link rel="import" href="bower_components/vaadin-date-picker/vaadin-date-picker.html">
```
### Polymer 3 and ES Modules Compatible Version

Install `vaadin-date-picker`:

```sh
Expand All @@ -80,45 +46,49 @@ To use the Material theme, import the correspondent file from the `theme/materia

- The components with the Lumo theme:

`theme/lumo/vaadin-date-picker.html`
`theme/lumo/vaadin-date-picker-light.html`
`theme/lumo/vaadin-date-picker.js`
`theme/lumo/vaadin-date-picker-light.js`

- The components with the Material theme:

`theme/material/vaadin-date-picker.html`
`theme/material/vaadin-date-picker-light.html`
`theme/material/vaadin-date-picker.js`
`theme/material/vaadin-date-picker-light.js`

- Alias for `theme/lumo/vaadin-date-picker.html`
`theme/lumo/vaadin-date-picker-light.html`:
- Alias for `theme/lumo/vaadin-date-picker.js`
`theme/lumo/vaadin-date-picker-light.js`:

`vaadin-date-picker.html`
`vaadin-date-picker-light.html`
`vaadin-date-picker.js`
`vaadin-date-picker-light.js`


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

1. Fork the `vaadin-date-picker` repository and clone it locally.

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

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

1. Run `npm start`, browser will automatically open the component API documentation.
1. When in the `vaadin-date-picker` directory, run `npm install` to install dependencies.

1. You can also open demo or in-browser tests by adding **demo** or **test** to the URL, for example:
1. Run `npm start`, browser will automatically open the component API documentation.

- http://127.0.0.1:3000/components/vaadin-date-picker/demo
- http://127.0.0.1:3000/components/vaadin-date-picker/test
1. You can also open visual tests, for example:

- http://127.0.0.1:3000/test/visual/default.html

## Running tests from the command line

1. When in the `vaadin-date-picker` directory, run `polymer test`
1. When in the `vaadin-date-picker` 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.


## Big Thanks
Expand Down
Loading