Skip to content

Commit

Permalink
Merge pull request #779 from abraham/typescript
Browse files Browse the repository at this point in the history
Convert to TypeScript
  • Loading branch information
abraham authored Apr 3, 2020
2 parents 1d18486 + 5d7122c commit f664bef
Show file tree
Hide file tree
Showing 87 changed files with 1,075 additions and 484 deletions.
4 changes: 3 additions & 1 deletion .babelrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"presets": [
"@babel/preset-typescript",
[
"@babel/preset-env",
{
Expand All @@ -8,5 +9,6 @@
}
}
]
]
],
"plugins": [["@babel/plugin-proposal-class-properties", { "loose": true }]]
}
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"root": true,
"extends": ["eslint:recommended", "google", "plugin:polymer/polymer-3", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018
Expand All @@ -9,8 +10,8 @@
"browser": true,
"es6": true
},
"plugins": ["html", "polymer"],
"ignorePatterns": ["node_modules/", "dist/"],
"plugins": ["@typescript-eslint", "html", "polymer"],
"ignorePatterns": ["node_modules/", "dist/", "out-tsc"],
"rules": {
"brace-style": "off",
"new-cap": "off",
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist/
out-tsc/
node_modules/
.idea/
.vscode/
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
script: NODE_ENV=development npm run build
- name: Production
script: npm run build
- name: Compile
script: npm run compile
- name: Lint
script: npm run lint
- name: Security
Expand Down
1 change: 1 addition & 0 deletions build-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const isTemplate = ({ url, contentType }) => {
'application/json',
'text/html',
'text/markdown',
'video/mp2t', // TypeScript
];

if (isNodeModule({ url })) {
Expand Down
2 changes: 1 addition & 1 deletion data/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"unsubscribe": "Unsubscribe",
"enable": {
"label": "Enable",
"link": "https://pushassist.com/knowledgebase/how-to-enable-or-disable-push-notifications-on-chrome-firefox-safari-b/"
"link": "https://support.google.com/chrome/answer/3220216"
},
"toast": {
"title": "Open"
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/01-configure-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ in `hoverboard-app.html`
```html
<iron-pages>
<home-page data-route="home" data-path="pages/home-page.html"></home-page>
<blog-page data-route="blog" data-path="pages/blog-page.html" route="[[subroute]]"></blog-page>
<blog-page data-route="blog" data-path="pages/blog-page.html" route="[[subRoute]]"></blog-page>
<speakers-page
data-route="speakers"
data-path="pages/speakers-page.html"
route="[[subroute]]"
route="[[subRoute]]"
></speakers-page>
</iron-pages>
```
Expand Down
11 changes: 10 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@
<link href="https://fcm.googleapis.com" rel="preconnect" />
<link href="https://firestore.googleapis.com" rel="preconnect" />

<script>
// https://stackoverflow.com/a/50407571/26406
window.process = {
env: {
NODE_ENV: 'production',
},
};
</script>

<script>
// First Input Delay polyfill https://github.com/GoogleChromeLabs/first-input-delay
// prettier-ignore
Expand Down Expand Up @@ -127,7 +136,7 @@
<script src="./node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
{% if loadDevelopmentScripts %}
<!-- TODO: Consolidate development and production builds so they are more similar -->
<script src="./src/hoverboard-app.js" type="module"></script>
<script src="./src/hoverboard-app.ts" type="module"></script>
{% endif %}

<style>
Expand Down
Loading

0 comments on commit f664bef

Please sign in to comment.