Skip to content

Commit

Permalink
Frontend rewritten in TypeScript, added Node 18 support
Browse files Browse the repository at this point in the history
  • Loading branch information
bniwredyc committed Jun 5, 2024
1 parent 4392255 commit 2ab738b
Show file tree
Hide file tree
Showing 301 changed files with 33,138 additions and 33,644 deletions.
7 changes: 1 addition & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@ See also the [v0.107.51 GitHub milestone][ms-v0.107.51].
NOTE: Add new changes BELOW THIS COMMENT.
-->

### Changed

- The HTTP server's write timeout has been increased from 1 minute to 5 minutes
to match the one used by AdGuard Home's HTTP client to fetch filtering-list
data ([#7041]).

[#7041]: https://github.com/AdguardTeam/AdGuardHome/issues/7041
Frontend rewritten in TypeScript, added Node 18 support

<!--
NOTE: Add new changes ABOVE THIS COMMENT.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Run `make init` to prepare the development environment.
You will need this to build AdGuard Home:

- [Go](https://golang.org/dl/) v1.22 or later;
- [Node.js](https://nodejs.org/en/download/) v16 or later;
- [Node.js](https://nodejs.org/en/download/) v18.18 or later;
- [npm](https://www.npmjs.com/) v8 or later;
- [yarn](https://yarnpkg.com/) v1.22.5 or later.

Expand Down
60 changes: 16 additions & 44 deletions client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"parser": "babel-eslint",
"plugins": ["prettier"],
"extends": [
"airbnb-base",
"prettier",
"eslint:recommended",
"plugin:react/recommended",
"airbnb-base"
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"env": {
"jest": true,
"node": true,
Expand All @@ -16,50 +20,21 @@
"version": "16.4"
},
"import/resolver": {
"webpack": {
"config": "webpack.common.js"
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"rules": {
"indent": [
"@typescript-eslint/no-explicit-any": "off",
"import/extensions": [
"error",
4,
"ignorePackages",
{
"SwitchCase": 1,
"VariableDeclarator": 1,
"outerIIFEBody": 1,
"FunctionDeclaration": {
"parameters": 1,
"body": 1
},
"FunctionExpression": {
"parameters": 1,
"body": 1
},
"CallExpression": {
"arguments": 1
},
"ArrayExpression": 1,
"ObjectExpression": 1,
"ImportDeclaration": 1,
"flatTernaryExpressions": false,
"ignoredNodes": [
"JSXElement",
"JSXElement > *",
"JSXAttribute",
"JSXIdentifier",
"JSXNamespacedName",
"JSXMemberExpression",
"JSXSpreadAttribute",
"JSXExpressionContainer",
"JSXOpeningElement",
"JSXClosingElement",
"JSXText",
"JSXEmptyExpression",
"JSXSpreadChild"
],
"ignoreComments": false
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"class-methods-use-this": "off",
Expand All @@ -68,10 +43,7 @@
"no-console": [
"warn",
{
"allow": [
"warn",
"error"
]
"allow": ["warn", "error"]
}
],
"import/no-extraneous-dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion client/.gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.js text eol=lf
*.ts text eol=lf
10 changes: 10 additions & 0 deletions client/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 120,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": true,
"tabWidth": 4,
"semi": true,
"arrowParens": "always",
}
46 changes: 0 additions & 46 deletions client/.stylelintrc

This file was deleted.

44 changes: 44 additions & 0 deletions client/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
rules: {
"selector-type-no-unknown": true,
"block-closing-brace-empty-line-before": "never",
"block-no-empty": true,
"block-opening-brace-newline-after": "always",
"block-opening-brace-space-before": "always",
"color-hex-case": "lower",
"color-named": "never",
"color-no-invalid-hex": true,
"length-zero-no-unit": true,
"declaration-block-trailing-semicolon": "always",
"custom-property-empty-line-before": ["always", {
"except": [
"after-custom-property",
"first-nested"
]
}],
"declaration-block-no-duplicate-properties": true,
"declaration-colon-space-after": "always",
"declaration-empty-line-before": ["always", {
"except": [
"after-declaration",
"first-nested",
"after-comment"
]
}],
"font-weight-notation": "numeric",
"indentation": [4, {
"except": ["value"]
}],
"max-empty-lines": 2,
"no-missing-end-of-source-newline": true,
"number-leading-zero": "always",
"property-no-unknown": true,
"rule-empty-line-before": ["always-multi-line", {
"except": ["first-nested"],
"ignore": ["after-comment"]
}],
"string-quotes": "double",
"value-list-comma-space-after": "always",
"unit-case": "lower"
}
}
14 changes: 14 additions & 0 deletions client/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = (api) => {
api.cache(false);
return {
presets: ['@babel/preset-env', '@babel/preset-typescript', '@babel/preset-react'],
plugins: [
'@babel/plugin-transform-runtime',
'@babel/plugin-transform-class-properties',
'@babel/plugin-transform-object-rest-spread',
'@babel/plugin-transform-nullish-coalescing-operator',
'@babel/plugin-transform-optional-chaining',
'react-hot-loader/babel',
],
};
};
17 changes: 0 additions & 17 deletions client/babel.config.js

This file was deleted.

9 changes: 2 additions & 7 deletions client/constants.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
const BUILD_ENVS = {
export const BUILD_ENVS = {
dev: 'development',
prod: 'production',
};

const BASE_URL = 'control';

module.exports = {
BUILD_ENVS,
BASE_URL,
};
export const BASE_URL = 'control';
6 changes: 6 additions & 0 deletions client/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';

declare module '*.svg' {
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
export default content;
}
5 changes: 0 additions & 5 deletions client/jest.config.js

This file was deleted.

6 changes: 6 additions & 0 deletions client/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
testEnvironment: 'jsdom',
transform: {
'^.+\\.tsx?$': 'babel-jest',
},
};
Loading

0 comments on commit 2ab738b

Please sign in to comment.