@eui/cli 21.0.0-alpha.9 → 21.0.0-next.2

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.
Files changed (80) hide show
  1. package/README.md +1 -1
  2. package/bin/eui-cli.js +61 -41
  3. package/bin/scripts/build-app.js +12 -0
  4. package/bin/scripts/lint-app.js +22 -0
  5. package/bin/scripts/new.js +39 -0
  6. package/bin/scripts/serve-app.js +12 -0
  7. package/lib/app-utils/build.js +176 -0
  8. package/lib/app-utils/projects.js +41 -0
  9. package/lib/app-utils/serve.js +78 -0
  10. package/lib/build.js +14 -39
  11. package/lib/cli.js +22 -5
  12. package/lib/config.js +1 -0
  13. package/lib/generators.js +5 -8
  14. package/lib/install.js +7 -7
  15. package/lib/post-build.js +1 -3
  16. package/lib/skeletons/_angular/base/angular.json +2 -31
  17. package/lib/skeletons/_angular/base/package.json +24 -23
  18. package/lib/skeletons/_angular/base/src/app/app.component.spec.ts +2 -2
  19. package/lib/skeletons/_angular/base/src/app/app.component.ts +2 -2
  20. package/lib/skeletons/_angular/base/src/app/features/module2/module2.component.ts +1 -1
  21. package/lib/skeletons/_angular/base/src/karma.conf.js +42 -2
  22. package/lib/skeletons/_angular/base/src/tsconfig.spec.json +1 -5
  23. package/lib/skeletons/_angular/base/tsconfig.json +1 -1
  24. package/lib/skeletons/_angular/base-mobile/package.json +4 -4
  25. package/lib/skeletons/_angular/base-mobile/tsconfig.json +27 -0
  26. package/lib/skeletons/_angular/options/ecl-ec/src/app/app.component.ts +16 -16
  27. package/lib/skeletons/_angular/options/ecl-ec/src/app/features/home/home.component.ts +4 -4
  28. package/lib/skeletons/_angular/options/ecl-eu/src/app/app.component.ts +16 -16
  29. package/lib/skeletons/_angular/options/ecl-eu/src/app/features/home/home.component.ts +4 -4
  30. package/lib/skeletons/_angular/options/ecl-eu/src/app/shared/shared.module.ts +1 -5
  31. package/lib/skeletons/_angular/options/pnpm/package.json +72 -0
  32. package/lib/utils.js +204 -0
  33. package/package.json +10 -13
  34. package/.version.properties +0 -1
  35. package/lib/skeletons/_angular/base/.euirc.json +0 -8
  36. package/lib/skeletons/web-symfony/myapp-web/angular.json +0 -169
  37. package/lib/skeletons/web-symfony/myapp-web/package.json +0 -23
  38. package/lib/skeletons/web-symfony/myapp-web/src/app/app-routing.module.ts +0 -18
  39. package/lib/skeletons/web-symfony/myapp-web/src/app/app.component.ts +0 -77
  40. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.html +0 -160
  41. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.scss +0 -0
  42. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/components/products.component.ts +0 -104
  43. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/models/product.model.ts +0 -6
  44. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/products-routing.module.ts +0 -16
  45. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/products.module.ts +0 -16
  46. package/lib/skeletons/web-symfony/myapp-web/src/app/features/products/services/products.service.ts +0 -29
  47. package/lib/skeletons/web-symfony/myapp-web/src/environments/environment.ts +0 -17
  48. package/lib/skeletons/web-symfony/myapp-web-rest/.env +0 -28
  49. package/lib/skeletons/web-symfony/myapp-web-rest/bin/console +0 -42
  50. package/lib/skeletons/web-symfony/myapp-web-rest/composer.json +0 -67
  51. package/lib/skeletons/web-symfony/myapp-web-rest/composer.lock +0 -3572
  52. package/lib/skeletons/web-symfony/myapp-web-rest/config/bootstrap.php +0 -21
  53. package/lib/skeletons/web-symfony/myapp-web-rest/config/bundles.php +0 -12
  54. package/lib/skeletons/web-symfony/myapp-web-rest/config/config.yml +0 -0
  55. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/cache.yaml +0 -19
  56. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/dev/routing.yaml +0 -3
  57. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/doctrine.yaml +0 -29
  58. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/doctrine_migrations.yaml +0 -5
  59. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/framework.yaml +0 -17
  60. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/prod/doctrine.yaml +0 -32
  61. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/routing.yaml +0 -4
  62. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/sensio_framework_extra.yaml +0 -3
  63. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/test/framework.yaml +0 -4
  64. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/test/routing.yaml +0 -3
  65. package/lib/skeletons/web-symfony/myapp-web-rest/config/packages/twig.yaml +0 -4
  66. package/lib/skeletons/web-symfony/myapp-web-rest/config/routes/annotations.yaml +0 -3
  67. package/lib/skeletons/web-symfony/myapp-web-rest/config/routes/dev/twig.yaml +0 -3
  68. package/lib/skeletons/web-symfony/myapp-web-rest/config/routes.yaml +0 -3
  69. package/lib/skeletons/web-symfony/myapp-web-rest/config/services.yaml +0 -27
  70. package/lib/skeletons/web-symfony/myapp-web-rest/public/index.php +0 -27
  71. package/lib/skeletons/web-symfony/myapp-web-rest/src/Controller/ProductController.php +0 -196
  72. package/lib/skeletons/web-symfony/myapp-web-rest/src/Entity/Product.php +0 -99
  73. package/lib/skeletons/web-symfony/myapp-web-rest/src/Kernel.php +0 -53
  74. package/lib/skeletons/web-symfony/myapp-web-rest/src/Migrations/Version20190604101623.php +0 -31
  75. package/lib/skeletons/web-symfony/myapp-web-rest/src/Migrations/Version20190604101638.php +0 -35
  76. package/lib/skeletons/web-symfony/myapp-web-rest/src/Repository/ProductRepository.php +0 -51
  77. package/lib/skeletons/web-symfony/myapp-web-rest/symfony.lock +0 -274
  78. package/lib/skeletons/web-symfony/myapp-web-rest/templates/base.html.twig +0 -12
  79. package/lib/skeletons/web-symfony/myapp-web-rest/templates/lucky/number.html.twig +0 -1
  80. package/lib/skeletons/web-symfony/myapp-web-rest/templates/product/index.html.twig +0 -20
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Pre-requisites
4
4
 
5
- **NodeJS 10.x**
5
+ **NodeJS 20.19.x**
6
6
 
7
7
  **Yarn**
8
8
 
package/bin/eui-cli.js CHANGED
@@ -1,47 +1,67 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const chalk = require('chalk');
4
- const tools = require('@eui/tools/scripts/utils/tools');
5
- const figlet = require('figlet');
6
- const path = require('path');
7
- const fs = require('fs');
8
- const generators = require('../lib/generators');
9
- const config = require('../lib/config');
3
+ const spawn = require('cross-spawn');
4
+ const args = process.argv.slice(2);
10
5
 
11
- // fetching cli arguments
12
- const args = tools.getArgs();
13
-
14
- // Print header and version
15
- console.info(
16
- '\n\n',
17
- chalk.yellow(figlet.textSync('eUI CLI', { horizontalLayout: 'full' })),
18
- chalk.green(`\n v${config.version}\n`)
6
+ const scriptIndex = args.findIndex(
7
+ (x) =>
8
+ x === '' ||
9
+ x === undefined ||
10
+ x === 'new' ||
11
+ x === 'build-app' ||
12
+ x === 'serve-app' ||
13
+ x === 'lint-app' ||
14
+ x === 'generate-sprite' ||
15
+ x === 'generate-app-metadata' ||
16
+ x === 'help' ||
17
+ x === 'inject-config-app'
19
18
  );
19
+ const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
20
+ const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];
20
21
 
21
- // remapping config if passed as argument - automated mode
22
- let inputConfig = config.parseInputConfig(args.config);
23
-
24
- // Detecting targetPath and create it if present as argument - local and automated mode
25
- let targetPath;
26
-
27
- if (args.targetPath) {
28
- targetPath = path.join(config.targetPath, args.targetPath);
29
-
30
- if (!tools.isDirExists(targetPath)) {
31
- tools.mkdir(targetPath);
32
- }
33
-
34
- // otherwise taking the default config targetPath defined
35
- } else {
36
- targetPath = config.targetPath;
37
- }
38
-
39
- if (args.v) {
40
- console.info('Current eUI CLI version installed : ' + config.version);
41
-
42
- } else {
43
- return generators.appGenerate({
44
- inputConfig: inputConfig,
45
- targetPath: targetPath
46
- });
22
+ switch (script) {
23
+ case '':
24
+ case undefined:
25
+ case 'new':
26
+ case 'build-app':
27
+ case 'serve-app':
28
+ case 'lint-app':
29
+ case 'generate-translations':
30
+ case 'generate-sprite':
31
+ case 'generate-app-metadata':
32
+ case 'help':
33
+ case 'inject-config-app': {
34
+ let genScript = script;
35
+ if (script === '' || script === undefined) {
36
+ genScript = 'new';
37
+ }
38
+ const result = spawn.sync(
39
+ 'node',
40
+ nodeArgs
41
+ .concat(require.resolve('./scripts/' + genScript))
42
+ .concat(args.slice(scriptIndex + 1)),
43
+ { stdio: 'inherit' }
44
+ );
45
+ if (result.signal) {
46
+ if (result.signal === 'SIGKILL') {
47
+ console.log(
48
+ 'The build failed because the process exited too early. '+
49
+ 'This probably means the system ran out of memory or someone called ' +
50
+ '`kill -9` on the process.'
51
+ );
52
+ } else if(result.signal === 'SIGTERM') {
53
+ console.log(
54
+ 'The build failed because the process exited too early. ' +
55
+ 'Someone might have called `kill` or `killall`, or the system could ' +
56
+ 'be shutting down.'
57
+ )
58
+ }
59
+ process.exit(1);
60
+ }
61
+ process.exit(result.status);
62
+ break;
63
+ }
64
+ default:
65
+ console.log('Unknown script "' + script + '".');
66
+ break;
47
67
  }
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const build = require('../../lib/app-utils/build');
4
+
5
+ Promise.resolve()
6
+ .then(() => {
7
+ return build.run();
8
+ })
9
+ .catch((e) => {
10
+ console.error(e);
11
+ process.exit(1);
12
+ });
@@ -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,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
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const serve = require('../../lib/app-utils/serve');
4
+
5
+ Promise.resolve()
6
+ .then(() => {
7
+ return serve.run();
8
+ })
9
+ .catch((e) => {
10
+ console.error(e);
11
+ process.exit(1);
12
+ });
@@ -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
+
@@ -0,0 +1,41 @@
1
+ // TODO v21 - for openid config injection extracted from eUI tools
2
+
3
+ // 'use strict';
4
+
5
+ // const path = require('path');
6
+
7
+ // const tools = require('../tools');
8
+
9
+ // const injectionUtils = require('./injection/injection-utils');
10
+ // const translationUtils = require('./translations/translation-utils');
11
+
12
+ // module.exports.preBuild = (project, envTarget, build, configEnvTarget) => {
13
+ // return Promise.resolve()
14
+ // .then(() => {
15
+ // tools.logTitle('PRE-BUILD : preparing the project...');
16
+ // })
17
+
18
+ // // openId files replacement and app config injection
19
+ // .then(() => {
20
+ // return injectionUtils.openid.injectConfig(project, configEnvTarget);
21
+ // })
22
+
23
+ // .catch((e) => {
24
+ // throw e;
25
+ // })
26
+ // };
27
+
28
+ // module.exports.processSvgAssets = (project) => {
29
+ // return Promise.resolve()
30
+ // .then(() => {
31
+ // const svgsInPath = path.join(project.paths.rootPath, 'src', 'assets', 'svg');
32
+ // const svgsSpritePath = path.join(svgsInPath, sprites);
33
+ // const svgsSpriteFile = 'sprite.svg';
34
+
35
+ // return svgUtils.generateSvgsSprite(svgsInPath, svgsSpritePath, svgsSpriteFile);
36
+ // })
37
+
38
+ // .catch((e) => {
39
+ // throw e;
40
+ // });
41
+ // };
@@ -0,0 +1,78 @@
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
+ module.exports.run = () => {
10
+
11
+ let { configuration, baseHref, servePath, host, proxyConfig, maxSpaceSize, port, disableHostCheck, open, debug, configEnvTarget, noLiveReload } = utils.getArgs();
12
+
13
+ const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
14
+
15
+ const prjName = 'app';
16
+
17
+ return Promise.resolve()
18
+ // .then(() => {
19
+ // return preBuildUtils.projects.preBuild(prj, configuration, false, configEnvTarget);
20
+ // })
21
+
22
+
23
+ // trigger ng serve with parameters provided
24
+ .then(() => {
25
+ utils.logTitle(`Serving application : ${prjName}...`);
26
+
27
+ let args;
28
+
29
+ if (maxSpaceSize) {
30
+ args = ['--max_old_space_size=8192', ng, 'serve', prjName];
31
+ } else {
32
+ args = [ng, 'serve', prjName];
33
+ }
34
+
35
+ if (configuration) {
36
+ args.push(`--configuration=${configuration}`);
37
+ }
38
+
39
+ if (proxyConfig) {
40
+ args.push(`--proxy-config=${proxyConfig}`);
41
+ }
42
+
43
+ if (baseHref) {
44
+ args.push(`--base-href=${baseHref}`);
45
+ }
46
+
47
+ if (servePath) {
48
+ args.push(`--serve-path=${servePath}`);
49
+ }
50
+
51
+ if (host) {
52
+ args.push(`--host=${host}`);
53
+ }
54
+
55
+ if (port) {
56
+ args.push(`--port=${port}`);
57
+ }
58
+
59
+ if (disableHostCheck) {
60
+ args.push(`--disable-host-check`);
61
+ }
62
+
63
+ if (!(open === 'false')) {
64
+ args.push('--open=true');
65
+ }
66
+
67
+ if (noLiveReload) {
68
+ args.push('--live-reload=false');
69
+ }
70
+
71
+ utils.logInfo(`ng serve with args ${args}`);
72
+
73
+ return execSync(`node ${args.join(' ')}`, { cwd: process.cwd(), stdio: 'inherit' });
74
+ })
75
+ .catch((e) => {
76
+ throw e;
77
+ });
78
+ }
package/lib/build.js CHANGED
@@ -1,10 +1,8 @@
1
- const tools = require('@eui/tools/scripts/utils/tools');
1
+ const childProcess = require('child_process');
2
+ const execSync = childProcess.execSync;
2
3
  const path = require('path');
3
4
  const utils = require('./utils');
4
5
  const config = require('./config');
5
- const childProcess = require('child_process');
6
- const execa = require('execa');
7
- const execSync = childProcess.execSync;
8
6
 
9
7
  module.exports.start = (options) => {
10
8
  return Promise.resolve()
@@ -27,11 +25,9 @@ const build = (cliConfig, targetPath) => {
27
25
  let target = targetPath;
28
26
  console.log(`--cleaning target : ${target}`);
29
27
 
30
- if (!tools.isDirEmpty(target)) {
31
- tools.logError(`Target directory : ${target} is not empty, execute eUI CLI in a blank directory... quitting`);
28
+ if (!utils.isDirEmpty(target)) {
29
+ utils.logError(`Target directory : ${target} is not empty, execute eUI CLI in a blank directory... quitting`);
32
30
  throw new Error('DIR_NOT_EMPTY');
33
- } else {
34
- return tools.rimraf(`${target}/**/*`);
35
31
  }
36
32
  })
37
33
 
@@ -56,7 +52,7 @@ const build = (cliConfig, targetPath) => {
56
52
  return Promise.resolve()
57
53
  .then(() => {
58
54
  console.log('--building web-maven');
59
- return tools.copydir(config.webMavenPath, targetPath);
55
+ return utils.copydir(config.webMavenPath, targetPath);
60
56
  })
61
57
  .then(() => {
62
58
  const angularPath = utils.getAngularPath(targetPath, appName, appType);
@@ -85,32 +81,6 @@ const build = (cliConfig, targetPath) => {
85
81
  throw e;
86
82
  })
87
83
  }
88
-
89
-
90
- // BUILD symfony
91
- if (appType === 'web-symfony') {
92
-
93
- return Promise.resolve()
94
- .then(() => {
95
- console.log('--cloning eui php starter repository')
96
- execa.shellSync(`git clone https://${config.webPhpStarterRepo} ${targetPath}`);
97
- })
98
- .then(() => {
99
- console.log('--building web-symfony');
100
- const angularPath = utils.getAngularPath(targetPath, appName, appType, artifactId);
101
- return copyAngular(angularPath, cliConfig, false);
102
- })
103
- .then(() => {
104
- execa.shellSync(`npm run init`, { cwd: path.join(targetPath, 'server'), stdio: "inherit" });
105
- })
106
- .catch((e) => {
107
- throw e;
108
- })
109
- .finally(() => {
110
- return tools.rimraf(`${targetPath}/.git`);
111
- })
112
- }
113
-
114
84
  })
115
85
  .catch((e) => {
116
86
  console.log(e);
@@ -127,11 +97,11 @@ const copyAngular = (targetPath, cliConfig, overwrite = true) => {
127
97
  const {angularBasePath} = config;
128
98
  const sourcePath = angularBasePath;
129
99
 
130
- return tools.copydir(sourcePath, targetPath, overwrite);
100
+ return utils.copydir(sourcePath, targetPath, overwrite);
131
101
  })
132
102
  .then(() => {
133
103
  if (cliConfig.appType === 'mobile') {
134
- return tools.copydir(config.angularBaseMobilePath, targetPath, overwrite);
104
+ return utils.copydir(config.angularBaseMobilePath, targetPath, overwrite);
135
105
  }
136
106
  })
137
107
  .then(() => {
@@ -139,16 +109,21 @@ const copyAngular = (targetPath, cliConfig, overwrite = true) => {
139
109
  cliConfig.appOptions.forEach((item) => {
140
110
  if (item !== 'ecl') {
141
111
  console.log('Applying option : ' + item);
142
- tools.copydir(config.optionsPath[item], targetPath, true);
112
+ utils.copydir(config.optionsPath[item], targetPath, true);
143
113
  }
144
114
  })
145
115
  if (cliConfig.appOptions.includes('ecl') && cliConfig.appOptionsEclTheme) {
146
116
  console.log(`eUI ECL theme selected : ` + cliConfig.appOptionsEclTheme);
147
- tools.copydir(config.optionsPath[cliConfig.appOptionsEclTheme], targetPath, true);
117
+ utils.copydir(config.optionsPath[cliConfig.appOptionsEclTheme], targetPath, true);
148
118
  }
149
119
  }
150
120
  return Promise.resolve();
151
121
  })
122
+ .then(() => {
123
+ if (cliConfig.packageManager === 'pnpm') {
124
+ utils.copy(path.join(config.pnpmOptionPath, 'package.json'), path.join(targetPath, 'package.json'));
125
+ }
126
+ })
152
127
  .catch((e) => {
153
128
  throw e;
154
129
  })
package/lib/cli.js CHANGED
@@ -9,7 +9,7 @@ const defaultConfig = {
9
9
  appFeatures: [],
10
10
  groupId: 'ec.europa.digit',
11
11
  artifactId: 'myapp',
12
- useYarn: true,
12
+ packageManager: 'yarn',
13
13
  npmInstall: true,
14
14
  appStart: true,
15
15
  };
@@ -35,7 +35,6 @@ module.exports.start = (options) => {
35
35
  { name: 'eUI Angular - Mobile Ionic', value: 'mobile' },
36
36
  { name: 'eUI Angular + Spring Boot web module - JDK + Maven required !!!', value: 'web-spring-boot' },
37
37
  { name: 'eUI Angular + Maven web module (JEE Spring maven web module) - JDK + Maven required !!!', value: 'web-maven' },
38
- { name: 'eUI Angular + PHP/Symfony starter - PHP7 and composer required !!!', value: 'web-symfony' },
39
38
  ],
40
39
  default: 0,
41
40
  validate: function (value) {
@@ -102,9 +101,28 @@ module.exports.start = (options) => {
102
101
  {
103
102
  name: 'npmInstall',
104
103
  type: 'confirm',
105
- message: 'Yarn install dependencies when the app is generated :',
104
+ message: 'Install dependencies when the app is generated :',
106
105
  default: defaultConfig.npmInstall
107
- }
106
+ },
107
+
108
+ {
109
+ type: 'list',
110
+ name: 'packageManager',
111
+ message: 'Package manager for installation :',
112
+ choices: [
113
+ { name: 'Yarn 1.x (default)', value: 'yarn' },
114
+ { name: 'Pnpm - experimental', value: 'pnpm' },
115
+ ],
116
+ default: 0,
117
+ when: function (answers) {
118
+ return (answers.npmInstall);
119
+ },
120
+ validate: function (value) {
121
+ if (value.length) {
122
+ return true;
123
+ }
124
+ }
125
+ },
108
126
  ])
109
127
  .then((answers) => {
110
128
  let outputConfig;
@@ -118,6 +136,5 @@ module.exports.start = (options) => {
118
136
  .catch((e) => {
119
137
  throw e;
120
138
  })
121
-
122
139
  }
123
140
 
package/lib/config.js CHANGED
@@ -19,6 +19,7 @@ module.exports.optionsPath = {
19
19
  "ecl-ec": path.join(skeletonsPath, '_angular/options/ecl-ec'),
20
20
  "ecl-eu": path.join(skeletonsPath, '_angular/options/ecl-eu'),
21
21
  };
22
+ module.exports.pnpmOptionPath = path.join(skeletonsPath, '_angular/options/pnpm');
22
23
 
23
24
  module.exports.version = version;
24
25