Skip to content

Commit

Permalink
Build package with rollup and introduce tracker-json for bumping trac…
Browse files Browse the repository at this point in the history
…ker.json
  • Loading branch information
nervetattoo committed Jan 19, 2019
1 parent b827fc7 commit 36b4aa3
Show file tree
Hide file tree
Showing 6 changed files with 928 additions and 31 deletions.
6 changes: 4 additions & 2 deletions simple-thermostat.js → index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Debouncer } from '@polymer/polymer/lib/utils/debounce'

var LitElement =
LitElement ||
Object.getPrototypeOf(customElements.get('hui-error-entity-row'))
const html = LitElement.prototype.html

import { Debouncer } from 'https://unpkg.com/@polymer/polymer/lib/utils/debounce'
//import { Debouncer } from 'https://unpkg.com/@polymer/polymer/lib/utils/debounce'

function renderStyles() {
return html`
Expand Down Expand Up @@ -75,7 +77,7 @@ function renderStyles() {
}
.icon {
margin-right: 8px;
color: grey;
color: var(--paper-item-icon-color, #44739e);
}
.title {
font-size: var(--thermostat-font-size-title);
Expand Down
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,36 @@
"author": "Raymond Julin <raymond.julin@gmail.com>",
"license": "MIT",
"devDependencies": {
"@polymer/polymer": "^3.1.0",
"husky": "^1.3.1",
"prettier": "1.15.3",
"pretty-quick": "^1.8.0",
"release-it": "^9.8.1"
"release-it": "^9.8.1",
"rollup": "^1.1.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-terser": "^4.0.2"
},
"scripts": {
"release": "release-it",
"update-tracker": "node scripts/generate-tracker-json.js"
"build": "NODE_ENV=production rollup -c"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"tracker-json": {
"simple-thermostat": {
"repo": "nervetattoo/simple-thermostat"
}
},
"release-it": {
"github": {
"release": true
},
"scripts": {
"afterBump": "yarn update-tracker ${name} ${version} $(date +'%Y-%m-%d')"
"afterBump": "tracker-json"
}
},
"prettier": {
Expand Down
12 changes: 12 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import resolve from 'rollup-plugin-node-resolve'
import { terser } from 'rollup-plugin-terser'

export default {
input: 'simple-thermostat.js',
output: {
file: 'simple-thermostat.min.js',
format: 'umd',
name: 'SimpleThermostat',
},
plugins: [resolve(), terser()],
}
18 changes: 0 additions & 18 deletions scripts/generate-tracker-json.js

This file was deleted.

Loading

0 comments on commit 36b4aa3

Please sign in to comment.