@eui/tools 5.3.89 → 6.1.0
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/.version.properties +1 -1
- package/CHANGELOG.md +34 -0
- package/package.json +1 -1
- package/sandbox.js +39 -90
- package/scripts/csdr/config/angular.js +27 -23
- package/scripts/csdr/config/global.js +1 -1
- package/scripts/csdr/config/packages.js +19 -9
- package/scripts/csdr/config/projects.js +42 -4
- package/scripts/csdr/config/sync.js +16 -1
- package/scripts/csdr/init/init-utils.js +62 -0
- package/scripts/csdr/init/init.js +29 -6
- package/scripts/csdr/init/meta.js +3 -2
- package/scripts/csdr/init/repos.js +5 -31
- package/scripts/csdr/install/common.js +33 -10
- package/scripts/csdr/install/local-dev.js +5 -0
- package/scripts/csdr/install/projects.js +11 -0
- package/scripts/csdr/release/package/release-package.js +26 -56
- package/scripts/csdr/version/app-default.js +0 -3
- package/scripts/csdr/version/package-common.js +2 -4
- package/scripts/csdr/version/package-remote.js +0 -4
- package/scripts/index.js +0 -2
- package/scripts/utils/build/package/build-package-utils.js +5 -13
- package/scripts/utils/build/package/maven.js +6 -12
- package/scripts/utils/build/package/nodeJs.js +0 -1
- package/scripts/utils/build/package/postcss.config.js +0 -2
- package/scripts/utils/build/package/styles.js +1 -0
- package/scripts/utils/changelog-utils.js +4 -2
- package/scripts/utils/git-utils.js +46 -0
- package/scripts/utils/pre-build/elements.js +1 -1
- package/scripts/utils/pre-build/injection/config.js +21 -134
- package/scripts/utils/pre-build/injection/externals.js +135 -90
- package/scripts/utils/pre-build/injection/routes-replacement.js +67 -15
- package/scripts/utils/pre-build/injection/skeletons.js +3 -2
- package/scripts/utils/pre-build/projects.js +1 -3
- package/scripts/utils/publish/npm.js +1 -2
- package/scripts/utils/serve/element.js +17 -2
- package/scripts/utils/svg-utils.js +2 -3
- package/scripts/utils/test/test-utils.js +5 -49
- package/scripts/utils/tools.js +4 -1
- package/scripts/utils/build/package/nestJs.js +0 -45
- package/scripts/utils/build/package/stencil.js +0 -13
|
@@ -5,7 +5,7 @@ const path = require('path');
|
|
|
5
5
|
const tools = require('../../tools');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// TODO DEPRECATE - check PMO Mobile, the main user of this (active)
|
|
9
9
|
module.exports.injectCsdrSkeletonSources = (project) => {
|
|
10
10
|
|
|
11
11
|
tools.logInfo(`Injecting CSDR skeleton sources for : ${project.name}`);
|
|
@@ -26,6 +26,7 @@ module.exports.injectCsdrSkeletonSources = (project) => {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
// TODO DEPRECATE !
|
|
29
30
|
module.exports.injectCsdrSkeletonEuiShowcaseSources = (project) => {
|
|
30
31
|
|
|
31
32
|
tools.logInfo(`Injecting CSDR eUI showcase skeleton sources for : ${project.name}`);
|
|
@@ -45,7 +46,7 @@ module.exports.injectCsdrSkeletonEuiShowcaseSources = (project) => {
|
|
|
45
46
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
// THIS INJECTION MAINLY USED FOR SHOWCASES
|
|
49
50
|
module.exports.injectCsdrFullSkeletonSources = (project, euiVersion) => {
|
|
50
51
|
|
|
51
52
|
tools.logInfo(`Injecting CSDR full skeleton sources for : ${project.name} - eUI version : ${euiVersion}`);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const fs = require('fs');
|
|
4
3
|
const path = require('path');
|
|
5
4
|
|
|
6
5
|
const tools = require('../tools');
|
|
@@ -30,7 +29,6 @@ module.exports.preBuild = (project, envTarget, build, configEnvTarget) => {
|
|
|
30
29
|
})
|
|
31
30
|
|
|
32
31
|
.then(() => {
|
|
33
|
-
tools.logInfo('Registering angular project definition...');
|
|
34
32
|
return configUtils.angular.registerAngularProjectDef(project, build);
|
|
35
33
|
})
|
|
36
34
|
|
|
@@ -121,7 +119,7 @@ module.exports.preBuild = (project, envTarget, build, configEnvTarget) => {
|
|
|
121
119
|
);
|
|
122
120
|
} else {
|
|
123
121
|
tools.logInfo(`Clearing ${rootTargetFolder}/assets/openid-login.js`);
|
|
124
|
-
|
|
122
|
+
tools.writeFileContent(
|
|
125
123
|
path.join(project.paths.angularPath, `${rootTargetFolder}/assets/openid-login.js`),
|
|
126
124
|
''
|
|
127
125
|
);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
// GLOBAL
|
|
4
4
|
const path = require('path');
|
|
5
|
-
const fs = require('fs');
|
|
6
5
|
const execa = require('execa');
|
|
7
6
|
|
|
8
7
|
// LOCAL
|
|
@@ -61,7 +60,7 @@ const publishCore = (pkg, registry, isPublicAccess) => {
|
|
|
61
60
|
tools.logInfo('Write version properties file');
|
|
62
61
|
|
|
63
62
|
const versionFile = path.resolve(pkg.paths.pkgDirectory, '.version.properties');
|
|
64
|
-
|
|
63
|
+
tools.writeFileContent(versionFile, version);
|
|
65
64
|
})
|
|
66
65
|
|
|
67
66
|
.catch((e) => {
|
|
@@ -38,7 +38,14 @@ module.exports.serve = () => {
|
|
|
38
38
|
args = [ng, 'build', pkg.name];
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
const
|
|
41
|
+
const projectConfig = configUtils.projects.getProject(project);
|
|
42
|
+
|
|
43
|
+
let destPath;
|
|
44
|
+
if (projectConfig.host && projectConfig.virtual) {
|
|
45
|
+
destPath = path.join(process.cwd(), 'hosts', project, 'src', 'assets', 'elements', pkg.name, 'bundles');
|
|
46
|
+
} else {
|
|
47
|
+
destPath = path.join(process.cwd(), 'apps', project, 'src', 'assets', 'elements', pkg.name, 'bundles');
|
|
48
|
+
}
|
|
42
49
|
|
|
43
50
|
const versionNumber = remoteEuiVersion.split('.')[0];
|
|
44
51
|
|
|
@@ -102,7 +109,15 @@ module.exports.serve = () => {
|
|
|
102
109
|
|
|
103
110
|
}
|
|
104
111
|
|
|
105
|
-
|
|
112
|
+
const spawnSync = require('child_process').spawnSync;
|
|
113
|
+
const output = spawnSync('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
|
|
114
|
+
|
|
115
|
+
if (output.error) {
|
|
116
|
+
throw new Error(JSON.stringify(output));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// breaking on MacOS for unknown reasons...
|
|
120
|
+
// return execa('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
|
|
106
121
|
})
|
|
107
122
|
.catch((e) => {
|
|
108
123
|
throw e;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const fs = require('fs');
|
|
4
3
|
const path = require('path');
|
|
5
4
|
const tools = require('./tools');
|
|
6
5
|
|
|
@@ -23,14 +22,14 @@ const writeSprite = (srcPath, files, destPath, outputFile) => {
|
|
|
23
22
|
spriter.add(
|
|
24
23
|
filePath,
|
|
25
24
|
file,
|
|
26
|
-
|
|
25
|
+
tools.getFileContent(filePath),
|
|
27
26
|
);
|
|
28
27
|
});
|
|
29
28
|
|
|
30
29
|
spriter.compile((error, result) => {
|
|
31
30
|
Object.keys(result).forEach((mode) => {
|
|
32
31
|
Object.keys(result[mode]).forEach((resource) => {
|
|
33
|
-
|
|
32
|
+
tools.writeFileContent(
|
|
34
33
|
path.join(destPath, outputFile),
|
|
35
34
|
result[mode][resource].contents
|
|
36
35
|
);
|
|
@@ -24,19 +24,15 @@ module.exports.run = () => {
|
|
|
24
24
|
.then(() => {
|
|
25
25
|
tools.logInfo(`Testing package : ${pkg.name}...`);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
return this.runJest(pkg);
|
|
29
|
-
} else {
|
|
30
|
-
const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
|
|
27
|
+
const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
let args = ['--max_old_space_size=8096', ng, 'test', pkg.name];
|
|
33
30
|
|
|
34
|
-
|
|
31
|
+
args.push('--code-coverage');
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
tools.logInfo(`running ng test : with args: ${args} on folder : ${pkg.paths.pkgRootDirectory}`);
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
}
|
|
35
|
+
return execa('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
|
|
40
36
|
})
|
|
41
37
|
|
|
42
38
|
.catch((e) => {
|
|
@@ -46,46 +42,6 @@ module.exports.run = () => {
|
|
|
46
42
|
|
|
47
43
|
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
module.exports.runJest = (pkg) => {
|
|
51
|
-
return Promise.resolve()
|
|
52
|
-
.then(() => {
|
|
53
|
-
tools.logTitle(`Executing Jest test for pkg: ${pkg.name}`);
|
|
54
|
-
|
|
55
|
-
// set process env
|
|
56
|
-
process.env._TEST = true;
|
|
57
|
-
|
|
58
|
-
// set jest binary
|
|
59
|
-
const jest = path.resolve(process.cwd(), 'node_modules', 'jest', 'bin', 'jest');
|
|
60
|
-
|
|
61
|
-
// default arguments
|
|
62
|
-
let args = [jest, pkg.paths.pkgFromRoot, '--verbose'];
|
|
63
|
-
|
|
64
|
-
// other args
|
|
65
|
-
if (!skipCoverage) {
|
|
66
|
-
args.push('--coverage');
|
|
67
|
-
args.push(`--coverageDirectory=${path.join(pkg.paths.pkgDirectory, 'coverage')}`);
|
|
68
|
-
}
|
|
69
|
-
if (watch) {
|
|
70
|
-
args.push('--watch');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return execa('node', args, { cwd: process.cwd(), stdio: 'inherit' });
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
.then(() => {
|
|
77
|
-
// clear env var
|
|
78
|
-
process.env._TEST = false;
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
.catch((e) => {
|
|
82
|
-
// clear env var
|
|
83
|
-
process.env._TEST = false;
|
|
84
|
-
throw e;
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
45
|
module.exports.runMocha = (pkg) => {
|
|
90
46
|
return Promise.resolve()
|
|
91
47
|
.then(() => {
|
package/scripts/utils/tools.js
CHANGED
|
@@ -733,7 +733,9 @@ function logVersion() {
|
|
|
733
733
|
} catch(e) {}
|
|
734
734
|
}
|
|
735
735
|
|
|
736
|
-
|
|
736
|
+
function isFalse(item) {
|
|
737
|
+
return item === undefined || item === false;
|
|
738
|
+
}
|
|
737
739
|
|
|
738
740
|
|
|
739
741
|
|
|
@@ -802,3 +804,4 @@ module.exports.logBigTitle = logBigTitle;
|
|
|
802
804
|
module.exports.removeFilesExtension = removeFilesExtension;
|
|
803
805
|
module.exports.splitNpmPkg = splitNpmPkg;
|
|
804
806
|
module.exports.logVersion = logVersion;
|
|
807
|
+
module.exports.isFalse = isFalse;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// GLOBAL
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const execa = require('execa');
|
|
6
|
-
|
|
7
|
-
// LOCAL
|
|
8
|
-
const tools = require('../../tools');
|
|
9
|
-
const notificationUtils = require('../../notification/notification-utils');
|
|
10
|
-
|
|
11
|
-
// FETCH ARGS
|
|
12
|
-
let { deps, skipClean, skipLint, skipTest, skipCompile, skipDoc } = tools.getArgs();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
module.exports.build = (pkg, isMaster) => {
|
|
18
|
-
tools.logTitle('Building NestJS backend package...');
|
|
19
|
-
|
|
20
|
-
const nestjs = path.resolve(process.cwd(), 'node_modules', '@nestjs', 'cli', 'bin', 'nest');
|
|
21
|
-
|
|
22
|
-
return Promise.resolve()
|
|
23
|
-
.then(() => {
|
|
24
|
-
tools.logInfo(`Clean dist folder : ${pkg.paths.pkgBuild}`);
|
|
25
|
-
return tools.rimraf(pkg.paths.pkgBuild);
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
.then(() => {
|
|
29
|
-
tools.logInfo('Executing NestJS build...');
|
|
30
|
-
let args = [nestjs, 'build'];
|
|
31
|
-
|
|
32
|
-
tools.logInfo(`running nestjs build : with args: ${args} on folder : ${pkg.paths.pkgRootDirectory}`);
|
|
33
|
-
|
|
34
|
-
return execa('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
.then(() => {
|
|
38
|
-
return notificationUtils.package.sendPackageMessage({
|
|
39
|
-
package: pkg
|
|
40
|
-
})
|
|
41
|
-
})
|
|
42
|
-
.catch((e) => {
|
|
43
|
-
throw e;
|
|
44
|
-
});
|
|
45
|
-
}
|