Skip to content

Commit 283c502

Browse files
committedAug 15, 2023
feat: modernize configs, bump deps
1 parent ad2a39b commit 283c502

24 files changed

+95
-9903
lines changed
 

Diff for: ‎.commitlintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional']
3+
};

Diff for: ‎.commitlintrc.json

-5
This file was deleted.

Diff for: ‎.dist.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"presets": [
33
["@babel/env", {
44
"targets": {
5-
"browsers": [ "> 1%", "last 2 versions" ]
5+
"browsers": [ "defaults, not ie 11" ]
66
}
77
}]
88
]

Diff for: ‎.dist.eslintrc

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
{
22
"extends": ["eslint:recommended"],
3+
"parser": "@babel/eslint-parser",
4+
"parserOptions": {
5+
"requireConfigFile": false,
6+
"babelOptions": {
7+
"babelrc": false,
8+
"configFile": false,
9+
"presets": ["@babel/preset-env"]
10+
}
11+
},
312
"env": {
413
"node": false,
514
"browser": true,

Diff for: ‎.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.*.js

Diff for: ‎.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* text=auto
1+
* text=auto eol=lf

Diff for: ‎.github/FUNDING.yml

-4
This file was deleted.

Diff for: ‎.gitignore

+9-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
1-
# OS #
2-
###################
31
.DS_Store
2+
*.log
43
.idea
5-
Thumbs.db
6-
tmp/
7-
temp/
8-
9-
10-
# Node.js #
11-
###################
124
node_modules
13-
14-
15-
# NYC #
16-
###################
175
coverage
18-
*.lcov
196
.nyc_output
7+
locales/
8+
package-lock.json
9+
yarn.lock
2010

21-
22-
# Files #
23-
###################
24-
*.log
11+
Thumbs.db
12+
tmp/
13+
temp/
14+
*.lcov
15+
.env
2516
lib
2617
dist

Diff for: ‎.lib.babelrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"presets": [
33
["@babel/env", {
44
"targets": {
5-
"node": "10.12.0",
6-
"browsers": [ "> 1%", "last 2 versions" ]
5+
"node": "14",
6+
"browsers": [ "defaults, not ie 11" ]
77
}
88
}]
99
],

Diff for: ‎.lintstagedrc.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module.exports = {
2-
"*.md,!test/**/*.md": [
3-
filenames => filenames.map(filename => `remark ${filename} -qfo`)
4-
],
2+
'*.md': (filenames) => filenames.map((filename) => `remark ${filename} -qfo`),
53
'package.json': 'fixpack',
64
'*.js': 'xo --fix'
75
};

Diff for: ‎.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

Diff for: ‎.nycrc

-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
".js"
44
],
55
"report-dir": "./coverage",
6-
76
"temp-dir": "./.nyc_output",
87
"check-coverage": true,
98
"lines": 100,
109
"functions": 100,
1110
"branches": 100,
1211
"reporter": ["lcov", "html", "text"]
13-
1412
}

Diff for: ‎.prettierrc

-5
This file was deleted.

Diff for: ‎.prettierrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
singleQuote: true,
3+
bracketSpacing: true,
4+
trailingComma: 'none'
5+
};

Diff for: ‎.remarkrc

-5
This file was deleted.

Diff for: ‎.remarkrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
plugins: ['preset-github']
3+
};

Diff for: ‎.travis.yml

-9
This file was deleted.

Diff for: ‎.xo-config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
prettier: true,
3+
space: true,
4+
extends: ['xo-lass']
5+
};

Diff for: ‎LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/), Kevin Mårtensson <kevinmartensson@gmail.com>, and Diego Perini
3+
Copyright (c) 2020 Forward Email LLC, Kevin Mårtensson <kevinmartensson@gmail.com>, and Diego Perini
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: ‎README.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# url-regex-safe
22

3-
[![build status](https://img.shields.io/travis/com/niftylettuce/url-regex-safe.svg)](https://travis-ci.com/niftylettuce/url-regex-safe)
4-
[![code coverage](https://img.shields.io/codecov/c/github/niftylettuce/url-regex-safe.svg)](https://codecov.io/gh/niftylettuce/url-regex-safe)
3+
[![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)
54
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
65
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
76
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
8-
[![license](https://img.shields.io/github/license/niftylettuce/url-regex-safe.svg)](LICENSE)
7+
[![license](https://img.shields.io/github/license/spamscanner/url-regex-safe.svg)](LICENSE)
98
[![npm downloads](https://img.shields.io/npm/dt/url-regex-safe.svg)](https://npm.im/url-regex-safe)
109

1110
> 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.
@@ -146,16 +145,16 @@ Since we cannot use regular expression's "negative lookbehinds" functionality (d
146145

147146
## Contributors
148147

149-
| Name | Website |
150-
| -------------------- | -------------------------- |
151-
| **Nick Baugh** | <http://niftylettuce.com/> |
152-
| **Kevin Mårtensson** | |
153-
| **Diego Perini** | |
148+
| Name | Website |
149+
| --------------------- | -------------------------- |
150+
| **Forward Email LLC** | <https://forwardemail.net> |
151+
| **Kevin Mårtensson** | |
152+
| **Diego Perini** | |
154153

155154

156155
## License
157156

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

160159

161160
##

Diff for: ‎package.json

+42-51
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,57 @@
22
"name": "url-regex-safe",
33
"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.",
44
"version": "3.0.0",
5-
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
5+
"author": "Forward Email LLC (https://forwardemail.net)",
66
"browser": {
77
"re2": false
88
},
99
"bugs": {
10-
"url": "https://github.com/niftylettuce/url-regex-safe/issues",
11-
"email": "niftylettuce@gmail.com"
10+
"url": "https://github.com/spamscanner/url-regex-safe/issues"
1211
},
1312
"contributors": [
14-
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
13+
"Forward Email LLC (https://forwardemail.net)",
1514
"Kevin Mårtensson <kevinmartensson@gmail.com>",
1615
"Diego Perini"
1716
],
1817
"dependencies": {
1918
"ip-regex": "4.3.0",
20-
"tlds": "^1.228.0"
21-
},
22-
"peerDependencies": {
23-
"re2": "^1.17.2"
24-
},
25-
"peerDependenciesMeta": {
26-
"re2": {
27-
"optional": true
28-
}
19+
"tlds": "^1.242.0"
2920
},
3021
"devDependencies": {
31-
"@babel/cli": "^7.16.7",
32-
"@babel/core": "^7.16.7",
33-
"@babel/preset-env": "^7.16.7",
34-
"@commitlint/cli": "latest",
35-
"@commitlint/config-conventional": "latest",
36-
"ava": "latest",
22+
"@babel/cli": "^7.22.10",
23+
"@babel/core": "^7.22.10",
24+
"@babel/eslint-parser": "^7.22.10",
25+
"@babel/preset-env": "^7.22.10",
26+
"@commitlint/cli": "^17.7.1",
27+
"@commitlint/config-conventional": "^17.7.0",
28+
"ava": "^4.3.0",
3729
"babelify": "^10.0.0",
3830
"browserify": "^17.0.0",
39-
"codecov": "latest",
40-
"cross-env": "latest",
41-
"eslint": "latest",
42-
"eslint-config-xo-lass": "latest",
43-
"eslint-plugin-compat": "^4.0.0",
31+
"cross-env": "^7.0.3",
32+
"eslint": "^8.47.0",
33+
"eslint-config-xo-lass": "^2.0.1",
34+
"eslint-plugin-compat": "^4.1.4",
4435
"eslint-plugin-node": "^11.1.0",
45-
"fixpack": "latest",
46-
"husky": "latest",
36+
"fixpack": "^4.0.0",
37+
"husky": "^8.0.3",
4738
"jsdom": "15",
48-
"lint-staged": "latest",
49-
"nyc": "latest",
50-
"re2": "latest",
51-
"remark-cli": "latest",
52-
"remark-preset-github": "latest",
39+
"lint-staged": "^14.0.0",
40+
"nyc": "^15.1.0",
41+
"re2": "^1.20.1",
42+
"remark-cli": "^11.0.0",
43+
"remark-preset-github": "^4.0.4",
44+
"rimraf": "^5.0.1",
5345
"tinyify": "^3.0.0",
54-
"xo": "latest"
46+
"xo": "^0.56.0"
5547
},
5648
"engines": {
57-
"node": ">= 10.12.0"
49+
"node": ">= 14"
5850
},
5951
"files": [
6052
"lib",
6153
"dist"
6254
],
63-
"homepage": "https://github.com/niftylettuce/url-regex-safe",
55+
"homepage": "https://github.com/spamscanner/url-regex-safe",
6456
"jsdelivr": "dist/url-regex-safe.min.js",
6557
"keywords": [
6658
"2020",
@@ -98,35 +90,34 @@
9890
],
9991
"license": "MIT",
10092
"main": "lib/index.js",
93+
"peerDependencies": {
94+
"re2": "^1.20.1"
95+
},
96+
"peerDependenciesMeta": {
97+
"re2": {
98+
"optional": true
99+
}
100+
},
101101
"repository": {
102102
"type": "git",
103-
"url": "https://github.com/niftylettuce/url-regex-safe"
103+
"url": "https://github.com/spamscanner/url-regex-safe"
104104
},
105105
"scripts": {
106-
"ava": "cross-env NODE_ENV=test ava",
107106
"browserify": "browserify src/index.js -o dist/url-regex-safe.js -s urlRegexSafe -g [ babelify --configFile ./.dist.babelrc ]",
108107
"build": "npm run build:clean && npm run build:lib && npm run build:dist",
109108
"build:clean": "rimraf lib dist",
110109
"build:dist": "npm run browserify && npm run minify",
111110
"build:lib": "babel --config-file ./.lib.babelrc src --out-dir lib",
112-
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
113-
"lint": "yarn run lint:js && yarn run lint:md && yarn run lint:lib && yarn run lint:dist",
111+
"lint": "npm run lint:js && npm run lint:md && npm run lint:pkg && npm run lint:lib && npm run lint:dist",
114112
"lint:dist": "eslint --no-inline-config -c .dist.eslintrc dist",
115-
"lint:js": "xo",
113+
"lint:js": "xo --fix",
116114
"lint:lib": "eslint -c .lib.eslintrc lib",
117115
"lint:md": "remark . -qfo",
116+
"lint:pkg": "fixpack",
118117
"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",
119-
"nyc": "cross-env NODE_ENV=test nyc ava",
120-
"pretest": "yarn run build && yarn run lint",
121-
"test": "cross-env NODE_ENV=test ava",
122-
"test-coverage": "cross-env NODE_ENV=test nyc yarn run test"
118+
"prepare": "husky install",
119+
"pretest": "npm run build && npm run lint",
120+
"test": "cross-env NODE_ENV=test nyc ava"
123121
},
124-
"unpkg": "dist/url-regex-safe.min.js",
125-
"xo": {
126-
"prettier": true,
127-
"space": true,
128-
"extends": [
129-
"xo-lass"
130-
]
131-
}
122+
"unpkg": "dist/url-regex-safe.min.js"
132123
}

Diff for: ‎test/browser.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const path = require('path');
2-
const { readFileSync } = require('fs');
3-
const { Script } = require('vm');
1+
const path = require('node:path');
2+
const { readFileSync } = require('node:fs');
3+
const { Script } = require('node:vm');
44
const test = require('ava');
55
const { JSDOM, VirtualConsole } = require('jsdom');
66

Diff for: ‎test/test.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const test = require('ava');
2-
32
const urlRegex = require('..');
43

54
const fixtures = [

Diff for: ‎yarn.lock

-9,783
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.