Skip to content

Commit

Permalink
Merge pull request #354 from Hypercontext/v4.0
Browse files Browse the repository at this point in the history
v4.0
  • Loading branch information
Nick Frasser authored Sep 19, 2022
2 parents 3eb5b8a + 398f5a1 commit 0bb8eef
Show file tree
Hide file tree
Showing 120 changed files with 6,687 additions and 4,964 deletions.
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
*/lib/*
*/dist/*

# Usually auto-generated
**/index.js
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
},
"rules": {
"curly": 2,
"eqeqeq": 2,
"no-eq-null": 2,
"eqeqeq": ["error", "smart"],
"quotes": [2, "single", "avoid-escape"],
"semi": 2,
"no-unused-vars": [ "error", { "varsIgnorePattern": "should|expect" }],
Expand Down
61 changes: 39 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,61 @@ on:
branches: [ main ]

jobs:
build:

unit:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]

node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.node-version }}-build-
${{ runner.os }}-${{ matrix.node-version }}-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- name: "Setup tests"
run: bash test/setup.sh
- name: "Run basic tests"
run: bash test/run.sh

integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
cache: 'npm'
- run: npm install
- run: bash test/setup.sh ${{ matrix.node-version }}
- run: bash test/run.sh ${{ matrix.node-version }}
- name: "Setup dist"
run: bash test/setup.sh --dist
- name: "Run complete test suite"
run: bash test/run.sh --dist
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

publish:
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: integration
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
cache: 'npm'
- run: npm install
- run: npm publish --workspaces
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm dist:postpublish
- uses: actions/upload-artifact@v2
with:
name: linkify
path: dist/
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Linkify Changelog

## v4.0.0

### Breaking Changes
* Removed deprecated `linkifyjs/string`, `linkifyjs/html`, `linkifyjs/plugins/*`
packages. Use `linkify-string`, `linkify-html` and `linkify-plugin-*` instead.
* Refactored scanner internals break custom link plugins created with Linkify v3
* Links that begin with `mailto:` now have type `url` instead of `email`
* Drop official IE 11 support

### Added
* `linkify-plugin-ip` plugin for detecting IPv4 and IPv6 addresses
* `linkify-plugin-keyword` plugin for detecting arbitrary keywords
* `linkify.find()` function accepts an `options` argument for output formatting
* New `render` option to override link rendering
* Second `optionalSlashSlash` argument for `registerCustomProtocol` to allow links that don't require `//` after `scheme:`
* Link token methods `toFormattedString(options)`, `toFormattedHref(options)` and `toFormattedObject(options)` that accept a `linkify.Options` object
* More granular scanner tokens for improved plugin flexibility
* `linkify-react`: New `as` property (alias for `tagName`)

### Fixed
* Improved link detection with mixed languages
* Consistent option availability across interfaces (including `truncate`)
* `linkify-html`: Improved HTML entity parsing

## v3.0.5

* Fix potential Cross-Site Scripting issue when using `linkify-html`
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = (api) => {
'@babel/preset-env',
{
useBuiltIns: false,
loose: true,
targets: {
node: '10',
browsers: [
Expand Down
Loading

0 comments on commit 0bb8eef

Please sign in to comment.