diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..e08a3d9 Binary files /dev/null and b/.DS_Store differ diff --git a/.babelrc b/.babelrc index cd16c35..ffaf327 100644 --- a/.babelrc +++ b/.babelrc @@ -1,11 +1,12 @@ { "presets": [["@babel/preset-env", { "useBuiltIns": "entry", + "corejs": 3, "modules": "cjs", "loose": true, "targets": { - "ie": "8", - "browsers": ">2%" + "ie": "11", + "browsers": ">0.25%" } }]], "plugins": [ diff --git a/.eslintrc.yml b/.eslintrc.yml index fdedf87..74473ee 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,4 +1,6 @@ -parser: babel-eslint +parserOptions: + ecmaVersion: 2020 + sourceType: module extends: airbnb-base rules: no-underscore-dangle: 0 diff --git a/.github/workflows/merge-to-master.yml b/.github/workflows/merge-to-master.yml index f83149b..541139d 100644 --- a/.github/workflows/merge-to-master.yml +++ b/.github/workflows/merge-to-master.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - node-version: [12.16.3] + node-version: [18] steps: - name: Get branch name (merge) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 612ecd7..eefe642 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 12.16.3 + node-version: 18 - uses: actions/cache@v4 with: path: ~/.npm diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f145bc1..b22baff 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [12.16.3] + node: [18] name: Node ${{ matrix.node }} steps: - name: "Checkout latest code" @@ -37,7 +37,7 @@ jobs: - name: Set up node uses: actions/setup-node@v4 with: - node-version: "16" + node-version: "18" - name: Install dependencies run: npm ci - name: Run ESLint diff --git a/package.json b/package.json index bd58852..070df6c 100644 --- a/package.json +++ b/package.json @@ -27,36 +27,38 @@ "browser": "es5.js", "module": "src/bowser.js", "types": "index.d.ts", + "engines": { + "node": ">=18" + }, "repository": { "type": "git", "url": "git+https://github.com/bowser-js/bowser.git" }, "devDependencies": { - "@babel/cli": "^7.11.6", - "@babel/core": "^7.8.0", - "@babel/polyfill": "^7.8.3", - "@babel/preset-env": "^7.8.2", - "@babel/register": "^7.8.3", + "@babel/cli": "^7.23.0", + "@babel/core": "^7.23.0", + "@babel/preset-env": "^7.23.0", + "@babel/register": "^7.23.0", "ava": "^3.0.0", - "babel-eslint": "^10.0.3", - "babel-loader": "^8.0.6", - "babel-plugin-add-module-exports": "^1.0.2", - "babel-plugin-istanbul": "^6.0.0", - "compression-webpack-plugin": "^4.0.0", - "coveralls": "^3.0.6", - "docdash": "^1.1.1", - "eslint": "^6.5.1", - "eslint-config-airbnb-base": "^13.2.0", - "eslint-plugin-ava": "^10.0.0", - "eslint-plugin-import": "^2.18.2", - "gh-pages": "^3.0.0", - "jsdoc": "^3.6.3", - "nyc": "^15.0.0", - "sinon": "^9.0.0", - "testem": "^3.0.0", - "webpack": "^4.41.0", - "webpack-bundle-analyzer": "^3.5.2", - "webpack-cli": "^3.3.9", + "babel-loader": "^9.1.3", + "babel-plugin-add-module-exports": "^1.0.4", + "babel-plugin-istanbul": "^6.1.1", + "compression-webpack-plugin": "^10.0.0", + "core-js": "^3.33.0", + "coveralls": "^3.1.1", + "docdash": "^2.0.2", + "eslint": "^8.53.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-ava": "^14.0.0", + "eslint-plugin-import": "^2.29.0", + "gh-pages": "^6.1.0", + "jsdoc": "^4.0.2", + "nyc": "^15.1.0", + "sinon": "^17.0.1", + "testem": "^3.10.1", + "webpack": "^5.89.0", + "webpack-bundle-analyzer": "^4.10.1", + "webpack-cli": "^5.1.4", "yamljs": "^0.3.0" }, "ava": { diff --git a/webpack.config.js b/webpack.config.js index 03b058b..4e6dcb4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,7 +9,7 @@ module.exports = { mode: 'production', // "production" | "development" | "none" // Chosen mode tells webpack to use its built-in optimizations accordingly. entry: { - bundled: ['@babel/polyfill', './src/bowser.js'], + bundled: ['core-js/stable', './src/bowser.js'], es5: './src/bowser.js', }, // string | object | array // defaults to ./src