@centreon/js-config 24.4.14 → 24.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/component/commands.tsx +75 -19
- package/cypress/component/configuration.js +28 -12
- package/cypress/component/disableCssTransitions.ts +19 -0
- package/cypress/component/enableVisualTesting.ts +1 -1
- package/cypress/e2e/commands/configuration.ts +3 -1
- package/cypress/e2e/commands/monitoring.ts +75 -0
- package/cypress/e2e/commands.ts +298 -59
- package/cypress/e2e/configuration.ts +30 -32
- package/cypress/e2e/esbuild-preprocessor.ts +26 -0
- package/cypress/e2e/plugins.ts +21 -119
- package/cypress/e2e/reporter-config.js +13 -0
- package/cypress/e2e/tasks.ts +105 -0
- package/eslint/base.typescript.eslintrc.js +15 -3
- package/eslint/lambda/typescript.eslintrc.js +48 -0
- package/jest/index.js +5 -2
- package/jest/lambda/typescript.js +49 -0
- package/package.json +61 -45
- package/tsconfig/index.json +5 -4
- package/tsconfig/lambda/node20.tsconfig.json +12 -0
- package/tsconfig/lambda/tsconfig.json +14 -0
- package/webpack/base/globalConfig.js +76 -0
- package/webpack/base/index.js +20 -59
package/cypress/e2e/plugins.ts
CHANGED
|
@@ -3,132 +3,34 @@
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
4
4
|
/* eslint-disable no-param-reassign */
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
test: /\.ts?$/,
|
|
19
|
-
use: [
|
|
20
|
-
{
|
|
21
|
-
loader: 'swc-loader'
|
|
22
|
-
}
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
test: /\.feature$/,
|
|
27
|
-
use: [
|
|
28
|
-
{
|
|
29
|
-
loader: '@badeball/cypress-cucumber-preprocessor/webpack',
|
|
30
|
-
options: config
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
resolve: {
|
|
37
|
-
extensions: ['.ts', '.js']
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default async (on, config): Promise<void> => {
|
|
43
|
-
await addCucumberPreprocessorPlugin(on, config);
|
|
6
|
+
export default (
|
|
7
|
+
on: Cypress.PluginEvents,
|
|
8
|
+
config: Cypress.PluginConfigOptions
|
|
9
|
+
): Cypress.PluginConfigOptions => {
|
|
10
|
+
on('before:browser:launch', (browser, launchOptions) => {
|
|
11
|
+
const width = 1920;
|
|
12
|
+
const height = 1080;
|
|
13
|
+
|
|
14
|
+
if (browser.family === 'chromium') {
|
|
15
|
+
if (browser.isHeadless) {
|
|
16
|
+
launchOptions.args.push('--headless=new');
|
|
17
|
+
}
|
|
44
18
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
19
|
+
// flags description : https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
|
|
20
|
+
launchOptions.args.push('--disable-gpu');
|
|
21
|
+
launchOptions.args.push('--auto-open-devtools-for-tabs');
|
|
22
|
+
launchOptions.args.push('--disable-extensions');
|
|
23
|
+
launchOptions.args.push('--hide-scrollbars');
|
|
24
|
+
launchOptions.args.push('--mute-audio');
|
|
49
25
|
|
|
50
|
-
|
|
26
|
+
launchOptions.args.push(`--window-size=${width},${height}`);
|
|
51
27
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
launchOptions.args.push('--disable-gpu');
|
|
55
|
-
launchOptions.args = launchOptions.args.filter(
|
|
56
|
-
(element) => element !== '--disable-dev-shm-usage'
|
|
57
|
-
);
|
|
28
|
+
// force screen to be non-retina and just use our given resolution
|
|
29
|
+
launchOptions.args.push('--force-device-scale-factor=1');
|
|
58
30
|
}
|
|
59
31
|
|
|
60
32
|
return launchOptions;
|
|
61
33
|
});
|
|
62
34
|
|
|
63
|
-
interface PortBinding {
|
|
64
|
-
destination: number;
|
|
65
|
-
source: number;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
interface StartContainerProps {
|
|
69
|
-
image: string;
|
|
70
|
-
name: string;
|
|
71
|
-
portBindings: Array<PortBinding>;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
interface StopContainerProps {
|
|
75
|
-
name: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
on('task', {
|
|
79
|
-
startContainer: async ({
|
|
80
|
-
image,
|
|
81
|
-
name,
|
|
82
|
-
portBindings = []
|
|
83
|
-
}: StartContainerProps) => {
|
|
84
|
-
const webContainers = await docker.listContainers({
|
|
85
|
-
all: true,
|
|
86
|
-
filters: { name: [name] }
|
|
87
|
-
});
|
|
88
|
-
if (webContainers.length) {
|
|
89
|
-
return webContainers[0];
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const container = await docker.createContainer({
|
|
93
|
-
AttachStderr: true,
|
|
94
|
-
AttachStdin: false,
|
|
95
|
-
AttachStdout: true,
|
|
96
|
-
ExposedPorts: portBindings.reduce((accumulator, currentValue) => {
|
|
97
|
-
accumulator[`${currentValue.source}/tcp`] = {};
|
|
98
|
-
|
|
99
|
-
return accumulator;
|
|
100
|
-
}, {}),
|
|
101
|
-
HostConfig: {
|
|
102
|
-
PortBindings: portBindings.reduce((accumulator, currentValue) => {
|
|
103
|
-
accumulator[`${currentValue.source}/tcp`] = [
|
|
104
|
-
{
|
|
105
|
-
HostIP: '0.0.0.0',
|
|
106
|
-
HostPort: `${currentValue.destination}`
|
|
107
|
-
}
|
|
108
|
-
];
|
|
109
|
-
|
|
110
|
-
return accumulator;
|
|
111
|
-
}, {})
|
|
112
|
-
},
|
|
113
|
-
Image: image,
|
|
114
|
-
OpenStdin: false,
|
|
115
|
-
StdinOnce: false,
|
|
116
|
-
Tty: true,
|
|
117
|
-
name
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
await container.start();
|
|
121
|
-
|
|
122
|
-
return container;
|
|
123
|
-
},
|
|
124
|
-
stopContainer: async ({ name }: StopContainerProps) => {
|
|
125
|
-
const container = await docker.getContainer(name);
|
|
126
|
-
await container.kill();
|
|
127
|
-
await container.remove();
|
|
128
|
-
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
|
|
133
35
|
return config;
|
|
134
36
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
mochawesomeReporterOptions: {
|
|
3
|
+
consoleReporter: 'none',
|
|
4
|
+
html: false,
|
|
5
|
+
json: true,
|
|
6
|
+
overwrite: true,
|
|
7
|
+
reportDir: 'results/reports',
|
|
8
|
+
reportFilename: '[name]-report.json'
|
|
9
|
+
},
|
|
10
|
+
reporterEnabled: `mochawesome,${require.resolve(
|
|
11
|
+
'@badeball/cypress-cucumber-preprocessor/pretty-reporter'
|
|
12
|
+
)}`
|
|
13
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import { existsSync, mkdirSync } from 'fs';
|
|
3
|
+
|
|
4
|
+
import Docker from 'dockerode';
|
|
5
|
+
|
|
6
|
+
export default (on: Cypress.PluginEvents): void => {
|
|
7
|
+
const docker = new Docker();
|
|
8
|
+
|
|
9
|
+
interface PortBinding {
|
|
10
|
+
destination: number;
|
|
11
|
+
source: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface StartContainerProps {
|
|
15
|
+
image: string;
|
|
16
|
+
name: string;
|
|
17
|
+
portBindings: Array<PortBinding>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface StopContainerProps {
|
|
21
|
+
name: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
on('task', {
|
|
25
|
+
createDirectory: async (directoryPath: string) => {
|
|
26
|
+
if (!existsSync(directoryPath)) {
|
|
27
|
+
mkdirSync(directoryPath, { recursive: true });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return null;
|
|
31
|
+
},
|
|
32
|
+
startContainer: async ({
|
|
33
|
+
image,
|
|
34
|
+
name,
|
|
35
|
+
portBindings = []
|
|
36
|
+
}: StartContainerProps) => {
|
|
37
|
+
const imageList = execSync(
|
|
38
|
+
'docker image list --format "{{.Repository}}:{{.Tag}}"'
|
|
39
|
+
).toString('utf8');
|
|
40
|
+
|
|
41
|
+
if (
|
|
42
|
+
!imageList.match(
|
|
43
|
+
new RegExp(
|
|
44
|
+
`^${image.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}`,
|
|
45
|
+
'm'
|
|
46
|
+
)
|
|
47
|
+
)
|
|
48
|
+
) {
|
|
49
|
+
execSync(`docker pull ${image}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const webContainers = await docker.listContainers({
|
|
53
|
+
all: true,
|
|
54
|
+
filters: { name: [name] }
|
|
55
|
+
});
|
|
56
|
+
if (webContainers.length) {
|
|
57
|
+
return webContainers[0];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const container = await docker.createContainer({
|
|
61
|
+
AttachStderr: true,
|
|
62
|
+
AttachStdin: false,
|
|
63
|
+
AttachStdout: true,
|
|
64
|
+
ExposedPorts: portBindings.reduce((accumulator, currentValue) => {
|
|
65
|
+
accumulator[`${currentValue.source}/tcp`] = {};
|
|
66
|
+
|
|
67
|
+
return accumulator;
|
|
68
|
+
}, {}),
|
|
69
|
+
HostConfig: {
|
|
70
|
+
PortBindings: portBindings.reduce((accumulator, currentValue) => {
|
|
71
|
+
accumulator[`${currentValue.source}/tcp`] = [
|
|
72
|
+
{
|
|
73
|
+
HostIP: '127.0.0.1',
|
|
74
|
+
HostPort: `${currentValue.destination}`
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
return accumulator;
|
|
79
|
+
}, {})
|
|
80
|
+
},
|
|
81
|
+
Image: image,
|
|
82
|
+
OpenStdin: false,
|
|
83
|
+
StdinOnce: false,
|
|
84
|
+
Tty: true,
|
|
85
|
+
name
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
await container.start();
|
|
89
|
+
|
|
90
|
+
return container;
|
|
91
|
+
},
|
|
92
|
+
stopContainer: async ({ name }: StopContainerProps) => {
|
|
93
|
+
const container = await docker.getContainer(name);
|
|
94
|
+
await container.kill();
|
|
95
|
+
await container.remove();
|
|
96
|
+
|
|
97
|
+
return null;
|
|
98
|
+
},
|
|
99
|
+
waitOn: async (url: string) => {
|
|
100
|
+
execSync(`npx wait-on ${url}`);
|
|
101
|
+
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
@@ -21,11 +21,15 @@ module.exports = {
|
|
|
21
21
|
}
|
|
22
22
|
],
|
|
23
23
|
'@typescript-eslint/camelcase': 'off',
|
|
24
|
-
'@typescript-eslint/consistent-type-definitions': [
|
|
24
|
+
'@typescript-eslint/consistent-type-definitions': ['off', 'interface'],
|
|
25
|
+
'@typescript-eslint/explicit-function-return-type': [
|
|
25
26
|
'error',
|
|
26
|
-
|
|
27
|
+
{
|
|
28
|
+
allowExpressions: true,
|
|
29
|
+
allowHigherOrderFunctions: true,
|
|
30
|
+
allowTypedFunctionExpressions: true
|
|
31
|
+
}
|
|
27
32
|
],
|
|
28
|
-
'@typescript-eslint/explicit-function-return-type': ['error'],
|
|
29
33
|
'@typescript-eslint/explicit-member-accessibility': [
|
|
30
34
|
'error',
|
|
31
35
|
{
|
|
@@ -76,13 +80,21 @@ module.exports = {
|
|
|
76
80
|
}
|
|
77
81
|
],
|
|
78
82
|
camelcase: 'off',
|
|
83
|
+
'import/no-cycle': 'off',
|
|
84
|
+
'import/no-named-as-default': 'warn',
|
|
79
85
|
'no-shadow': 'off',
|
|
80
86
|
'no-unused-expressions': 'off'
|
|
81
87
|
},
|
|
82
88
|
settings: {
|
|
89
|
+
'import/parsers': {
|
|
90
|
+
'@typescript-eslint/parser': ['.ts', '.tsx']
|
|
91
|
+
},
|
|
83
92
|
'import/resolver': {
|
|
84
93
|
alias: {
|
|
85
94
|
extensions: ['.ts', '.tsx', '.js', '.jsx']
|
|
95
|
+
},
|
|
96
|
+
typescript: {
|
|
97
|
+
alwaysTryTypes: true
|
|
86
98
|
}
|
|
87
99
|
}
|
|
88
100
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: [ '../node/typescript.eslintrc.js'],
|
|
3
|
+
overrides: [
|
|
4
|
+
{
|
|
5
|
+
files: ["*.spec.js", "*.test.ts", "*.tests.ts"],
|
|
6
|
+
rules: {
|
|
7
|
+
"import/first": 0,
|
|
8
|
+
"import/order": 0,
|
|
9
|
+
"@typescript-eslint/ban-ts-comment": 0,
|
|
10
|
+
"@typescript-eslint/no-explicit-any": 0
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
rules: {
|
|
15
|
+
"import/extensions": ["off"],
|
|
16
|
+
"no-console": "off",
|
|
17
|
+
"no-underscore-dangle": "off",
|
|
18
|
+
"class-methods-use-this": "off",
|
|
19
|
+
"@typescript-eslint/naming-convention": [
|
|
20
|
+
"error",
|
|
21
|
+
{
|
|
22
|
+
format: ["camelCase", "PascalCase", "UPPER_CASE"],
|
|
23
|
+
selector: "variable"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
filter: {
|
|
27
|
+
match: false,
|
|
28
|
+
regex: "(__esModule|.+-.+)"
|
|
29
|
+
},
|
|
30
|
+
format: ["snake_case", "camelCase", "PascalCase", "UPPER_CASE"],
|
|
31
|
+
selector: "property",
|
|
32
|
+
leadingUnderscore: "allow"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
filter: {
|
|
36
|
+
match: false,
|
|
37
|
+
regex: "^_$"
|
|
38
|
+
},
|
|
39
|
+
format: ["snake_case", "camelCase", "PascalCase"],
|
|
40
|
+
selector: "parameter"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"@typescript-eslint/require-array-sort-compare": "error"
|
|
44
|
+
},
|
|
45
|
+
parserOptions: {
|
|
46
|
+
project: ["./tsconfig.json"]
|
|
47
|
+
}
|
|
48
|
+
}
|
package/jest/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
moduleNameMapper: {
|
|
3
3
|
'\\.(s?css|png|svg|jpg)$': 'identity-obj-proxy',
|
|
4
|
+
'^.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$':
|
|
5
|
+
'jest-transform-stub',
|
|
4
6
|
'^react($|/.+)': '<rootDir>/node_modules/react$1'
|
|
5
7
|
},
|
|
6
|
-
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
|
|
7
8
|
testEnvironment: 'jsdom',
|
|
8
|
-
testPathIgnorePatterns: ['/node_modules/'],
|
|
9
|
+
testPathIgnorePatterns: ['/node_modules/', '!*.cypress.spec.tsx'],
|
|
9
10
|
transform: {
|
|
11
|
+
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$':
|
|
12
|
+
'jest-transform-stub',
|
|
10
13
|
'^.+\\.[jt]sx?$': [
|
|
11
14
|
'@swc/jest',
|
|
12
15
|
{
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Centreon Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// For a detailed explanation regarding each configuration property, visit:
|
|
18
|
+
// https://jestjs.io/docs/en/configuration.html
|
|
19
|
+
const path = require('path');
|
|
20
|
+
|
|
21
|
+
const rootPath = path.join(__dirname);
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
module.exports = {
|
|
26
|
+
rootDir: rootPath,
|
|
27
|
+
// Automatically clear mock calls and instances between every test
|
|
28
|
+
clearMocks: true,
|
|
29
|
+
// The directory where Jest should output its coverage files
|
|
30
|
+
coverageDirectory: '<rootDir>/coverage',
|
|
31
|
+
// An array of regexp pattern strings used to skip coverage collection
|
|
32
|
+
coveragePathIgnorePatterns: ['\\\\node_modules\\\\', 'tests'],
|
|
33
|
+
|
|
34
|
+
// An array of file extensions your modules use
|
|
35
|
+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
36
|
+
|
|
37
|
+
// Automatically reset mock state between every test
|
|
38
|
+
// resetMocks: true,
|
|
39
|
+
|
|
40
|
+
testMatch: ['**/*.(test|tests|spec|specs).+(ts|tsx|js)'],
|
|
41
|
+
|
|
42
|
+
// This option allows the use of a custom results processor
|
|
43
|
+
// testResultsProcessor: 'jest-sonar-reporter',
|
|
44
|
+
|
|
45
|
+
// A map from regular expressions to paths to transformers
|
|
46
|
+
transform: {
|
|
47
|
+
'^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.json' }],
|
|
48
|
+
},
|
|
49
|
+
};
|
package/package.json
CHANGED
|
@@ -1,47 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
2
|
+
"name": "@centreon/js-config",
|
|
3
|
+
"description": "Centreon Frontend shared build configuration",
|
|
4
|
+
"version": "24.4.16",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/centreon/centreon-frontend.git"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"centreon",
|
|
11
|
+
"eslint"
|
|
12
|
+
],
|
|
13
|
+
"author": "centreon@centreon.com",
|
|
14
|
+
"license": "GPL-2.0",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/centreon/centreon-frontend/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/centreon/centreon-frontend#readme",
|
|
19
|
+
"files": [
|
|
20
|
+
"eslint",
|
|
21
|
+
"jest",
|
|
22
|
+
"tsconfig",
|
|
23
|
+
"webpack",
|
|
24
|
+
"cypress"
|
|
25
|
+
],
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"prettier": "^3.0.0",
|
|
28
|
+
"eslint": "^8.53.0"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@badeball/cypress-cucumber-preprocessor": "^19.1.0",
|
|
32
|
+
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.0",
|
|
33
|
+
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
|
34
|
+
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
35
|
+
"@tsconfig/node16": "^16.1.1",
|
|
36
|
+
"@tsconfig/node20": "^20.1.2",
|
|
37
|
+
"@types/cypress-cucumber-preprocessor": "^4.0.5",
|
|
38
|
+
"@types/dockerode": "^3.3.23",
|
|
39
|
+
"cypress-multi-reporters": "^1.6.4",
|
|
40
|
+
"cypress-terminal-report": "^5.3.9",
|
|
41
|
+
"dockerode": "^4.0.0",
|
|
42
|
+
"dotenv": "^16.3.1",
|
|
43
|
+
"esbuild": "^0.19.5",
|
|
44
|
+
"eslint": "^8.53.0",
|
|
45
|
+
"eslint-config-airbnb": "19.0.4",
|
|
46
|
+
"eslint-config-prettier": "^8.5.0",
|
|
47
|
+
"eslint-import-resolver-alias": "^1.1.2",
|
|
48
|
+
"eslint-import-resolver-typescript": "^3.5.5",
|
|
49
|
+
"eslint-plugin-babel": "^5.3.1",
|
|
50
|
+
"eslint-plugin-hooks": "^0.4.3",
|
|
51
|
+
"eslint-plugin-import": "^2.26.0",
|
|
52
|
+
"eslint-plugin-jest": "^26.1.5",
|
|
53
|
+
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
54
|
+
"eslint-plugin-node": "^11.1.0",
|
|
55
|
+
"eslint-plugin-prefer-arrow-functions": "^3.1.4",
|
|
56
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
57
|
+
"eslint-plugin-react": "^7.29.4",
|
|
58
|
+
"eslint-plugin-react-hooks": "^4.5.0",
|
|
59
|
+
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
60
|
+
"eslint-plugin-typescript-sort-keys": "^2.1.0",
|
|
61
|
+
"mochawesome": "^7.1.3"
|
|
62
|
+
}
|
|
47
63
|
}
|
package/tsconfig/index.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"moduleResolution": "node",
|
|
4
3
|
"downlevelIteration": true,
|
|
5
|
-
"module": "
|
|
6
|
-
"
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"target": "es2018",
|
|
7
7
|
"jsx": "react-jsx",
|
|
8
8
|
"strict": true,
|
|
9
9
|
"noImplicitAny": false,
|
|
10
10
|
"skipLibCheck": true,
|
|
11
|
-
"esModuleInterop": true
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"resolveJsonModule": true
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const excludeNodeModulesExceptCentreonUi =
|
|
2
|
+
/node_modules(\\|\/)\.pnpm(\\|\/)(?!(@centreon|file\+packages\+ui-context))/;
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
cache: false,
|
|
6
|
+
excludeNodeModulesExceptCentreonUi,
|
|
7
|
+
getModuleConfiguration: (jscTransformConfiguration, enableCoverage) => ({
|
|
8
|
+
rules: [
|
|
9
|
+
{
|
|
10
|
+
parser: { system: false },
|
|
11
|
+
test: /\.[cm]?(j|t)sx?$/
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
exclude: [excludeNodeModulesExceptCentreonUi],
|
|
15
|
+
test: /\.[jt]sx?$/,
|
|
16
|
+
use: {
|
|
17
|
+
loader: 'swc-loader',
|
|
18
|
+
options: {
|
|
19
|
+
jsc: {
|
|
20
|
+
experimental: {
|
|
21
|
+
plugins: [
|
|
22
|
+
enableCoverage && ['swc-plugin-coverage-instrument', {}]
|
|
23
|
+
].filter(Boolean)
|
|
24
|
+
},
|
|
25
|
+
parser: {
|
|
26
|
+
syntax: 'typescript',
|
|
27
|
+
tsx: true
|
|
28
|
+
},
|
|
29
|
+
transform: jscTransformConfiguration
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
test: /\.icon.svg$/,
|
|
36
|
+
use: ['@svgr/webpack']
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
exclude: excludeNodeModulesExceptCentreonUi,
|
|
40
|
+
test: /\.(bmp|png|jpg|jpeg|gif|svg)$/,
|
|
41
|
+
use: [
|
|
42
|
+
{
|
|
43
|
+
loader: 'url-loader',
|
|
44
|
+
options: {
|
|
45
|
+
limit: 10000,
|
|
46
|
+
name: '[name].[hash:8].[ext]'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
generator: {
|
|
53
|
+
filename: '[name][ext]'
|
|
54
|
+
},
|
|
55
|
+
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
56
|
+
type: 'asset/resource'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
test: /\.css$/i,
|
|
60
|
+
use: ['style-loader', 'css-loader']
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}),
|
|
64
|
+
optimization: {
|
|
65
|
+
splitChunks: {
|
|
66
|
+
chunks: 'all',
|
|
67
|
+
maxSize: 400 * 1024
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
output: {
|
|
71
|
+
chunkFilename: '[name].[chunkhash:8].chunk.js',
|
|
72
|
+
filename: '[name].[chunkhash:8].js',
|
|
73
|
+
libraryTarget: 'umd',
|
|
74
|
+
umdNamedDefine: true
|
|
75
|
+
}
|
|
76
|
+
};
|