@eui/cli 21.0.0-alpha.25 → 21.0.0-alpha.27
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/bin/eui-cli.js +9 -5
- package/bin/scripts/build-app.js +12 -0
- package/bin/scripts/lint-app.js +22 -0
- package/lib/app-utils/build.js +176 -0
- package/lib/app-utils/serve.js +2 -0
- package/lib/skeletons/_angular/base/package.json +2 -2
- package/lib/skeletons/_angular/base-mobile/package.json +1 -1
- package/package.json +1 -1
- package/lib/skeletons/web-symfony/myapp-web/package.json +0 -23
package/bin/eui-cli.js
CHANGED
|
@@ -5,14 +5,13 @@ const args = process.argv.slice(2);
|
|
|
5
5
|
|
|
6
6
|
const scriptIndex = args.findIndex(
|
|
7
7
|
(x) =>
|
|
8
|
+
x === '' ||
|
|
9
|
+
x === undefined ||
|
|
8
10
|
x === 'new' ||
|
|
9
11
|
x === 'build-app' ||
|
|
10
12
|
x === 'serve-app' ||
|
|
11
13
|
x === 'lint-app' ||
|
|
12
|
-
x === 'start-symfony' ||
|
|
13
|
-
x === 'generate-translations' ||
|
|
14
14
|
x === 'generate-sprite' ||
|
|
15
|
-
x === 'generate-translations' ||
|
|
16
15
|
x === 'generate-app-metadata' ||
|
|
17
16
|
x === 'help' ||
|
|
18
17
|
x === 'inject-config-app'
|
|
@@ -21,20 +20,25 @@ const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
|
|
|
21
20
|
const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];
|
|
22
21
|
|
|
23
22
|
switch (script) {
|
|
23
|
+
case '':
|
|
24
|
+
case undefined:
|
|
24
25
|
case 'new':
|
|
25
26
|
case 'build-app':
|
|
26
27
|
case 'serve-app':
|
|
27
28
|
case 'lint-app':
|
|
28
|
-
case 'start-symfony':
|
|
29
29
|
case 'generate-translations':
|
|
30
30
|
case 'generate-sprite':
|
|
31
31
|
case 'generate-app-metadata':
|
|
32
32
|
case 'help':
|
|
33
33
|
case 'inject-config-app': {
|
|
34
|
+
let genScript = script;
|
|
35
|
+
if (script === '' || script === undefined) {
|
|
36
|
+
genScript = 'new';
|
|
37
|
+
}
|
|
34
38
|
const result = spawn.sync(
|
|
35
39
|
'node',
|
|
36
40
|
nodeArgs
|
|
37
|
-
.concat(require.resolve('./scripts/' +
|
|
41
|
+
.concat(require.resolve('./scripts/' + genScript))
|
|
38
42
|
.concat(args.slice(scriptIndex + 1)),
|
|
39
43
|
{ stdio: 'inherit' }
|
|
40
44
|
);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const childProcess = require('child_process');
|
|
5
|
+
const execSync = childProcess.execSync;
|
|
6
|
+
|
|
7
|
+
const utils = require('../../lib/utils');
|
|
8
|
+
|
|
9
|
+
Promise.resolve()
|
|
10
|
+
.then(() => {
|
|
11
|
+
const prjName = 'app';
|
|
12
|
+
|
|
13
|
+
utils.logTitle(`Linting application : ${prjName}...`);
|
|
14
|
+
|
|
15
|
+
const ng = path.resolve(process.cwd(), '@angular', 'cli', 'bin', 'ng');
|
|
16
|
+
|
|
17
|
+
execSync(`ng lint ${prjName}`);
|
|
18
|
+
})
|
|
19
|
+
.catch((e) => {
|
|
20
|
+
console.error(e);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
});
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// TODO v21 - app prebuild for config injection from eUI tools
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const childProcess = require('child_process');
|
|
5
|
+
const execSync = childProcess.execSync;
|
|
6
|
+
|
|
7
|
+
const utils = require('../utils');
|
|
8
|
+
|
|
9
|
+
// const execa = require('execa');
|
|
10
|
+
|
|
11
|
+
// const tools = require('../../tools');
|
|
12
|
+
// const mavenUtils = require('../../maven-utils');
|
|
13
|
+
// const configUtils = require('../../../csdr/config/config-utils');
|
|
14
|
+
// const versionUtils = require('../../../csdr/version/version-utils');
|
|
15
|
+
|
|
16
|
+
// const preBuildUtils = require('../../pre-build/pre-build-utils');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
module.exports.run = () => {
|
|
20
|
+
let {
|
|
21
|
+
skipLint,
|
|
22
|
+
skipTest,
|
|
23
|
+
skipCompile,
|
|
24
|
+
configuration,
|
|
25
|
+
baseHref,
|
|
26
|
+
servePath,
|
|
27
|
+
watch,
|
|
28
|
+
dryRun,
|
|
29
|
+
maxSpaceSize,
|
|
30
|
+
statsJson,
|
|
31
|
+
extraWebpackConfig,
|
|
32
|
+
ci,
|
|
33
|
+
deployUrl,
|
|
34
|
+
sourceMap,
|
|
35
|
+
configEnvTarget,
|
|
36
|
+
} = utils.getArgs();
|
|
37
|
+
|
|
38
|
+
const prjName = 'app';
|
|
39
|
+
|
|
40
|
+
utils.logTitle(`Building application : ${prjName}...`);
|
|
41
|
+
|
|
42
|
+
const ng = path.resolve(process.cwd(), '@angular', 'cli', 'bin', 'ng');
|
|
43
|
+
|
|
44
|
+
return Promise.resolve()
|
|
45
|
+
// .then(() => {
|
|
46
|
+
// return preBuildUtils.projects.preBuild(currentProject, envTarget, true, configEnvTarget);
|
|
47
|
+
// })
|
|
48
|
+
|
|
49
|
+
.then(() => {
|
|
50
|
+
if (!skipLint) {
|
|
51
|
+
utils.logInfo(`running ng lint ${prjName}`);
|
|
52
|
+
execSync(`ng lint ${prjName}`);
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
.then(() => {
|
|
57
|
+
if (!skipLint) {
|
|
58
|
+
utils.logSuccess();
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
.then(() => {
|
|
63
|
+
if (!skipLint) {
|
|
64
|
+
utils.logSuccess();
|
|
65
|
+
}
|
|
66
|
+
if (!skipTest) {
|
|
67
|
+
utils.logInfo(`Launching application unit testing...`);
|
|
68
|
+
|
|
69
|
+
let args;
|
|
70
|
+
|
|
71
|
+
if (maxSpaceSize) {
|
|
72
|
+
args = ['--max_old_space_size=8096', ng, 'test', prjName];
|
|
73
|
+
} else {
|
|
74
|
+
args = [ng, 'test', prjName];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (watch) {
|
|
78
|
+
args.push(`--watch=true`);
|
|
79
|
+
} else {
|
|
80
|
+
args.push(`--watch=false`);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
args.push('--code-coverage');
|
|
84
|
+
|
|
85
|
+
utils.logInfo(`ng test : watching = ${watch || false}`);
|
|
86
|
+
|
|
87
|
+
utils.logInfo(`running Angular TEST with args: ${args} on :`);
|
|
88
|
+
|
|
89
|
+
if (!dryRun) {
|
|
90
|
+
execSync(`node ${args.join(' ')}`, { cwd: currentProject.paths.angularPath, stdio: 'inherit' });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
.then(() => {
|
|
96
|
+
if (!skipTest) {
|
|
97
|
+
utils.logSuccess();
|
|
98
|
+
}
|
|
99
|
+
utils.logInfo(`Launching application build...`);
|
|
100
|
+
|
|
101
|
+
let args;
|
|
102
|
+
|
|
103
|
+
if (maxSpaceSize) {
|
|
104
|
+
args = ['--max_old_space_size=8096', ng, 'build', prjName, '--aot'];
|
|
105
|
+
} else {
|
|
106
|
+
args = [ng, 'build', prjName, '--aot'];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (statsJson) {
|
|
110
|
+
args.push('--stats-json');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (configuration) {
|
|
114
|
+
args.push(`--configuration=${configuration}`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (baseHref) {
|
|
118
|
+
args.push(`--base-href=${baseHref}`);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (servePath) {
|
|
122
|
+
args.push(`--serve-path=${servePath}`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (deployUrl) {
|
|
126
|
+
args.push(`--deploy-url=${deployUrl}`);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (ci) {
|
|
130
|
+
args.push('--progress=false');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (sourceMap) {
|
|
134
|
+
args.push('--source-map');
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
utils.logInfo(`ng build for configuration : ${configuration || 'production'}`);
|
|
138
|
+
|
|
139
|
+
utils.logInfo(`running Angular BUILD with args: ${args}`);
|
|
140
|
+
|
|
141
|
+
if (!dryRun && !skipCompile) {
|
|
142
|
+
execSync(`node ${args.join(' ')}`, { cwd: currentProject.paths.angularPath, stdio: 'inherit' });
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
// .then(() => {
|
|
147
|
+
// const projectVersion = parseInt(configUtils.projects.getProjectEuiVersion(currentProject));
|
|
148
|
+
|
|
149
|
+
// if (currentProject.build && currentProject.build.skipBrowserOutputPath) {
|
|
150
|
+
// if (currentProject.build.esbuild || projectVersion >= 18) {
|
|
151
|
+
// utils.copydir(path.join(currentProject.paths.rootPath, 'dist', 'browser'), path.join(currentProject.paths.rootPath, 'dist'));
|
|
152
|
+
// utils.remove(path.join(currentProject.paths.rootPath, 'dist', 'browser'));
|
|
153
|
+
// }
|
|
154
|
+
// }
|
|
155
|
+
// })
|
|
156
|
+
|
|
157
|
+
// .then(() => {
|
|
158
|
+
// const desti18ncompiledPath = path.join(currentProject.paths.rootPath, 'dist', 'assets', 'i18n-compiled');
|
|
159
|
+
// if (utils.isDirExists(desti18ncompiledPath)) {
|
|
160
|
+
// utils.logTitle('Post-build assets i18n-compiled folder content:');
|
|
161
|
+
// const i18nfiles = utils.getFiles(desti18ncompiledPath);
|
|
162
|
+
// console.log(i18nfiles);
|
|
163
|
+
// }
|
|
164
|
+
|
|
165
|
+
// const mediaAssetsPath = path.join(currentProject.paths.rootPath, 'dist', 'assets', 'media');
|
|
166
|
+
// if (utils.isDirExists(mediaAssetsPath)) {
|
|
167
|
+
// utils.copydirFiles(mediaAssetsPath, path.join(currentProject.paths.rootPath, 'dist', 'media'));
|
|
168
|
+
// }
|
|
169
|
+
// })
|
|
170
|
+
|
|
171
|
+
.catch((e) => {
|
|
172
|
+
throw e;
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
|
package/lib/app-utils/serve.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eui-angular-app",
|
|
3
|
-
"version": "21.0.0-alpha.
|
|
3
|
+
"version": "21.0.0-alpha.27",
|
|
4
4
|
"license": "EUPL-1.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"ng": "ng",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"private": true,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@eui/deps-base": "21.0.0-alpha.
|
|
24
|
+
"@eui/deps-base": "21.0.0-alpha.27"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"npm-run-all": "4.1.5",
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "eui-angular-app",
|
|
3
|
-
"version": "21.0.0-alpha.24",
|
|
4
|
-
"license": "EUPL-1.1",
|
|
5
|
-
"description": "eUI JEE Symfony app scripts",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"ng": "ng",
|
|
8
|
-
"e2e": "ng e2e",
|
|
9
|
-
"stylelint": "stylelint \"src/**/*.scss\"",
|
|
10
|
-
"tslint": "tslint \"src/**/*.ts\"",
|
|
11
|
-
"clean": "rimraf out-tsc dist packages/**/dist/** packages/**/out-tsc/** packages/**/src/lib/**/*.js packages/**/src/lib/**/*.js.map",
|
|
12
|
-
"start-symfony": "eui-scripts start-symfony --configuration=dev",
|
|
13
|
-
"start-serve": "eui-scripts serve-app --configuration=proxy-mock",
|
|
14
|
-
"start": "npm run clean && npm-run-all --parallel start-symfony start-serve",
|
|
15
|
-
"start-mean": "npm run clean && npm-run-all --parallel start-mock-server-mean start-serve",
|
|
16
|
-
"start-proxy": "npm run clean && eui-scripts serve-app --configuration=proxy",
|
|
17
|
-
"generate-changelog": "eui-scripts generate-changelog"
|
|
18
|
-
},
|
|
19
|
-
"private": true,
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@eui/deps-base": "21.0.0-alpha.24"
|
|
22
|
-
}
|
|
23
|
-
}
|