Skip to content

Commit a22e2e1

Browse files
authored
Update dependencies (#105)
1 parent 375e3dc commit a22e2e1

File tree

10 files changed

+359
-1116
lines changed

10 files changed

+359
-1116
lines changed

.babelrc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
{
22
"presets": ["@babel/env"],
3-
"plugins": [
4-
["@babel/plugin-proposal-decorators", { "legacy": true }],
5-
"@babel/plugin-proposal-function-sent",
6-
"@babel/plugin-proposal-export-namespace-from",
7-
"@babel/plugin-proposal-numeric-separator",
8-
"@babel/plugin-proposal-throw-expressions",
9-
"@babel/plugin-syntax-dynamic-import",
10-
"@babel/plugin-syntax-import-meta",
11-
["@babel/plugin-proposal-class-properties", { "loose": false }],
12-
"@babel/plugin-proposal-json-strings",
13-
"@babel/plugin-transform-modules-umd"
14-
]
3+
"plugins": ["@babel/plugin-transform-modules-umd"]
154
}

.github/workflows/build.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,24 @@
44
name: Build
55

66
on:
7-
push:
8-
branches: [ master ]
9-
pull_request:
10-
branches: [ master ]
7+
push:
8+
branches: [master]
9+
pull_request:
10+
branches: [master]
1111

1212
jobs:
13-
build:
13+
build:
14+
runs-on: ubuntu-latest
1415

15-
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
node-version: [12.x, 14.x, 16.x]
1619

17-
strategy:
18-
matrix:
19-
node-version: [10.x, 12.x, 14.x]
20-
21-
steps:
22-
- uses: actions/checkout@v2
23-
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v2
25-
with:
26-
node-version: ${{ matrix.node-version }}
27-
- run: yarn
28-
- run: yarn build
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- run: yarn
27+
- run: yarn build

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,7 @@ yarn.lock
3636

3737
# Config
3838
.babelrc
39+
.github
40+
.whitesource
3941
renovate.json
4042
webpack.config.js

.whitesource

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"issueSettings": {
66
"minSeverityLevel": "LOW"
77
}
8-
}
8+
}

demo/index.html

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
8+
/>
69

7-
<title>isTouch Demo</title>
8-
</head>
9-
<body>
10-
<script type="module">
11-
import { setTouchClass } from '../src/istouch.js';
10+
<title>isTouch Demo</title>
11+
</head>
12+
<body>
13+
<script type="module">
14+
import { setTouchClass } from '../src/istouch.js';
1215

13-
setTouchClass();
14-
</script>
15-
</body>
16+
setTouchClass();
17+
</script>
18+
</body>
1619
</html>

dist/istouch.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@
1010
factory(mod.exports);
1111
global.istouch = mod.exports;
1212
}
13-
})(this, function (_exports) {
13+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
1414
"use strict";
1515

1616
Object.defineProperty(_exports, "__esModule", {
1717
value: true
1818
});
19-
_exports.setTouchClass = _exports.default = void 0;
19+
_exports.setTouchClass = _exports["default"] = void 0;
20+
// prettier-ignore
2021
var isTouch = 'ontouchstart' in document.documentElement || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
2122
var _default = isTouch;
22-
_exports.default = _default;
23+
_exports["default"] = _default;
2324

2425
var setTouchClass = function setTouchClass() {
2526
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement;

dist/istouch.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@three11/istouch",
3-
"version": "0.4.0",
3+
"version": "1.0.0",
44
"description": "Use JS to detect touch-enabled device",
55
"main": "dist/istouch.js",
66
"scripts": {
@@ -43,17 +43,8 @@
4343
"devDependencies": {
4444
"@babel/cli": "7.14.3",
4545
"@babel/core": "7.14.3",
46-
"@babel/plugin-proposal-class-properties": "7.13.0",
47-
"@babel/plugin-proposal-decorators": "7.14.2",
48-
"@babel/plugin-proposal-export-namespace-from": "7.14.2",
49-
"@babel/plugin-proposal-function-sent": "7.12.13",
50-
"@babel/plugin-proposal-json-strings": "7.14.2",
51-
"@babel/plugin-proposal-numeric-separator": "7.14.2",
52-
"@babel/plugin-proposal-throw-expressions": "7.12.13",
53-
"@babel/plugin-syntax-dynamic-import": "7.8.3",
54-
"@babel/plugin-syntax-import-meta": "7.10.4",
46+
"@babel/plugin-transform-modules-umd": "7.14.0",
5547
"@babel/preset-env": "7.14.2",
56-
"babel-loader": "8.2.2",
5748
"babel-minify": "0.5.1"
5849
}
5950
}

src/istouch.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
const isTouch =
2-
'ontouchstart' in document.documentElement ||
3-
navigator.MaxTouchPoints > 0 ||
4-
navigator.msMaxTouchPoints > 0;
1+
// prettier-ignore
2+
const isTouch = 'ontouchstart' in document.documentElement || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
53

64
export default isTouch;
75

0 commit comments

Comments
 (0)