@eui/cli 21.0.0-alpha.23 → 21.0.0-alpha.24
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 +60 -39
- package/bin/scripts/new.js +39 -0
- package/bin/scripts/serve-app.js +12 -0
- package/lib/install.js +0 -3
- package/lib/skeletons/_angular/base/package.json +23 -26
- package/lib/skeletons/_angular/base-mobile/package.json +1 -1
- package/lib/skeletons/web-symfony/myapp-web/package.json +2 -2
- package/lib/utils.js +4 -0
- package/package.json +4 -3
package/bin/eui-cli.js
CHANGED
|
@@ -1,42 +1,63 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const
|
|
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
|
-
|
|
3
|
+
const spawn = require('cross-spawn');
|
|
4
|
+
const args = process.argv.slice(2);
|
|
5
|
+
|
|
6
|
+
const scriptIndex = args.findIndex(
|
|
7
|
+
(x) =>
|
|
8
|
+
x === 'new' ||
|
|
9
|
+
x === 'build-app' ||
|
|
10
|
+
x === 'serve-app' ||
|
|
11
|
+
x === 'lint-app' ||
|
|
12
|
+
x === 'start-symfony' ||
|
|
13
|
+
x === 'generate-translations' ||
|
|
14
|
+
x === 'generate-sprite' ||
|
|
15
|
+
x === 'generate-translations' ||
|
|
16
|
+
x === 'generate-app-metadata' ||
|
|
17
|
+
x === 'help' ||
|
|
18
|
+
x === 'inject-config-app'
|
|
19
|
+
);
|
|
20
|
+
const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
|
|
21
|
+
const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];
|
|
22
|
+
|
|
23
|
+
switch (script) {
|
|
24
|
+
case 'new':
|
|
25
|
+
case 'build-app':
|
|
26
|
+
case 'serve-app':
|
|
27
|
+
case 'lint-app':
|
|
28
|
+
case 'start-symfony':
|
|
29
|
+
case 'generate-translations':
|
|
30
|
+
case 'generate-sprite':
|
|
31
|
+
case 'generate-app-metadata':
|
|
32
|
+
case 'help':
|
|
33
|
+
case 'inject-config-app': {
|
|
34
|
+
const result = spawn.sync(
|
|
35
|
+
'node',
|
|
36
|
+
nodeArgs
|
|
37
|
+
.concat(require.resolve('./scripts/' + script))
|
|
38
|
+
.concat(args.slice(scriptIndex + 1)),
|
|
39
|
+
{ stdio: 'inherit' }
|
|
40
|
+
);
|
|
41
|
+
if (result.signal) {
|
|
42
|
+
if (result.signal === 'SIGKILL') {
|
|
43
|
+
console.log(
|
|
44
|
+
'The build failed because the process exited too early. '+
|
|
45
|
+
'This probably means the system ran out of memory or someone called ' +
|
|
46
|
+
'`kill -9` on the process.'
|
|
47
|
+
);
|
|
48
|
+
} else if(result.signal === 'SIGTERM') {
|
|
49
|
+
console.log(
|
|
50
|
+
'The build failed because the process exited too early. ' +
|
|
51
|
+
'Someone might have called `kill` or `killall`, or the system could ' +
|
|
52
|
+
'be shutting down.'
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
process.exit(result.status);
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
default:
|
|
61
|
+
console.log('Unknown script "' + script + '".');
|
|
62
|
+
break;
|
|
42
63
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const generators = require('../../lib/generators');
|
|
3
|
+
const config = require('../../lib/config');
|
|
4
|
+
const utils = require('../../lib/utils');
|
|
5
|
+
|
|
6
|
+
// fetching cli arguments
|
|
7
|
+
const args = utils.getArgs();
|
|
8
|
+
|
|
9
|
+
// Print header and version
|
|
10
|
+
utils.logBigTitle('eUI CLI');
|
|
11
|
+
utils.logAccent(` --- v${config.version} ---\n`);
|
|
12
|
+
|
|
13
|
+
// remapping config if passed as argument - automated mode
|
|
14
|
+
let inputConfig = config.parseInputConfig(args.config);
|
|
15
|
+
|
|
16
|
+
// Detecting targetPath and create it if present as argument - local and automated mode
|
|
17
|
+
let targetPath;
|
|
18
|
+
|
|
19
|
+
if (args.targetPath) {
|
|
20
|
+
targetPath = path.join(config.targetPath, args.targetPath);
|
|
21
|
+
|
|
22
|
+
if (!tools.isDirExists(targetPath)) {
|
|
23
|
+
utils.mkdir(targetPath);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// otherwise taking the default config targetPath defined
|
|
27
|
+
} else {
|
|
28
|
+
targetPath = config.targetPath;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (args.v) {
|
|
32
|
+
console.info('Current eUI CLI version installed : ' + config.version);
|
|
33
|
+
|
|
34
|
+
} else {
|
|
35
|
+
return generators.appGenerate({
|
|
36
|
+
inputConfig: inputConfig,
|
|
37
|
+
targetPath: targetPath
|
|
38
|
+
});
|
|
39
|
+
}
|
package/lib/install.js
CHANGED
|
@@ -29,9 +29,6 @@ const install = (cliConfig, targetPath) => {
|
|
|
29
29
|
console.log('*****************************************************');
|
|
30
30
|
|
|
31
31
|
return Promise.resolve()
|
|
32
|
-
.then(() => {
|
|
33
|
-
return tools.remove(path.join(wd, 'yarn.lock'));
|
|
34
|
-
})
|
|
35
32
|
.then(() => {
|
|
36
33
|
return execSync("yarn", { cwd: wd, stdio: "inherit" });
|
|
37
34
|
})
|
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eui-angular-app",
|
|
3
|
-
"version": "21.0.0-alpha.
|
|
3
|
+
"version": "21.0.0-alpha.24",
|
|
4
4
|
"license": "EUPL-1.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"ng": "ng",
|
|
7
7
|
"start-mock-server": "nodemon --watch ./mock ./mock/server.js",
|
|
8
|
-
"start-serve": "eui-
|
|
8
|
+
"start-serve": "eui-cli serve-app --configuration=proxy-mock",
|
|
9
9
|
"start": "npm-run-all --parallel start-mock-server start-serve",
|
|
10
|
-
"start-proxy": "eui-
|
|
11
|
-
"start-local": "eui-
|
|
12
|
-
"build": "eui-
|
|
13
|
-
"build-dev": "eui-
|
|
14
|
-
"build-prod": "eui-
|
|
15
|
-
"build-prod-skip-test": "eui-
|
|
16
|
-
"build-prod-stats": "eui-
|
|
17
|
-
"app:build": "eui-
|
|
18
|
-
"app:inject-config": "eui-
|
|
19
|
-
"generate-changelog": "eui-
|
|
20
|
-
"generate-sprite": "eui-
|
|
10
|
+
"start-proxy": "eui-cli serve-app --configuration=proxy",
|
|
11
|
+
"start-local": "eui-cli serve-app",
|
|
12
|
+
"build": "eui-cli build-app",
|
|
13
|
+
"build-dev": "eui-cli build-app --configuration=development --configEnvTarget=dev",
|
|
14
|
+
"build-prod": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod",
|
|
15
|
+
"build-prod-skip-test": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod --skipTest",
|
|
16
|
+
"build-prod-stats": "eui-cli build-app --configuration=production-optimized --configEnvTarget=prod --statsJson",
|
|
17
|
+
"app:build": "eui-cli build-app",
|
|
18
|
+
"app:inject-config": "eui-cli inject-config-app",
|
|
19
|
+
"generate-changelog": "eui-cli generate-changelog",
|
|
20
|
+
"generate-sprite": "eui-cli generate-sprite"
|
|
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.24"
|
|
25
25
|
},
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"express": "4.21.2",
|
|
36
|
-
"path-to-regexp": "1.9.0"
|
|
37
|
-
}
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"npm-run-all": "4.1.5",
|
|
28
|
+
"json-server": "1.0.0-beta.3",
|
|
29
|
+
"nodemon": "2.0.22",
|
|
30
|
+
"lowdb": "1.0.0",
|
|
31
|
+
"body-parser": "1.20.3",
|
|
32
|
+
"express": "4.21.2"
|
|
33
|
+
},
|
|
34
|
+
"resolutions": {}
|
|
38
35
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eui-angular-app",
|
|
3
|
-
"version": "21.0.0-alpha.
|
|
3
|
+
"version": "21.0.0-alpha.24",
|
|
4
4
|
"license": "EUPL-1.1",
|
|
5
5
|
"description": "eUI JEE Symfony app scripts",
|
|
6
6
|
"scripts": {
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
},
|
|
19
19
|
"private": true,
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@eui/deps-base": "21.0.0-alpha.
|
|
21
|
+
"@eui/deps-base": "21.0.0-alpha.24"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/lib/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eui/cli",
|
|
3
|
-
"version": "21.0.0-alpha.
|
|
3
|
+
"version": "21.0.0-alpha.24",
|
|
4
4
|
"tag": "next",
|
|
5
5
|
"license": "EUPL-1.1",
|
|
6
|
-
"description": "eUI CLI app generator",
|
|
6
|
+
"description": "eUI CLI app generator & tools",
|
|
7
7
|
"bin": {
|
|
8
8
|
"eui-cli": "bin/eui-cli.js"
|
|
9
9
|
},
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"yargs": "17.7.2",
|
|
19
19
|
"fs-extra": "9.0.0",
|
|
20
20
|
"rimraf": "3.0.2",
|
|
21
|
-
"glob": "7.2.3"
|
|
21
|
+
"glob": "7.2.3",
|
|
22
|
+
"cross-spawn": "7.0.6"
|
|
22
23
|
},
|
|
23
24
|
"preferGlobal": true,
|
|
24
25
|
"homepage": "https://eui.ecdevops.eu",
|