@centreon/js-config 24.10.3 → 24.10.5
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/biome/base.json +224 -0
- package/cypress/component/commands.tsx +82 -22
- package/cypress/component/configuration.js +39 -16
- package/cypress/component/disableCssTransitions.ts +19 -0
- package/cypress/component/enableVisualTesting.ts +1 -1
- package/cypress/component/excludeNodeModulesFromCoverage.js +36 -0
- package/cypress/e2e/commands/configuration.ts +330 -1
- package/cypress/e2e/commands/monitoring.ts +225 -0
- package/cypress/e2e/commands.ts +751 -173
- package/cypress/e2e/configuration.ts +57 -40
- package/cypress/e2e/esbuild-preprocessor.ts +26 -0
- package/cypress/e2e/plugins.ts +43 -114
- package/cypress/e2e/reporter-config.js +13 -0
- package/cypress/e2e/tasks.ts +273 -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 +57 -45
- package/rspack/base/globalConfig.js +75 -0
- package/rspack/base/index.js +89 -0
- package/rspack/patch/dev.js +12 -0
- package/{webpack → rspack}/patch/devServer.js +3 -5
- package/rspack/patch/module.js +13 -0
- package/rspack/plugins/TransformPreloadScript.js +37 -0
- package/rspack/plugins/WriteRemoteEntryNameToModuleFederation.js +30 -0
- package/tsconfig/index.json +5 -4
- package/tsconfig/lambda/node20.tsconfig.json +12 -0
- package/tsconfig/lambda/tsconfig.json +14 -0
- package/tsconfig.json +21 -0
- package/webpack/base/index.js +0 -130
- package/webpack/patch/dev.js +0 -24
- package/webpack/patch/module.js +0 -46
package/webpack/base/index.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
4
|
-
const { ModuleFederationPlugin } = require('webpack').container;
|
|
5
|
-
|
|
6
|
-
const excludeNodeModulesExceptCentreonUi =
|
|
7
|
-
/node_modules(\\|\/)\.pnpm(\\|\/)(?!(@centreon))/;
|
|
8
|
-
|
|
9
|
-
const getBaseConfiguration = ({
|
|
10
|
-
moduleName,
|
|
11
|
-
moduleFederationConfig,
|
|
12
|
-
jscTransformConfiguration
|
|
13
|
-
}) => ({
|
|
14
|
-
cache: false,
|
|
15
|
-
module: {
|
|
16
|
-
rules: [
|
|
17
|
-
{
|
|
18
|
-
parser: { system: false },
|
|
19
|
-
test: /\.[cm]?(j|t)sx?$/
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
exclude: excludeNodeModulesExceptCentreonUi,
|
|
23
|
-
test: /\.[jt]sx?$/,
|
|
24
|
-
use: {
|
|
25
|
-
loader: 'swc-loader',
|
|
26
|
-
options: {
|
|
27
|
-
jsc: {
|
|
28
|
-
parser: {
|
|
29
|
-
syntax: 'typescript',
|
|
30
|
-
tsx: true
|
|
31
|
-
},
|
|
32
|
-
transform: jscTransformConfiguration
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
test: /\.icon.svg$/,
|
|
39
|
-
use: ['@svgr/webpack']
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
exclude: excludeNodeModulesExceptCentreonUi,
|
|
43
|
-
test: /\.(bmp|png|jpg|jpeg|gif|svg)$/,
|
|
44
|
-
use: [
|
|
45
|
-
{
|
|
46
|
-
loader: 'url-loader',
|
|
47
|
-
options: {
|
|
48
|
-
limit: 10000,
|
|
49
|
-
name: '[name].[hash:8].[ext]'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
optimization: {
|
|
57
|
-
splitChunks: {
|
|
58
|
-
chunks: 'all',
|
|
59
|
-
maxSize: 400 * 1024
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
output: {
|
|
63
|
-
chunkFilename: '[name].[chunkhash:8].chunk.js',
|
|
64
|
-
filename: '[name].[chunkhash:8].js',
|
|
65
|
-
libraryTarget: 'umd',
|
|
66
|
-
umdNamedDefine: true
|
|
67
|
-
},
|
|
68
|
-
plugins: [
|
|
69
|
-
new CleanWebpackPlugin(),
|
|
70
|
-
moduleName &&
|
|
71
|
-
new ModuleFederationPlugin({
|
|
72
|
-
filename: 'remoteEntry.[chunkhash:8].js',
|
|
73
|
-
library: { name: moduleName, type: 'var' },
|
|
74
|
-
name: moduleName,
|
|
75
|
-
shared: [
|
|
76
|
-
{
|
|
77
|
-
'@centreon/ui-context': {
|
|
78
|
-
requiredVersion: '22.10.0',
|
|
79
|
-
singleton: true
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
jotai: {
|
|
84
|
-
requiredVersion: '1.x',
|
|
85
|
-
singleton: true
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
'jotai-suspense': {
|
|
90
|
-
requiredVersion: '0.1.x',
|
|
91
|
-
singleton: true
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
react: {
|
|
96
|
-
requiredVersion: '18.x',
|
|
97
|
-
singleton: true
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
'react-dom': {
|
|
102
|
-
requiredVersion: '18.x',
|
|
103
|
-
singleton: true
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
'react-i18next': {
|
|
108
|
-
requiredVersion: '11.x',
|
|
109
|
-
singleton: true
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
'react-router-dom': {
|
|
114
|
-
requiredVersion: '6.x',
|
|
115
|
-
singleton: true
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
...moduleFederationConfig
|
|
120
|
-
})
|
|
121
|
-
].filter(Boolean),
|
|
122
|
-
resolve: {
|
|
123
|
-
alias: {
|
|
124
|
-
react: path.resolve('./node_modules/react')
|
|
125
|
-
},
|
|
126
|
-
extensions: ['.js', '.jsx', '.ts', '.tsx']
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
module.exports = getBaseConfiguration;
|
package/webpack/patch/dev.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
devJscTransformConfiguration: {
|
|
3
|
-
react: {
|
|
4
|
-
development: true,
|
|
5
|
-
refresh: false,
|
|
6
|
-
},
|
|
7
|
-
},
|
|
8
|
-
devRefreshJscTransformConfiguration: {
|
|
9
|
-
react: {
|
|
10
|
-
development: true,
|
|
11
|
-
refresh: true,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
getDevConfiguration: () => ({
|
|
15
|
-
cache: true,
|
|
16
|
-
devtool: 'eval-cheap-module-source-map',
|
|
17
|
-
optimization: {
|
|
18
|
-
splitChunks: false,
|
|
19
|
-
},
|
|
20
|
-
output: {
|
|
21
|
-
filename: '[name].js',
|
|
22
|
-
},
|
|
23
|
-
}),
|
|
24
|
-
};
|
package/webpack/patch/module.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
3
|
-
|
|
4
|
-
class CentreonModulePlugin {
|
|
5
|
-
constructor(federatedComponentConfiguration) {
|
|
6
|
-
this.federatedComponentConfiguration = federatedComponentConfiguration;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
apply(compiler) {
|
|
10
|
-
compiler.hooks.done.tap('CentreonModulePlugin', (stats) => {
|
|
11
|
-
const newFederatedComponentConfiguration = {
|
|
12
|
-
...this.federatedComponentConfiguration,
|
|
13
|
-
remoteEntry: Object.keys(stats.compilation.assets).find((assetName) =>
|
|
14
|
-
assetName.match(/(^remoteEntry)\S+.js$/),
|
|
15
|
-
),
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
if (!fs.existsSync(compiler.options.output.path)) {
|
|
19
|
-
fs.mkdirSync(compiler.options.output.path, { recursive: true });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
fs.writeFileSync(
|
|
23
|
-
`${compiler.options.output.path}/moduleFederation.json`,
|
|
24
|
-
JSON.stringify(newFederatedComponentConfiguration, null, 2),
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
module.exports = ({
|
|
31
|
-
outputPath,
|
|
32
|
-
federatedComponentConfiguration,
|
|
33
|
-
}) => ({
|
|
34
|
-
output: {
|
|
35
|
-
library: '[chunkhash:8]',
|
|
36
|
-
path: outputPath,
|
|
37
|
-
},
|
|
38
|
-
plugins: [
|
|
39
|
-
new CleanWebpackPlugin({
|
|
40
|
-
cleanOnceBeforeBuildPatterns: [`${outputPath}/**/*.js`],
|
|
41
|
-
dangerouslyAllowCleanPatternsOutsideProject: true,
|
|
42
|
-
dry: false,
|
|
43
|
-
}),
|
|
44
|
-
new CentreonModulePlugin(federatedComponentConfiguration),
|
|
45
|
-
],
|
|
46
|
-
});
|