Skip to content

Commit

Permalink
feat: modernize configs, bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Aug 15, 2023
1 parent ad2a39b commit 283c502
Show file tree
Hide file tree
Showing 24 changed files with 95 additions and 9,903 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
5 changes: 0 additions & 5 deletions .commitlintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .dist.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"presets": [
["@babel/env", {
"targets": {
"browsers": [ "> 1%", "last 2 versions" ]
"browsers": [ "defaults, not ie 11" ]
}
}]
]
Expand Down
9 changes: 9 additions & 0 deletions .dist.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"extends": ["eslint:recommended"],
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false,
"babelOptions": {
"babelrc": false,
"configFile": false,
"presets": ["@babel/preset-env"]
}
},
"env": {
"node": false,
"browser": true,
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.*.js
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text=auto
* text=auto eol=lf
4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

27 changes: 9 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
# OS #
###################
.DS_Store
*.log
.idea
Thumbs.db
tmp/
temp/


# Node.js #
###################
node_modules


# NYC #
###################
coverage
*.lcov
.nyc_output
locales/
package-lock.json
yarn.lock


# Files #
###################
*.log
Thumbs.db
tmp/
temp/
*.lcov
.env
lib
dist
4 changes: 2 additions & 2 deletions .lib.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"presets": [
["@babel/env", {
"targets": {
"node": "10.12.0",
"browsers": [ "> 1%", "last 2 versions" ]
"node": "14",
"browsers": [ "defaults, not ie 11" ]
}
}]
],
Expand Down
4 changes: 1 addition & 3 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module.exports = {
"*.md,!test/**/*.md": [
filenames => filenames.map(filename => `remark ${filename} -qfo`)
],
'*.md': (filenames) => filenames.map((filename) => `remark ${filename} -qfo`),
'package.json': 'fixpack',
'*.js': 'xo --fix'
};
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
2 changes: 0 additions & 2 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
".js"
],
"report-dir": "./coverage",

"temp-dir": "./.nyc_output",
"check-coverage": true,
"lines": 100,
"functions": 100,
"branches": 100,
"reporter": ["lcov", "html", "text"]

}
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
singleQuote: true,
bracketSpacing: true,
trailingComma: 'none'
};
5 changes: 0 additions & 5 deletions .remarkrc

This file was deleted.

3 changes: 3 additions & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: ['preset-github']
};
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .xo-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
prettier: true,
space: true,
extends: ['xo-lass']
};
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Nick Baugh <[email protected]> (http://niftylettuce.com/), Kevin Mårtensson <[email protected]>, and Diego Perini
Copyright (c) 2020 Forward Email LLC, Kevin Mårtensson <[email protected]>, and Diego Perini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# url-regex-safe

[![build status](https://img.shields.io/travis/com/niftylettuce/url-regex-safe.svg)](https://travis-ci.com/niftylettuce/url-regex-safe)
[![code coverage](https://img.shields.io/codecov/c/github/niftylettuce/url-regex-safe.svg)](https://codecov.io/gh/niftylettuce/url-regex-safe)
[![build status](https://github.com/spamscanner/url-regex-safe/actions/workflows/ci.yml/badge.svg)](https://github.com/spamscanner/url-regex-safe/actions/workflows/ci.yml)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
[![license](https://img.shields.io/github/license/niftylettuce/url-regex-safe.svg)](LICENSE)
[![license](https://img.shields.io/github/license/spamscanner/url-regex-safe.svg)](LICENSE)
[![npm downloads](https://img.shields.io/npm/dt/url-regex-safe.svg)](https://npm.im/url-regex-safe)

> Regular expression matching for URL's. Maintained, safe, and browser-friendly version of [url-regex][]. Resolves [CVE-2020-7661][cve] for Node.js servers. Works in Node v10.12.0+ and browsers.
Expand Down Expand Up @@ -146,16 +145,16 @@ Since we cannot use regular expression's "negative lookbehinds" functionality (d

## Contributors

| Name | Website |
| -------------------- | -------------------------- |
| **Nick Baugh** | <http://niftylettuce.com/> |
| **Kevin Mårtensson** | |
| **Diego Perini** | |
| Name | Website |
| --------------------- | -------------------------- |
| **Forward Email LLC** | <https://forwardemail.net> |
| **Kevin Mårtensson** | |
| **Diego Perini** | |


## License

[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)
[MIT](LICENSE) © [Forward Email LLC](https://forwardemail.net)


##
Expand Down
93 changes: 42 additions & 51 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,57 @@
"name": "url-regex-safe",
"description": "Regular expression matching for URL's. Maintained, safe, and browser-friendly version of url-regex. Resolves CVE-2020-7661. Works in Node v10.12.0+ and browsers.",
"version": "3.0.0",
"author": "Nick Baugh <[email protected]> (http://niftylettuce.com/)",
"author": "Forward Email LLC (https://forwardemail.net)",
"browser": {
"re2": false
},
"bugs": {
"url": "https://github.com/niftylettuce/url-regex-safe/issues",
"email": "[email protected]"
"url": "https://github.com/spamscanner/url-regex-safe/issues"
},
"contributors": [
"Nick Baugh <[email protected]> (http://niftylettuce.com/)",
"Forward Email LLC (https://forwardemail.net)",
"Kevin Mårtensson <[email protected]>",
"Diego Perini"
],
"dependencies": {
"ip-regex": "4.3.0",
"tlds": "^1.228.0"
},
"peerDependencies": {
"re2": "^1.17.2"
},
"peerDependenciesMeta": {
"re2": {
"optional": true
}
"tlds": "^1.242.0"
},
"devDependencies": {
"@babel/cli": "^7.16.7",
"@babel/core": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"ava": "latest",
"@babel/cli": "^7.22.10",
"@babel/core": "^7.22.10",
"@babel/eslint-parser": "^7.22.10",
"@babel/preset-env": "^7.22.10",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"ava": "^4.3.0",
"babelify": "^10.0.0",
"browserify": "^17.0.0",
"codecov": "latest",
"cross-env": "latest",
"eslint": "latest",
"eslint-config-xo-lass": "latest",
"eslint-plugin-compat": "^4.0.0",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-xo-lass": "^2.0.1",
"eslint-plugin-compat": "^4.1.4",
"eslint-plugin-node": "^11.1.0",
"fixpack": "latest",
"husky": "latest",
"fixpack": "^4.0.0",
"husky": "^8.0.3",
"jsdom": "15",
"lint-staged": "latest",
"nyc": "latest",
"re2": "latest",
"remark-cli": "latest",
"remark-preset-github": "latest",
"lint-staged": "^14.0.0",
"nyc": "^15.1.0",
"re2": "^1.20.1",
"remark-cli": "^11.0.0",
"remark-preset-github": "^4.0.4",
"rimraf": "^5.0.1",
"tinyify": "^3.0.0",
"xo": "latest"
"xo": "^0.56.0"
},
"engines": {
"node": ">= 10.12.0"
"node": ">= 14"
},
"files": [
"lib",
"dist"
],
"homepage": "https://github.com/niftylettuce/url-regex-safe",
"homepage": "https://github.com/spamscanner/url-regex-safe",
"jsdelivr": "dist/url-regex-safe.min.js",
"keywords": [
"2020",
Expand Down Expand Up @@ -98,35 +90,34 @@
],
"license": "MIT",
"main": "lib/index.js",
"peerDependencies": {
"re2": "^1.20.1"
},
"peerDependenciesMeta": {
"re2": {
"optional": true
}
},
"repository": {
"type": "git",
"url": "https://github.com/niftylettuce/url-regex-safe"
"url": "https://github.com/spamscanner/url-regex-safe"
},
"scripts": {
"ava": "cross-env NODE_ENV=test ava",
"browserify": "browserify src/index.js -o dist/url-regex-safe.js -s urlRegexSafe -g [ babelify --configFile ./.dist.babelrc ]",
"build": "npm run build:clean && npm run build:lib && npm run build:dist",
"build:clean": "rimraf lib dist",
"build:dist": "npm run browserify && npm run minify",
"build:lib": "babel --config-file ./.lib.babelrc src --out-dir lib",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "yarn run lint:js && yarn run lint:md && yarn run lint:lib && yarn run lint:dist",
"lint": "npm run lint:js && npm run lint:md && npm run lint:pkg && npm run lint:lib && npm run lint:dist",
"lint:dist": "eslint --no-inline-config -c .dist.eslintrc dist",
"lint:js": "xo",
"lint:js": "xo --fix",
"lint:lib": "eslint -c .lib.eslintrc lib",
"lint:md": "remark . -qfo",
"lint:pkg": "fixpack",
"minify": "cross-env NODE_ENV=production browserify src/index.js -o dist/url-regex-safe.min.js -s urlRegexSafe -g [ babelify --configFile ./.dist.babelrc ] -p tinyify",
"nyc": "cross-env NODE_ENV=test nyc ava",
"pretest": "yarn run build && yarn run lint",
"test": "cross-env NODE_ENV=test ava",
"test-coverage": "cross-env NODE_ENV=test nyc yarn run test"
"prepare": "husky install",
"pretest": "npm run build && npm run lint",
"test": "cross-env NODE_ENV=test nyc ava"
},
"unpkg": "dist/url-regex-safe.min.js",
"xo": {
"prettier": true,
"space": true,
"extends": [
"xo-lass"
]
}
"unpkg": "dist/url-regex-safe.min.js"
}
6 changes: 3 additions & 3 deletions test/browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');
const { readFileSync } = require('fs');
const { Script } = require('vm');
const path = require('node:path');
const { readFileSync } = require('node:fs');
const { Script } = require('node:vm');
const test = require('ava');
const { JSDOM, VirtualConsole } = require('jsdom');

Expand Down
1 change: 0 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const test = require('ava');

const urlRegex = require('..');

const fixtures = [
Expand Down
Loading

0 comments on commit 283c502

Please sign in to comment.