Skip to content

Commit 0bb8eef

Browse files
author
Nick Frasser
authored
Merge pull request #354 from Hypercontext/v4.0
v4.0
2 parents 3eb5b8a + 398f5a1 commit 0bb8eef

File tree

120 files changed

+6687
-4964
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+6687
-4964
lines changed

.eslintignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
*/lib/*
22
*/dist/*
3-
4-
# Usually auto-generated
5-
**/index.js

.eslintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
},
1515
"rules": {
1616
"curly": 2,
17-
"eqeqeq": 2,
18-
"no-eq-null": 2,
17+
"eqeqeq": ["error", "smart"],
1918
"quotes": [2, "single", "avoid-escape"],
2019
"semi": 2,
2120
"no-unused-vars": [ "error", { "varsIgnorePattern": "should|expect" }],

.github/workflows/ci.yml

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,61 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
build:
11-
10+
unit:
1211
runs-on: ubuntu-latest
13-
1412
strategy:
1513
matrix:
16-
node-version: [10.x, 12.x, 14.x, 16.x]
17-
14+
node-version: [10.x, 12.x, 14.x]
1815
steps:
1916
- uses: actions/checkout@v2
20-
21-
- name: Cache node modules
22-
uses: actions/cache@v2
23-
env:
24-
cache-name: cache-node-modules
25-
with:
26-
# npm cache files are stored in `~/.npm` on Linux/macOS
27-
path: ~/.npm
28-
key: ${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
29-
restore-keys: |
30-
${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-
31-
${{ runner.os }}-${{ matrix.node-version }}-build-
32-
${{ runner.os }}-${{ matrix.node-version }}-
33-
3417
- name: Use Node.js ${{ matrix.node-version }}
3518
uses: actions/setup-node@v2
3619
with:
3720
node-version: ${{ matrix.node-version }}
21+
cache: 'npm'
22+
- run: npm install
23+
- name: "Setup tests"
24+
run: bash test/setup.sh
25+
- name: "Run basic tests"
26+
run: bash test/run.sh
3827

28+
integration:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- uses: actions/setup-node@v2
33+
with:
34+
node-version: '16.x'
35+
cache: 'npm'
3936
- run: npm install
40-
- run: bash test/setup.sh ${{ matrix.node-version }}
41-
- run: bash test/run.sh ${{ matrix.node-version }}
37+
- name: "Setup dist"
38+
run: bash test/setup.sh --dist
39+
- name: "Run complete test suite"
40+
run: bash test/run.sh --dist
4241
env:
4342
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
4443
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
45-
4644
- name: Coveralls GitHub Action
4745
uses: coverallsapp/[email protected]
4846
with:
4947
github-token: ${{ secrets.GITHUB_TOKEN }}
5048

49+
publish:
50+
runs-on: ubuntu-latest
51+
if: "startsWith(github.ref, 'refs/tags/')"
52+
needs: integration
53+
steps:
54+
- uses: actions/checkout@v2
55+
- uses: actions/setup-node@v2
56+
with:
57+
node-version: '16.x'
58+
cache: 'npm'
59+
- run: npm install
60+
- run: npm publish --workspaces
61+
env:
62+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
63+
- run: npm dist:postpublish
64+
- uses: actions/upload-artifact@v2
65+
with:
66+
name: linkify
67+
path: dist/

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Linkify Changelog
22

3+
## v4.0.0
4+
5+
### Breaking Changes
6+
* Removed deprecated `linkifyjs/string`, `linkifyjs/html`, `linkifyjs/plugins/*`
7+
packages. Use `linkify-string`, `linkify-html` and `linkify-plugin-*` instead.
8+
* Refactored scanner internals break custom link plugins created with Linkify v3
9+
* Links that begin with `mailto:` now have type `url` instead of `email`
10+
* Drop official IE 11 support
11+
12+
### Added
13+
* `linkify-plugin-ip` plugin for detecting IPv4 and IPv6 addresses
14+
* `linkify-plugin-keyword` plugin for detecting arbitrary keywords
15+
* `linkify.find()` function accepts an `options` argument for output formatting
16+
* New `render` option to override link rendering
17+
* Second `optionalSlashSlash` argument for `registerCustomProtocol` to allow links that don't require `//` after `scheme:`
18+
* Link token methods `toFormattedString(options)`, `toFormattedHref(options)` and `toFormattedObject(options)` that accept a `linkify.Options` object
19+
* More granular scanner tokens for improved plugin flexibility
20+
* `linkify-react`: New `as` property (alias for `tagName`)
21+
22+
### Fixed
23+
* Improved link detection with mixed languages
24+
* Consistent option availability across interfaces (including `truncate`)
25+
* `linkify-html`: Improved HTML entity parsing
26+
327
## v3.0.5
428

529
* Fix potential Cross-Site Scripting issue when using `linkify-html`

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = (api) => {
77
'@babel/preset-env',
88
{
99
useBuiltIns: false,
10+
loose: true,
1011
targets: {
1112
node: '10',
1213
browsers: [

0 commit comments

Comments
 (0)