Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .eslintrc

This file was deleted.

21 changes: 21 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.

import js from '@eslint/js';
import pleskConfig from '@plesk/eslint-config';

export default [
js.configs.recommended,
pleskConfig,
{
rules: {
'jest/no-test-return-statement': 'off',
'react/react-in-jsx-scope': 'off',
'no-console': 'off',
},
settings: {
react: {
pragma: 'createElement',
},
},
},
];
30 changes: 30 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.


/** @type {import('jest').Config} */
const config = {
testEnvironment: "jsdom",
testMatch: [
'**/*.test.js?(x)',
],
setupFiles: [
'<rootDir>/test/shim.js',
'<rootDir>/test/setup.js',
],
snapshotSerializers: [
'enzyme-to-json/serializer',
],
transform: {
"\\.[jt]sx?$": "babel-jest"
},
moduleNameMapper: {
"\\.(png|jpg|gif|svg|woff|woff2)$": "<rootDir>/test/fileMock.js",
"\\.(css|less)$": "<rootDir>/test/styleMock.js"
},
moduleDirectories: [
"src",
"node_modules"
],
};

module.exports = config;
5 changes: 0 additions & 5 deletions lib/.eslintrc

This file was deleted.

1 change: 0 additions & 1 deletion lib/commands/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.

// eslint-disable-next-line jest/no-jest-import
const jest = require('jest');
const createConfig = require('../jest/createConfig');

Expand Down
9 changes: 9 additions & 0 deletions lib/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.

import { defineConfig } from 'eslint/config';

export default defineConfig([{
rules: {
'no-console': 'off',
},
}]);
2 changes: 1 addition & 1 deletion lib/templates/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render, createElement } from '@plesk/ui-library';
import { render } from 'react';
import App from '../../src/App';
import routes from 'routes';

Expand Down
3 changes: 3 additions & 0 deletions lib/webpack/createConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ module.exports = ({ isDev }) => {
resolveAppPath('src/frontend'),
'node_modules',
],
alias: {
react: 'react-compat',
},
},
externals: {
'@plesk/ui-library': { amd: 'plesk-ui-library' },
Expand Down
67 changes: 32 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,44 @@
"src"
],
"dependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/plugin-proposal-object-rest-spread": "^7.18.0",
"@babel/plugin-transform-runtime": "^7.18.2",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@plesk/eslint-config": "^2.0.0",
"@plesk/ui-library": "1.1.5",
"@babel/core": "^7.28.3",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.28.3",
"@babel/preset-env": "^7.28.3",
"@babel/preset-react": "^7.27.1",
"@plesk/eslint-config": "^4.0.0",
"@plesk/ui-library": "3.45.0",
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "^8.0.0",
"chalk": "^2.4.1",
"babel-loader": "^10.0.0",
"chalk": "^5.6.0",
"clean-webpack-plugin": "^4.0.0",
"eslint": "^7.28.0",
"eslint-plugin-jest": "^24.3.6",
"fs-extra": "^6.0.1",
"html-webpack-plugin": "^5.5.0",
"jest": "^25.5.4",
"pug": "^3.0.2",
"eslint": "^9.34.0",
"eslint-plugin-jest": "^29.0.1",
"fs-extra": "^11.3.1",
"html-webpack-plugin": "^5.6.4",
"jest": "^30.1.1",
"prop-types": "^15.8.1",
"pug": "^3.0.3",
"pug-loader": "^2.4.0",
"qs": "^6.5.2",
"react-router-dom": "^4.3.1",
"webpack": "^5.72.1",
"webpack-virtual-modules": "^0.4.3",
"yargs": "^12.0.1"
"qs": "^6.14.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "^7.8.2",
"webpack": "^5.101.3",
"webpack-virtual-modules": "^0.6.2",
"yargs": "^18.0.0"
},
"devDependencies": {
"enzyme": "^3.5.0",
"enzyme-adapter-react-16": "^1.4.0",
"@zarconontol/enzyme-adapter-react-18": "^0.7.3",
"cheerio": "^1.1.2",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.6.2",
"remark-cli": "^5.0.0",
"remark-validate-links": "^7.1.0"
"jest-environment-jsdom": "^30.0.5",
"remark-cli": "^12.0.1",
"remark-validate-links": "^13.1.0"
},
"jest": {
"testMatch": [
"**/*.test.js?(x)"
],
"setupFiles": [
"<rootDir>/test/setup.js"
],
"snapshotSerializers": [
"enzyme-to-json/serializer"
]
"resolutions": {
"cheerio": "1.0.0-rc.12"
}
}
3 changes: 2 additions & 1 deletion src/Api/ApiProvider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.

import { Component, PropTypes } from '@plesk/ui-library';
import { Component } from 'react';
import PropTypes from 'prop-types';
import api from './api';

export default class ConfigProvider extends Component {
Expand Down
27 changes: 0 additions & 27 deletions src/Api/__tests__/withApi.test.js

This file was deleted.

3 changes: 2 additions & 1 deletion src/Api/withApi.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.

import { createElement, PropTypes } from '@plesk/ui-library';
import PropTypes from 'prop-types';
import { createElement } from 'react';

const withApi = Component => {
const C = (props, context) => (
Expand Down
18 changes: 10 additions & 8 deletions src/App/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.

import { createElement, LocaleProvider, PropTypes } from '@plesk/ui-library';
import { BrowserRouter, Switch, Route } from 'react-router-dom';
import { LocaleProvider } from '@plesk/ui-library';
import PropTypes from 'prop-types';
import { createElement } from 'react';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { ConfigProvider } from '../Config';
import { ApiProvider } from '../Api';
import StatusMessages from '../StatusMessages';
Expand All @@ -15,9 +17,9 @@ const App = ({ locale, routes, ...props }) => (
>
<LocaleProvider messages={locale}>
<ApiProvider>
<BrowserRouter basename={props.baseUrl}>
<StatusMessages>
<Switch>
<StatusMessages>
<BrowserRouter basename={props.baseUrl}>
<Routes>
{routes.map(({ path, component: Tag, ...routeProps }) => (
<Route
key={path}
Expand All @@ -26,9 +28,9 @@ const App = ({ locale, routes, ...props }) => (
{...routeProps}
/>
))}
</Switch>
</StatusMessages>
</BrowserRouter>
</Routes>
</BrowserRouter>
</StatusMessages>
</ApiProvider>
</LocaleProvider>
</ConfigProvider>
Expand Down
3 changes: 1 addition & 2 deletions src/App/__tests__/App.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.

import { createElement } from '@plesk/ui-library';
import { createElement } from 'react';
import App from '../App';
import { ConfigProvider } from '../../Config';
import { ApiProvider } from '../../Api';
Expand Down
24 changes: 12 additions & 12 deletions src/App/__tests__/__snapshots__/App.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`App renders correctly 1`] = `
<ConfigProvider
value={
Object {
{
"baseUrl": "",
}
}
>
<LocaleProvider
messages={Object {}}
messages={{}}
>
<ConfigProvider
value={
Object {
{
"get": [Function],
"post": [Function],
}
}
>
<BrowserRouter
basename=""
>
<withRouter(StatusMessages)>
<Switch>
<withRouter(StatusMessages)>
<BrowserRouter
basename=""
>
<Routes>
<Route
componentPath="Index"
key="/"
path="/"
render={[Function]}
/>
</Switch>
</withRouter(StatusMessages)>
</BrowserRouter>
</Routes>
</BrowserRouter>
</withRouter(StatusMessages)>
</ConfigProvider>
</LocaleProvider>
</ConfigProvider>
Expand Down
3 changes: 2 additions & 1 deletion src/Config/ConfigProvider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.

import { Component, PropTypes } from '@plesk/ui-library';
import { Component } from 'react';
import PropTypes from 'prop-types';

export default class ConfigProvider extends Component {
static propTypes = {
Expand Down
27 changes: 0 additions & 27 deletions src/Config/__tests__/withConfig.test.js

This file was deleted.

3 changes: 2 additions & 1 deletion src/Config/withConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.

import { createElement, PropTypes } from '@plesk/ui-library';
import PropTypes from 'prop-types';
import { createElement } from 'react';

const withConfig = Component => {
const C = (props, context) => (
Expand Down
4 changes: 2 additions & 2 deletions src/Page/Page.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.

import { createElement, createPortal, Component, Fragment, PropTypes } from '@plesk/ui-library';
import { createPortal, Component, Fragment, createElement } from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';

const stripTags = str => (str || '').replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?(\/)?>|<\/\w+>/gi, '');
Expand Down
3 changes: 1 addition & 2 deletions src/Page/__tests__/Page.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 1999-2018. Plesk International GmbH. All rights reserved.

import { createElement } from '@plesk/ui-library';
import { createElement } from 'react';
import Page from '../Page';
import { shallow } from 'enzyme';

Expand Down
2 changes: 1 addition & 1 deletion src/Page/__tests__/__snapshots__/Page.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Page renders correctly 1`] = `
<Fragment>
Expand Down
Loading