@centreon/js-config 24.7.1 → 24.7.3
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 +22 -82
- package/cypress/component/configuration.js +16 -40
- package/cypress/component/enableVisualTesting.ts +1 -1
- package/cypress/e2e/commands/configuration.ts +1 -330
- package/cypress/e2e/commands.ts +144 -617
- package/cypress/e2e/configuration.ts +40 -45
- package/cypress/e2e/plugins.ts +114 -53
- package/eslint/base.typescript.eslintrc.js +3 -15
- package/jest/index.js +2 -5
- package/package.json +45 -57
- package/tsconfig/index.json +4 -5
- package/webpack/base/index.js +130 -0
- package/webpack/patch/dev.js +24 -0
- package/{rspack → webpack}/patch/devServer.js +5 -3
- package/webpack/patch/module.js +46 -0
- package/cypress/component/disableCssTransitions.ts +0 -19
- package/cypress/component/excludeNodeModulesFromCoverage.js +0 -36
- package/cypress/e2e/commands/monitoring.ts +0 -117
- package/cypress/e2e/esbuild-preprocessor.ts +0 -26
- package/cypress/e2e/reporter-config.js +0 -13
- package/cypress/e2e/tasks.ts +0 -259
- package/eslint/lambda/typescript.eslintrc.js +0 -48
- package/jest/lambda/typescript.js +0 -49
- package/rspack/base/globalConfig.js +0 -71
- package/rspack/base/index.js +0 -89
- package/rspack/patch/dev.js +0 -12
- package/rspack/patch/module.js +0 -13
- package/rspack/plugins/TransformPreloadScript.js +0 -37
- package/rspack/plugins/WriteRemoteEntryNameToModuleFederation.js +0 -30
- package/tsconfig/lambda/node20.tsconfig.json +0 -12
- package/tsconfig/lambda/tsconfig.json +0 -14
- package/tsconfig.json +0 -21
package/rspack/base/index.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
const rspack = require('@rspack/core');
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
getModuleConfiguration,
|
|
7
|
-
optimization,
|
|
8
|
-
output,
|
|
9
|
-
cache
|
|
10
|
-
} = require('./globalConfig');
|
|
11
|
-
|
|
12
|
-
const getBaseConfiguration = ({
|
|
13
|
-
moduleName,
|
|
14
|
-
moduleFederationConfig,
|
|
15
|
-
enableCoverage
|
|
16
|
-
}) => ({
|
|
17
|
-
cache,
|
|
18
|
-
module: getModuleConfiguration(enableCoverage),
|
|
19
|
-
optimization,
|
|
20
|
-
output: {
|
|
21
|
-
...output,
|
|
22
|
-
clean: true,
|
|
23
|
-
library: moduleName,
|
|
24
|
-
uniqueName: moduleName
|
|
25
|
-
},
|
|
26
|
-
plugins: [
|
|
27
|
-
moduleName &&
|
|
28
|
-
new rspack.container.ModuleFederationPlugin({
|
|
29
|
-
filename: 'remoteEntry.[chunkhash:8].js',
|
|
30
|
-
library: { name: moduleName, type: 'umd' },
|
|
31
|
-
name: moduleName,
|
|
32
|
-
shared: [
|
|
33
|
-
{
|
|
34
|
-
'@centreon/ui-context': {
|
|
35
|
-
requiredVersion: '1.x',
|
|
36
|
-
singleton: true
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
jotai: {
|
|
41
|
-
requiredVersion: '2.x',
|
|
42
|
-
singleton: true
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
'jotai-suspense': {
|
|
47
|
-
singleton: true
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
react: {
|
|
52
|
-
requiredVersion: '18.x',
|
|
53
|
-
singleton: true
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
'react-dom': {
|
|
58
|
-
requiredVersion: '18.x',
|
|
59
|
-
singleton: true
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
'react-i18next': {
|
|
64
|
-
requiredVersion: '14.x',
|
|
65
|
-
singleton: true
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
'react-router-dom': {
|
|
70
|
-
requiredVersion: '6.x',
|
|
71
|
-
singleton: true
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
...moduleFederationConfig
|
|
76
|
-
})
|
|
77
|
-
].filter(Boolean),
|
|
78
|
-
resolve: {
|
|
79
|
-
alias: {
|
|
80
|
-
'@centreon/ui/fonts': path.resolve(
|
|
81
|
-
'./node_modules/@centreon/ui/public/fonts'
|
|
82
|
-
),
|
|
83
|
-
react: path.resolve('./node_modules/react')
|
|
84
|
-
},
|
|
85
|
-
extensions: ['.js', '.jsx', '.ts', '.tsx']
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
module.exports = getBaseConfiguration;
|
package/rspack/patch/dev.js
DELETED
package/rspack/patch/module.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const WriteRemoteEntryNameToModuleFederation = require('../plugins/WriteRemoteEntryNameToModuleFederation');
|
|
2
|
-
const TransformPreloadScript = require('../plugins/TransformPreloadScript');
|
|
3
|
-
|
|
4
|
-
module.exports = ({ outputPath, federatedComponentConfiguration }) => ({
|
|
5
|
-
output: {
|
|
6
|
-
library: '[chunkhash:8]',
|
|
7
|
-
path: outputPath
|
|
8
|
-
},
|
|
9
|
-
plugins: [
|
|
10
|
-
new WriteRemoteEntryNameToModuleFederation(federatedComponentConfiguration),
|
|
11
|
-
new TransformPreloadScript(federatedComponentConfiguration)
|
|
12
|
-
]
|
|
13
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
|
|
3
|
-
const swc = require('@swc/core');
|
|
4
|
-
|
|
5
|
-
module.exports = class TransformPreloadScript {
|
|
6
|
-
constructor(federatedComponentConfiguration) {
|
|
7
|
-
this.federatedComponentConfiguration = federatedComponentConfiguration;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
apply(compiler) {
|
|
11
|
-
compiler.hooks.done.tap('TransformPreloadScript', () => {
|
|
12
|
-
if (!fs.existsSync(compiler.options.output.path)) {
|
|
13
|
-
fs.mkdirSync(compiler.options.output.path, { recursive: true });
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (this.federatedComponentConfiguration.preloadScript) {
|
|
17
|
-
const { code } = swc.transformFileSync(
|
|
18
|
-
`./${this.federatedComponentConfiguration.preloadScript}.ts`,
|
|
19
|
-
{
|
|
20
|
-
filename: `${this.federatedComponentConfiguration.preloadScript}.ts`,
|
|
21
|
-
jsc: {
|
|
22
|
-
parser: {
|
|
23
|
-
syntax: 'typescript'
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
minify: true
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
fs.writeFileSync(
|
|
31
|
-
`${compiler.options.output.path}/${this.federatedComponentConfiguration.preloadScript}.js`,
|
|
32
|
-
code
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
|
|
3
|
-
module.exports = class WriteRemoteEntryNameToModuleFederation {
|
|
4
|
-
constructor(federatedComponentConfiguration) {
|
|
5
|
-
this.federatedComponentConfiguration = federatedComponentConfiguration;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
apply(compiler) {
|
|
9
|
-
compiler.hooks.done.tap(
|
|
10
|
-
'WriteRemoteEntryNameToModuleFederation',
|
|
11
|
-
(stats) => {
|
|
12
|
-
const newFederatedComponentConfiguration = {
|
|
13
|
-
...this.federatedComponentConfiguration,
|
|
14
|
-
remoteEntry: Object.keys(stats.compilation.assets).find((assetName) =>
|
|
15
|
-
assetName.match(/(^remoteEntry)\S+.js$/)
|
|
16
|
-
)
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
if (!fs.existsSync(compiler.options.output.path)) {
|
|
20
|
-
fs.mkdirSync(compiler.options.output.path, { recursive: true });
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
fs.writeFileSync(
|
|
24
|
-
`${compiler.options.output.path}/moduleFederation.json`,
|
|
25
|
-
JSON.stringify(newFederatedComponentConfiguration, null, 2)
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig/index.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"baseUrl": "./",
|
|
5
|
-
"outDir": "./dist",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"pretty": true,
|
|
9
|
-
"emitDeclarationOnly": true,
|
|
10
|
-
"types": ["cypress", "cypress-wait-until"],
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"paths": {
|
|
13
|
-
"@badeball/cypress-cucumber-preprocessor/*": ["./node_modules/@badeball/cypress-cucumber-preprocessor/dist/subpath-entrypoints/*"]
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"exclude": [
|
|
17
|
-
"./node_modules",
|
|
18
|
-
"./dist",
|
|
19
|
-
"../../node_modules"
|
|
20
|
-
],
|
|
21
|
-
}
|