Skip to content

Commit

Permalink
feat: move to ESM (#1450)
Browse files Browse the repository at this point in the history
Now the package is a native ES module

BREAKING CHANGE: NodeJS >= 14 is required, no commonjs support
  • Loading branch information
dangreen committed Oct 11, 2022
1 parent dcbde8f commit 41456bc
Show file tree
Hide file tree
Showing 48 changed files with 732 additions and 1,794 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": [
"@trigen/eslint-config",
"@trigen/eslint-config/tsm",
"@trigen/eslint-config/typescript",
"@trigen/eslint-config/typescript-requiring-type-checking",
"@trigen/eslint-config/jest"
Expand Down
24 changes: 0 additions & 24 deletions jest.config.json

This file was deleted.

56 changes: 32 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "browserslist-useragent-regexp",
"type": "module",
"version": "3.0.2",
"description": "A utility to compile browserslist query to a RegExp to test browser useragent.",
"author": "dangreen",
Expand All @@ -11,14 +12,29 @@
"bugs": {
"url": "https://github.com/browserslist/browserslist-useragent-regexp/issues"
},
"keywords": [
"browserslist",
"useragent",
"regexp"
],
"engines": {
"node": ">=14.0.0"
},
"bin": {
"browserslist-useragent-regexp": "dist/cli.js"
"browserslist-useragent-regexp": "./dist/cli.js"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=12.0.0"
"exports": "./src/index.ts",
"publishConfig": {
"types": "./dist/index.d.ts",
"exports": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"directory": "package"
},
"files": [
"dist"
],
"scripts": {
"clear:package": "del ./package",
"clear": "del ./package ./dist ./coverage",
Expand All @@ -27,9 +43,9 @@
"emitDeclarations": "tsc --emitDeclarationOnly",
"build": "run -p [ rollup -c ] emitDeclarations",
"lint": "eslint './*{js,ts}' './src/**/*.{js,ts}' './examples/**/*.{js,ts}'",
"jest": "jest -c jest.config.json",
"test:unit": "vitest run --coverage",
"test:size": "size-limit",
"test": "run -p lint jest",
"test": "run -p lint test:unit",
"build:demo": "node examples/buildDemo > ./docs/demo.html && cp -R examples/demojs/ docs/demojs/",
"build:docs": "typedoc ./src --out ./docs --excludeExternals && touch docs/.nojekyll",
"commit": "cz",
Expand All @@ -38,38 +54,31 @@
"release": "run bumpVersion [ git push origin master --tags ] createGithubRelease",
"updateGitHooks": "simple-git-hooks"
},
"keywords": [
"browserslist",
"regexp"
],
"dependencies": {
"@types/node": "^16.9.6",
"argue-cli": "^1.2.0",
"browserslist": "^4.21.4",
"chalk": "^4.0.0",
"easy-table": "^1.1.1",
"useragent": "^2.3.0"
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@commitlint/cz-commitlint": "^17.1.2",
"@rollup/plugin-node-resolve": "^15.0.0",
"@size-limit/file": "^8.1.0",
"@swc/core": "^1.3.6",
"@swc/helpers": "^0.4.12",
"@swc/jest": "^0.2.23",
"@trigen/browserslist-config": "^8.0.0-alpha.5",
"@trigen/eslint-config": "^8.0.0-alpha.14",
"@trigen/scripts": "^8.0.0-alpha.9",
"@types/jest": "^29.1.2",
"@trigen/eslint-config": "8.0.0-alpha.19",
"@trigen/scripts": "8.0.0-alpha.18",
"@types/node": "^18.8.4",
"@vitest/coverage-c8": "^0.24.1",
"browserslist-useragent": "^3.0.0",
"clean-publish": "^4.0.1",
"commitizen": "^4.2.5",
"del-cli": "^4.0.1",
"eslint": "^8.25.0",
"jest": "^29.1.2",
"nano-staged": "^0.8.0",
"rollup": "^2.79.1",
"rollup-plugin-add-shebang": "^0.3.0",
Expand All @@ -78,10 +87,9 @@
"simple-github-release": "^1.0.0",
"size-limit": "^8.1.0",
"standard-version": "^9.5.0",
"typescript": "^4.1.3",
"user-agents": "^1.0.213"
},
"files": [
"dist"
]
"typescript": "^4.8.4",
"user-agents": "^1.0.213",
"vite": "^3.1.7",
"vitest": "^0.24.1"
}
}

0 comments on commit 41456bc

Please sign in to comment.