ua-browser 0.1.8 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,25 +1,27 @@
1
1
  {
2
2
  "name": "ua-browser",
3
- "version": "0.1.8",
4
- "description": "uaBrowser - 通过useragent和浏览器环境变量检测浏览器、系统及设备类型工具,支持node环境使用",
5
- "main": "index.js",
6
- "module": "./dist/index.esm.mjs",
3
+ "version": "1.0.0",
4
+ "description": "uaBrowser - Browser, OS, engine and device detection from user agent strings. Supports Node.js. Zero dependencies.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.mjs",
7
8
  "types": "./dist/index.d.ts",
8
9
  "exports": {
9
10
  ".": {
10
- "require": "./dist/index.cjs.js",
11
- "import": "./dist/index.esm.mjs",
12
- "types": "./dist/index.d.ts"
11
+ "require": {
12
+ "types": "./dist/index.d.cts",
13
+ "default": "./dist/index.cjs"
14
+ },
15
+ "import": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.mjs"
18
+ }
13
19
  }
14
20
  },
15
21
  "files": [
16
22
  "dist"
17
23
  ],
18
- "scripts": {
19
- "build": "node build.js",
20
- "dev": "node build.js --watch",
21
- "test": "node example/index.js"
22
- },
24
+ "sideEffects": false,
23
25
  "repository": {
24
26
  "type": "git",
25
27
  "url": "git+https://github.com/yangtianxia/ua-browser.git"
@@ -28,7 +30,9 @@
28
30
  "uaBrowser",
29
31
  "userAgent",
30
32
  "javascript",
31
- "typescript"
33
+ "typescript",
34
+ "browser-detection",
35
+ "user-agent-parser"
32
36
  ],
33
37
  "author": "yangtianxia",
34
38
  "license": "MIT",
@@ -37,27 +41,29 @@
37
41
  },
38
42
  "homepage": "https://github.com/yangtianxia/ua-browser#readme",
39
43
  "devDependencies": {
40
- "@babel/core": "^7.14.6",
41
- "@babel/polyfill": "^7.12.1",
42
- "@babel/preset-env": "^7.14.7",
43
- "@rollup/plugin-babel": "^5.3.1",
44
- "@rollup/plugin-commonjs": "^21.1.0",
45
- "@rollup/plugin-json": "^4.1.0",
46
- "@rollup/plugin-node-resolve": "^13.2.1",
47
- "@rollup/plugin-typescript": "^8.3.2",
48
- "@types/node": "^17.0.25",
49
- "@typescript-eslint/eslint-plugin": "^5.20.0",
50
- "@typescript-eslint/parser": "^5.20.0",
51
- "babel-preset-env": "^1.7.0",
52
- "core-js": "^3.22.2",
53
- "eslint": "^8.13.0",
54
- "eslint-plugin-import": "^2.26.0",
55
- "minimist": "^1.2.8",
56
- "rollup": "^2.70.2",
57
- "rollup-plugin-terser": "^7.0.2",
58
- "shelljs": "^0.8.5",
59
- "shx": "^0.3.4",
60
- "tslib": "^2.3.1",
61
- "typescript": "^4.6.3"
44
+ "@changesets/cli": "^2.29.4",
45
+ "@typescript-eslint/eslint-plugin": "^7.0.0",
46
+ "@typescript-eslint/parser": "^7.0.0",
47
+ "@vitest/coverage-v8": "^1.6.0",
48
+ "eslint": "^8.57.0",
49
+ "eslint-plugin-import": "^2.29.1",
50
+ "tsup": "^8.0.2",
51
+ "typescript": "^5.4.0",
52
+ "vitepress": "^1.6.4",
53
+ "vitest": "^1.6.0",
54
+ "vue": "^3.5.32"
55
+ },
56
+ "scripts": {
57
+ "release": "pnpm build && changeset publish",
58
+ "build": "tsup",
59
+ "dev": "tsup --watch",
60
+ "test": "vitest run",
61
+ "test:watch": "vitest",
62
+ "test:coverage": "vitest run --coverage",
63
+ "lint": "eslint src --ext .ts",
64
+ "typecheck": "tsc -p tsconfig.build.json --noEmit",
65
+ "docs:dev": "pnpm build && vitepress dev docs",
66
+ "docs:build": "pnpm build && vitepress build docs",
67
+ "docs:preview": "vitepress preview docs"
62
68
  }
63
- }
69
+ }
package/index.js DELETED
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.ENV_NODE === 'production') {
4
- module.exports = require('./dist/index.min.js')
5
- } else {
6
- module.exports = require('./dist/index.cjs.js')
7
- }