Merge pull request #408 from rtfpessoa/bump-dependencies

bump: Update all dependencies
This commit is contained in:
Rodrigo Fernandes 2021-10-15 21:55:55 +01:00 committed by GitHub
commit 1e0921c621
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1159 additions and 1124 deletions

View file

@ -85,60 +85,60 @@
"hogan.js": "3.0.2" "hogan.js": "3.0.2"
}, },
"optionalDependencies": { "optionalDependencies": {
"highlight.js": "11.1.0" "highlight.js": "11.2.0"
}, },
"devDependencies": { "devDependencies": {
"@types/copy-webpack-plugin": "8.0.1", "@types/copy-webpack-plugin": "8.0.1",
"@types/diff": "5.0.1", "@types/diff": "5.0.1",
"@types/hogan.js": "3.0.1", "@types/hogan.js": "3.0.1",
"@types/jest": "26.0.24", "@types/jest": "27.0.2",
"@types/mini-css-extract-plugin": "^2.0.1", "@types/mini-css-extract-plugin": "^2.3.0",
"@types/mkdirp": "1.0.2", "@types/mkdirp": "1.0.2",
"@types/node": "16.4.1", "@types/node": "16.11.0",
"@types/nopt": "3.0.29", "@types/nopt": "3.0.29",
"@typescript-eslint/eslint-plugin": "4.28.4", "@typescript-eslint/eslint-plugin": "5.0.0",
"@typescript-eslint/parser": "4.28.4", "@typescript-eslint/parser": "5.0.0",
"autoprefixer": "10.3.1", "autoprefixer": "10.3.7",
"bulma": "^0.9.2", "bulma": "^0.9.2",
"clipboard": "2.0.8", "clipboard": "2.0.8",
"copy-webpack-plugin": "9.0.1", "copy-webpack-plugin": "9.0.1",
"css-loader": "6.2.0", "css-loader": "6.4.0",
"cssnano": "5.0.7", "cssnano": "5.0.8",
"eslint": "7.31.0", "eslint": "8.0.1",
"eslint-config-prettier": "8.3.0", "eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.23.4", "eslint-plugin-import": "2.25.2",
"eslint-plugin-jest": "24.4.0", "eslint-plugin-jest": "25.2.1",
"eslint-plugin-json": "3.0.0", "eslint-plugin-json": "3.1.0",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-optimize-regex": "1.2.0", "eslint-plugin-optimize-regex": "1.2.1",
"eslint-plugin-promise": "5.1.0", "eslint-plugin-promise": "5.1.0",
"eslint-plugin-sonarjs": "0.9.1", "eslint-plugin-sonarjs": "0.10.0",
"file-loader": "6.2.0", "file-loader": "6.2.0",
"handlebars": "4.7.7", "handlebars": "4.7.7",
"handlebars-loader": "1.7.1", "handlebars-loader": "1.7.1",
"html-webpack-plugin": "5.3.2", "html-webpack-plugin": "5.4.0",
"husky": "^7.0.1", "husky": "^7.0.2",
"image-webpack-loader": "7.0.1", "image-webpack-loader": "8.0.1",
"is-ci-cli": "2.2.0", "is-ci-cli": "2.2.0",
"jest": "27.0.6", "jest": "27.2.5",
"lint-staged": "11.1.0", "lint-staged": "11.2.3",
"markdown-toc": "^1.2.0", "markdown-toc": "^1.2.0",
"mini-css-extract-plugin": "2.1.0", "mini-css-extract-plugin": "2.4.2",
"mkdirp": "1.0.4", "mkdirp": "1.0.4",
"nopt": "5.0.0", "nopt": "5.0.0",
"postcss": "8.3.6", "postcss": "8.3.9",
"postcss-cli": "8.3.1", "postcss-cli": "9.0.1",
"postcss-import": "14.0.2", "postcss-import": "14.0.2",
"postcss-loader": "6.1.1", "postcss-loader": "6.2.0",
"postcss-preset-env": "6.7.0", "postcss-preset-env": "6.7.0",
"prettier": "2.3.2", "prettier": "2.4.1",
"ts-jest": "27.0.4", "ts-jest": "27.0.6",
"ts-loader": "9.2.3", "ts-loader": "9.2.6",
"ts-node": "10.1.0", "ts-node": "10.3.0",
"typescript": "4.3.5", "typescript": "4.4.4",
"url-loader": "4.1.1", "url-loader": "4.1.1",
"webpack": "5.46.0", "webpack": "5.58.2",
"webpack-cli": "4.7.2", "webpack-cli": "4.9.0",
"whatwg-fetch": "3.6.2" "whatwg-fetch": "3.6.2"
}, },
"resolutions": { "resolutions": {

View file

@ -5,31 +5,31 @@ describe('Utils', () => {
describe('escapeForHtml', () => { describe('escapeForHtml', () => {
it('should escape & with &', () => { it('should escape & with &', () => {
const result = escapeForHtml('&'); const result = escapeForHtml('&');
expect(result).toEqual('&'); expect(result).toBe('&');
}); });
it('should escape < with &lt;', () => { it('should escape < with &lt;', () => {
const result = escapeForHtml('<'); const result = escapeForHtml('<');
expect(result).toEqual('&lt;'); expect(result).toBe('&lt;');
}); });
it('should escape > with &gt;', () => { it('should escape > with &gt;', () => {
const result = escapeForHtml('>'); const result = escapeForHtml('>');
expect(result).toEqual('&gt;'); expect(result).toBe('&gt;');
}); });
it('should escape " with &quot;', () => { it('should escape " with &quot;', () => {
const result = escapeForHtml('"'); const result = escapeForHtml('"');
expect(result).toEqual('&quot;'); expect(result).toBe('&quot;');
}); });
it("should escape ' with &#x27;", () => { it("should escape ' with &#x27;", () => {
const result = escapeForHtml("'"); const result = escapeForHtml("'");
expect(result).toEqual('&#x27;'); expect(result).toBe('&#x27;');
}); });
it('should escape / with &#x2F;', () => { it('should escape / with &#x2F;', () => {
const result = escapeForHtml('/'); const result = escapeForHtml('/');
expect(result).toEqual('&#x2F;'); expect(result).toBe('&#x2F;');
}); });
it('should escape a string containing HTML code', () => { it('should escape a string containing HTML code', () => {
const result = escapeForHtml(`<a href="/search?q=diff2html">Search 'Diff2Html'</a>`); const result = escapeForHtml(`<a href="/search?q=diff2html">Search 'Diff2Html'</a>`);
expect(result).toEqual( expect(result).toBe(
'&lt;a href=&quot;&#x2F;search?q=diff2html&quot;&gt;Search &#x27;Diff2Html&#x27;&lt;&#x2F;a&gt;', '&lt;a href=&quot;&#x2F;search?q=diff2html&quot;&gt;Search &#x27;Diff2Html&#x27;&lt;&#x2F;a&gt;',
); );
}); });
@ -41,7 +41,7 @@ describe('Utils', () => {
oldName: 'sample.js', oldName: 'sample.js',
newName: 'sample.js', newName: 'sample.js',
}); });
expect(result).toEqual('d2h-960013'); expect(result).toBe('d2h-960013');
}); });
}); });
@ -51,49 +51,49 @@ describe('Utils', () => {
oldName: 'sample.js', oldName: 'sample.js',
newName: 'sample.js', newName: 'sample.js',
}); });
expect(result).toEqual('sample.js'); expect(result).toBe('sample.js');
}); });
it('should generate the file name for a changed file and full rename', () => { it('should generate the file name for a changed file and full rename', () => {
const result = filenameDiff({ const result = filenameDiff({
oldName: 'sample1.js', oldName: 'sample1.js',
newName: 'sample2.js', newName: 'sample2.js',
}); });
expect(result).toEqual('sample1.js → sample2.js'); expect(result).toBe('sample1.js → sample2.js');
}); });
it('should generate the file name for a changed file and prefix rename', () => { it('should generate the file name for a changed file and prefix rename', () => {
const result = filenameDiff({ const result = filenameDiff({
oldName: 'src/path/sample.js', oldName: 'src/path/sample.js',
newName: 'source/path/sample.js', newName: 'source/path/sample.js',
}); });
expect(result).toEqual('{src → source}/path/sample.js'); expect(result).toBe('{src → source}/path/sample.js');
}); });
it('should generate the file name for a changed file and suffix rename', () => { it('should generate the file name for a changed file and suffix rename', () => {
const result = filenameDiff({ const result = filenameDiff({
oldName: 'src/path/sample1.js', oldName: 'src/path/sample1.js',
newName: 'src/path/sample2.js', newName: 'src/path/sample2.js',
}); });
expect(result).toEqual('src/path/{sample1.js → sample2.js}'); expect(result).toBe('src/path/{sample1.js → sample2.js}');
}); });
it('should generate the file name for a changed file and middle rename', () => { it('should generate the file name for a changed file and middle rename', () => {
const result = filenameDiff({ const result = filenameDiff({
oldName: 'src/really/big/path/sample.js', oldName: 'src/really/big/path/sample.js',
newName: 'src/small/path/sample.js', newName: 'src/small/path/sample.js',
}); });
expect(result).toEqual('src/{really/big → small}/path/sample.js'); expect(result).toBe('src/{really/big → small}/path/sample.js');
}); });
it('should generate the file name for a deleted file', () => { it('should generate the file name for a deleted file', () => {
const result = filenameDiff({ const result = filenameDiff({
oldName: 'src/my/file.js', oldName: 'src/my/file.js',
newName: '/dev/null', newName: '/dev/null',
}); });
expect(result).toEqual('src/my/file.js'); expect(result).toBe('src/my/file.js');
}); });
it('should generate the file name for a new file', () => { it('should generate the file name for a new file', () => {
const result = filenameDiff({ const result = filenameDiff({
oldName: '/dev/null', oldName: '/dev/null',
newName: 'src/my/file.js', newName: 'src/my/file.js',
}); });
expect(result).toEqual('src/my/file.js'); expect(result).toBe('src/my/file.js');
}); });
}); });

View file

@ -4,18 +4,18 @@ describe('Utils', () => {
describe('escapeForRegExp', () => { describe('escapeForRegExp', () => {
it('should escape markdown link text', () => { it('should escape markdown link text', () => {
const result = escapeForRegExp('[Link](https://diff2html.xyz)'); const result = escapeForRegExp('[Link](https://diff2html.xyz)');
expect(result).toEqual('\\[Link\\]\\(https:\\/\\/diff2html\\.xyz\\)'); expect(result).toBe('\\[Link\\]\\(https:\\/\\/diff2html\\.xyz\\)');
}); });
it('should escape all dangerous characters', () => { it('should escape all dangerous characters', () => {
const result = escapeForRegExp('-[]/{}()*+?.\\^$|'); const result = escapeForRegExp('-[]/{}()*+?.\\^$|');
expect(result).toEqual('\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|'); expect(result).toBe('\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|');
}); });
}); });
describe('unifyPath', () => { describe('unifyPath', () => {
it('should unify windows style path', () => { it('should unify windows style path', () => {
const result = unifyPath('\\Users\\Downloads\\diff.html'); const result = unifyPath('\\Users\\Downloads\\diff.html');
expect(result).toEqual('/Users/Downloads/diff.html'); expect(result).toBe('/Users/Downloads/diff.html');
}); });
}); });

View file

@ -11,6 +11,8 @@ type Plugin = ((this: webpack.Compiler, compiler: webpack.Compiler) => void) | w
function plugins(page: string): Plugin[] { function plugins(page: string): Plugin[] {
return [ return [
//eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: '[name].css', filename: '[name].css',
chunkFilename: '[id].css', chunkFilename: '[id].css',
@ -37,6 +39,8 @@ function plugins(page: string): Plugin[] {
minifyURLs: true, minifyURLs: true,
}, },
}), }),
//eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
new CopyWebpackPlugin({ new CopyWebpackPlugin({
patterns: [ patterns: [
{ from: 'website/favicon.ico', to: 'favicon.ico' }, { from: 'website/favicon.ico', to: 'favicon.ico' },

2181
yarn.lock

File diff suppressed because it is too large Load diff