Merge pull request #1132 from palash-signoz/commitlint

feat: commit lint is added in the frontend
This commit is contained in:
palash-signoz 2022-05-19 13:29:24 +05:30 committed by GitHub
commit ec3fed05bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 2322 additions and 1757 deletions

4
frontend/.husky/commit-msg Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
cd frontend && npm run commitlint

View File

@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };

View File

@ -15,7 +15,8 @@
"jest:coverage": "jest --coverage", "jest:coverage": "jest --coverage",
"jest:watch": "jest --watch", "jest:watch": "jest --watch",
"postinstall": "yarn husky:configure", "postinstall": "yarn husky:configure",
"husky:configure": "cd .. && husky install frontend/.husky" "husky:configure": "cd .. && husky install frontend/.husky && cd frontend && chmod ug+x .husky/*",
"commitlint": "commitlint --edit $1"
}, },
"engines": { "engines": {
"node": ">=12.13.0" "node": ">=12.13.0"
@ -109,6 +110,8 @@
"@babel/preset-env": "^7.12.17", "@babel/preset-env": "^7.12.17",
"@babel/preset-react": "^7.12.13", "@babel/preset-react": "^7.12.13",
"@babel/preset-typescript": "^7.12.17", "@babel/preset-typescript": "^7.12.17",
"@commitlint/cli": "^16.2.4",
"@commitlint/config-conventional": "^16.2.4",
"@jest/globals": "^27.5.1", "@jest/globals": "^27.5.1",
"@testing-library/cypress": "^8.0.0", "@testing-library/cypress": "^8.0.0",
"@testing-library/react-hooks": "^7.0.2", "@testing-library/react-hooks": "^7.0.2",

View File

@ -30,6 +30,9 @@
"./__mocks__", "./__mocks__",
"./conf/default.conf", "./conf/default.conf",
"./public", "./public",
"./cypress" "./cypress",
"./commitlint.config.js",
"./webpack.config.js",
"./webpack.config.prod.js"
] ]
} }

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// shared config (dev and prod) // shared config (dev and prod)
const { resolve } = require('path'); const { resolve } = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
@ -5,8 +6,7 @@ const portFinderSync = require('portfinder-sync');
const dotenv = require('dotenv'); const dotenv = require('dotenv');
const webpack = require('webpack'); const webpack = require('webpack');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
.BundleAnalyzerPlugin;
dotenv.config(); dotenv.config();
@ -106,7 +106,7 @@ const config = {
}, },
], ],
}, },
plugins: plugins, plugins,
performance: { performance: {
hints: false, hints: false,
}, },

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/explicit-function-return-type */ /* eslint-disable @typescript-eslint/explicit-function-return-type */
// shared config (dev and prod) // shared config (dev and prod)
const { resolve } = require('path'); const { resolve } = require('path');
@ -9,8 +10,7 @@ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
.BundleAnalyzerPlugin;
const Critters = require('critters-webpack-plugin'); const Critters = require('critters-webpack-plugin');
const plugins = [ const plugins = [
@ -119,13 +119,13 @@ const config = {
}, },
], ],
}, },
plugins: plugins, plugins,
optimization: { optimization: {
chunkIds: 'named', chunkIds: 'named',
concatenateModules: false, concatenateModules: false,
emitOnErrors: true, emitOnErrors: true,
flagIncludedChunks: true, flagIncludedChunks: true,
innerGraph: true, //tells webpack whether to conduct inner graph analysis for unused exports. innerGraph: true, // tells webpack whether to conduct inner graph analysis for unused exports.
mangleWasmImports: true, mangleWasmImports: true,
mergeDuplicateChunks: true, mergeDuplicateChunks: true,
minimize: true, minimize: true,

File diff suppressed because it is too large Load Diff