Skip to content

Commit

Permalink
Bump all dependencies to their latest versison (OctoLinker#1373)
Browse files Browse the repository at this point in the history
* Update all dependencies

* Fix code style after dep update

* Fix unit tests after update

* Update node.js version to v16.x
  • Loading branch information
stefanbuck authored Oct 10, 2021
1 parent 025aa24 commit 2f3d330
Show file tree
Hide file tree
Showing 13 changed files with 2,306 additions and 3,646 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,10 @@ jobs:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '12.x'
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 16
cache: 'yarn'
- run: yarn install
- run: yarn test
- run: yarn build
Expand All @@ -45,4 +37,4 @@ jobs:
path: dist
name: artifact
- uses: maxim-lobanov/setup-xcode@v1
- run: yarn safari-pack
- run: npm run safari-pack
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: 16
- run: yarn install
- run: yarn build
- run: 'yarn release'
Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ module.exports = {
},
testURL: 'http://localhost/',
coverageDirectory: './coverage/',
testEnvironment: 'jsdom',
collectCoverage: true,
};
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "OctoLinker",
"version": "6.8.1",
"engines": {
"node": ">=12.0.0"
"node": ">= 16",
"npm": ">= 7"
},
"scripts": {
"lint": "eslint .",
Expand All @@ -25,49 +26,48 @@
"safari-launch": "open 'safari/build/Release/OctoLinker.app'"
},
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/plugin-proposal-object-rest-spread": "^7.14.5",
"@babel/plugin-transform-react-jsx": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.14.7",
"@babel/core": "^7.15.5",
"@babel/plugin-transform-react-jsx": "^7.14.9",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.15.6",
"assert": "^2.0.0",
"async": "^3.2.0",
"async": "^3.2.1",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^27.0.6",
"babel-jest": "^27.2.4",
"babel-loader": "^8.2.2",
"babel-preset-jest": "^27.0.1",
"babel-preset-jest": "^27.2.0",
"chrome-launch": "^1.1.4",
"chrome-webstore-upload-cli": "^1.2.1",
"chrome-webstore-upload-cli": "^2.0.1",
"copy-webpack-plugin": "^9.0.1",
"css-loader": "^5.2.6",
"css-loader": "^6.3.0",
"dot-json": "^1.2.2",
"dotenv": "^10.0.0",
"eslint": "^7.30.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"jest": "^26.6.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.26.1",
"jest": "^27.2.4",
"jest-fetch-mock": "^3.0.3",
"jest-puppeteer": "^5.0.4",
"jest-puppeteer": "^6.0.0",
"json-loader": "^0.5.7",
"path-browserify": "^1.0.1",
"prettier": "^2.2.1",
"prettier": "^2.4.1",
"process": "^0.11.10",
"puppeteer": "^9.1.1",
"puppeteer": "^10.4.0",
"recursive-readdir": "^2.2.2",
"sinon": "^9.2.4",
"sinon": "^11.1.2",
"stream-browserify": "^3.0.0",
"style-loader": "^2.0.0",
"style-loader": "^3.3.0",
"url": "^0.11.0",
"vm-browserify": "^1.1.2",
"web-ext": "^6.2.0",
"web-ext-submit": "^6.2.0",
"webpack": "^5.44.0",
"webpack-cli": "^4.7.2",
"web-ext": "^6.4.0",
"web-ext-submit": "^6.4.0",
"webpack": "^5.56.1",
"webpack-cli": "^4.8.0",
"webpack-extension-reloader": "^1.1.4"
},
"optionalDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/blob-reader/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ function getParentSha() {

function getPath(el) {
// When current page is a diff view get path from "View" button
let rootSelector = el.parentElement.parentElement.querySelectorAll(
'.file-actions a',
);
let rootSelector =
el.parentElement.parentElement.querySelectorAll('.file-actions a');

// When current diff blob is loaded on-demand get path from "View" button
if (!rootSelector.length) {
rootSelector = el.parentElement.parentElement.parentElement.querySelectorAll(
'.file-actions a',
);
rootSelector =
el.parentElement.parentElement.parentElement.querySelectorAll(
'.file-actions a',
);
}

let ret = $(rootSelector)
Expand Down
12 changes: 7 additions & 5 deletions packages/blob-reader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ function parseBlob(el) {
lines.filter(({ side }) => ['left', 'right'].includes(side)).length > 0;

if (isDiff) {
const diffLineFilter = (type) => ({ side, ...rest }) => {
if ([type, 'context'].includes(side)) {
return { ...rest };
}
};
const diffLineFilter =
(type) =>
({ side, ...rest }) => {
if ([type, 'context'].includes(side)) {
return { ...rest };
}
};

const leftBlob = new Blob({
el,
Expand Down
29 changes: 0 additions & 29 deletions packages/core/__tests__/loader.test.js

This file was deleted.

3 changes: 2 additions & 1 deletion packages/helper-grammar-regex-collection/go.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import escapeRegexString from 'escape-regex-string';
import bylineParser from '@octolinker/helper-parser-byline';

const DOMAIN_REGEX = /^((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}/;
const DOMAIN_REGEX =
/^((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}/;
const ALLOWED_DOMAINS = [
'github.com',
'bitbucket.org',
Expand Down
3 changes: 2 additions & 1 deletion packages/helper-normalise-resolver-results/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const BASE_URL = 'https://github.com';

function isURL(str) {
// RegExp origin https://stackoverflow.com/a/3809435/2121324
const expression = /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;
const expression =
/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;
const urlRegex = new RegExp(expression);

return urlRegex.test(str);
Expand Down
6 changes: 2 additions & 4 deletions packages/ratelimit-notification/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ export const needsTokenForPrivate = () => {
}
},
type: 'info',
body:
'OctoLinker needs a GitHub API token to retrieve repository metadata for private repositories. <a href="#" class="js-octolinker-open-settings">Create a token</a> to enable OctoLinker for all your private repositories. <a href="#" class="js-octolinker-open-settings">Disable OctoLinker for private repositories</a> to get rid of this notification.',
body: 'OctoLinker needs a GitHub API token to retrieve repository metadata for private repositories. <a href="#" class="js-octolinker-open-settings">Create a token</a> to enable OctoLinker for all your private repositories. <a href="#" class="js-octolinker-open-settings">Disable OctoLinker for private repositories</a> to get rid of this notification.',
});
};

Expand All @@ -91,7 +90,6 @@ export const tokenIsInvalid = () => {
}
},
type: 'error',
body:
'The token you provided is invalid. You must <a href="#" class="js-octolinker-open-settings">create a new token</a> before you can continue using OctoLinker.',
body: 'The token you provided is invalid. You must <a href="#" class="js-octolinker-open-settings">create a new token</a> before you can continue using OctoLinker.',
});
};
9 changes: 3 additions & 6 deletions packages/resolver-hoogle-search/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ describe('hoogle-search', () => {
it('returns url', async () => {
response = [
{
url:
'https://hackage.haskell.org/package/base-4.11.1.0/docs/Data-Typeable.html',
url: 'https://hackage.haskell.org/package/base-4.11.1.0/docs/Data-Typeable.html',
},
];

Expand All @@ -42,12 +41,10 @@ describe('hoogle-search', () => {
it('returns hoogle search page when search returns more than one result', async () => {
response = [
{
url:
'https://hackage.haskell.org/package/base-4.11.1.0/docs/Data-Typeable.html',
url: 'https://hackage.haskell.org/package/base-4.11.1.0/docs/Data-Typeable.html',
},
{
url:
'https://hackage.haskell.org/package/base-4.11.1.0/docs/Data-Typeable.html',
url: 'https://hackage.haskell.org/package/base-4.11.1.0/docs/Data-Typeable.html',
},
];

Expand Down
6 changes: 2 additions & 4 deletions packages/user-interface/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ export const showNotification = ({
};

const icons = {
info:
'<svg style="pointer-events: none;" class="octicon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm6.5-.25A.75.75 0 017.25 7h1a.75.75 0 01.75.75v2.75h.25a.75.75 0 010 1.5h-2a.75.75 0 010-1.5h.25v-2h-.25a.75.75 0 01-.75-.75zM8 6a1 1 0 100-2 1 1 0 000 2z"></path></svg>',
info: '<svg style="pointer-events: none;" class="octicon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm6.5-.25A.75.75 0 017.25 7h1a.75.75 0 01.75.75v2.75h.25a.75.75 0 010 1.5h-2a.75.75 0 010-1.5h.25v-2h-.25a.75.75 0 01-.75-.75zM8 6a1 1 0 100-2 1 1 0 000 2z"></path></svg>',
success:
'<svg style="pointer-events: none;" class="octicon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>',
warn:
'<svg style="pointer-events: none;" class="octicon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg>',
warn: '<svg style="pointer-events: none;" class="octicon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg>',
error:
'<svg style="pointer-events: none;" class="octicon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M1.5 8a6.5 6.5 0 0110.535-5.096l-9.131 9.131A6.472 6.472 0 011.5 8zm2.465 5.096a6.5 6.5 0 009.131-9.131l-9.131 9.131zM8 0a8 8 0 100 16A8 8 0 008 0z"></path></svg>',
};
Expand Down
Loading

0 comments on commit 2f3d330

Please sign in to comment.