@eui/cli 21.0.0-alpha.22 → 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/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,63 @@
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');
10
-
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`)
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
19
  );
20
-
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
- });
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;
47
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
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const utils = require('../../lib/utils');
4
+
5
+ Promise.resolve()
6
+ .then(() => {
7
+ return utils.serve();
8
+ })
9
+ .catch((e) => {
10
+ console.error(e);
11
+ process.exit(1);
12
+ });
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,11 @@ 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
31
  } else {
34
- return tools.rimraf(`${target}/**/*`);
32
+ return utils.rimraf(`${target}/**/*`);
35
33
  }
36
34
  })
37
35
 
@@ -56,7 +54,7 @@ const build = (cliConfig, targetPath) => {
56
54
  return Promise.resolve()
57
55
  .then(() => {
58
56
  console.log('--building web-maven');
59
- return tools.copydir(config.webMavenPath, targetPath);
57
+ return utils.copydir(config.webMavenPath, targetPath);
60
58
  })
61
59
  .then(() => {
62
60
  const angularPath = utils.getAngularPath(targetPath, appName, appType);
@@ -93,7 +91,7 @@ const build = (cliConfig, targetPath) => {
93
91
  return Promise.resolve()
94
92
  .then(() => {
95
93
  console.log('--cloning eui php starter repository')
96
- execa.shellSync(`git clone https://${config.webPhpStarterRepo} ${targetPath}`);
94
+ execSync(`git clone https://${config.webPhpStarterRepo} ${targetPath}`);
97
95
  })
98
96
  .then(() => {
99
97
  console.log('--building web-symfony');
@@ -101,13 +99,13 @@ const build = (cliConfig, targetPath) => {
101
99
  return copyAngular(angularPath, cliConfig, false);
102
100
  })
103
101
  .then(() => {
104
- execa.shellSync(`npm run init`, { cwd: path.join(targetPath, 'server'), stdio: "inherit" });
102
+ execSync(`npm run init`, { cwd: path.join(targetPath, 'server'), stdio: "inherit" });
105
103
  })
106
104
  .catch((e) => {
107
105
  throw e;
108
106
  })
109
107
  .finally(() => {
110
- return tools.rimraf(`${targetPath}/.git`);
108
+ return utils.rimraf(`${targetPath}/.git`);
111
109
  })
112
110
  }
113
111
 
@@ -127,11 +125,11 @@ const copyAngular = (targetPath, cliConfig, overwrite = true) => {
127
125
  const {angularBasePath} = config;
128
126
  const sourcePath = angularBasePath;
129
127
 
130
- return tools.copydir(sourcePath, targetPath, overwrite);
128
+ return utils.copydir(sourcePath, targetPath, overwrite);
131
129
  })
132
130
  .then(() => {
133
131
  if (cliConfig.appType === 'mobile') {
134
- return tools.copydir(config.angularBaseMobilePath, targetPath, overwrite);
132
+ return utils.copydir(config.angularBaseMobilePath, targetPath, overwrite);
135
133
  }
136
134
  })
137
135
  .then(() => {
@@ -139,12 +137,12 @@ const copyAngular = (targetPath, cliConfig, overwrite = true) => {
139
137
  cliConfig.appOptions.forEach((item) => {
140
138
  if (item !== 'ecl') {
141
139
  console.log('Applying option : ' + item);
142
- tools.copydir(config.optionsPath[item], targetPath, true);
140
+ utils.copydir(config.optionsPath[item], targetPath, true);
143
141
  }
144
142
  })
145
143
  if (cliConfig.appOptions.includes('ecl') && cliConfig.appOptionsEclTheme) {
146
144
  console.log(`eUI ECL theme selected : ` + cliConfig.appOptionsEclTheme);
147
- tools.copydir(config.optionsPath[cliConfig.appOptionsEclTheme], targetPath, true);
145
+ utils.copydir(config.optionsPath[cliConfig.appOptionsEclTheme], targetPath, true);
148
146
  }
149
147
  }
150
148
  return Promise.resolve();
package/lib/generators.js CHANGED
@@ -1,4 +1,3 @@
1
- const chalk = require('chalk');
2
1
  const childProcess = require('child_process');
3
2
  const execSync = childProcess.execSync;
4
3
  const cli = require('./cli');
@@ -10,9 +9,9 @@ const utils = require('./utils');
10
9
 
11
10
  const appGenerate = (options) => {
12
11
  if (options.inputConfig) {
13
- console.info(chalk.cyan('Creating your project - automated mode : \n'));
12
+ utils.logInfo('Creating your project - automated mode : \n');
14
13
  } else {
15
- console.info(chalk.cyan('Configuring your project : please answer the following : \n'));
14
+ utils.logInfo('Configuring your project : please answer the following : \n');
16
15
  }
17
16
 
18
17
  // Query the questions
@@ -52,11 +51,9 @@ const appGenerate = (options) => {
52
51
  if (!cliConfig.appStart || typeof cliConfig.npmInstall !== 'boolean' || !cliConfig.npmInstall) {
53
52
  return;
54
53
  }
55
- console.log('');
56
- console.log('');
57
- console.log('*****************************************************************');
58
- console.log(chalk.cyan(' Starting eUI app... browser will open soon on localhost:4200'));
59
- console.log('*****************************************************************');
54
+ utils.logInfo('*****************************************************************');
55
+ utils.logInfo(' Starting eUI app... browser will open soon on localhost:4200');
56
+ utils.logInfo('*****************************************************************');
60
57
 
61
58
  const wd = path.resolve(utils.getAngularPath(options.targetPath, cliConfig.appName, cliConfig.appType, cliConfig.artifactId));
62
59
  return execSync("npm start", { cwd: wd, stdio: "inherit" });
package/lib/install.js CHANGED
@@ -1,9 +1,7 @@
1
1
  const childProcess = require('child_process');
2
2
  const execSync = childProcess.execSync;
3
3
  const path = require('path');
4
- const tools = require('@eui/tools/scripts/utils/tools');
5
4
  const utils = require('./utils');
6
- const chalk = require('chalk');
7
5
 
8
6
  module.exports.start = (options) => {
9
7
 
@@ -27,13 +25,10 @@ const install = (cliConfig, targetPath) => {
27
25
  console.log('');
28
26
  console.log('');
29
27
  console.log('*****************************************************');
30
- console.log(chalk.cyan(' Installing app dependencies... PLEASE WAIT....'));
28
+ console.log(' Installing app dependencies... PLEASE WAIT....');
31
29
  console.log('*****************************************************');
32
30
 
33
31
  return Promise.resolve()
34
- .then(() => {
35
- return tools.remove(path.join(wd, 'yarn.lock'));
36
- })
37
32
  .then(() => {
38
33
  return execSync("yarn", { cwd: wd, stdio: "inherit" });
39
34
  })
package/lib/post-build.js CHANGED
@@ -1,6 +1,4 @@
1
1
  const path = require('path');
2
- const tools = require('@eui/tools/scripts/utils/tools');
3
-
4
2
  const utils = require('./utils');
5
3
 
6
4
  module.exports.start = (options) => {
@@ -24,7 +22,7 @@ const postBuild = (cliConfig, targetPath) => {
24
22
  .then(() => {
25
23
  console.log('--renaming .gitignore');
26
24
  const angularPath = utils.getAngularPath(targetPath, appName, appType, artifactId);
27
- return tools.move(path.join(angularPath, 'gitignore_TO_REPLACE'), path.join(angularPath, '.gitignore'));
25
+ return utils.move(path.join(angularPath, 'gitignore_TO_REPLACE'), path.join(angularPath, '.gitignore'));
28
26
  })
29
27
 
30
28
  .catch((e) => {
@@ -1,38 +1,35 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "21.0.0-alpha.22",
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-scripts serve-app --configuration=proxy-mock",
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-scripts serve-app --configuration=proxy",
11
- "start-local": "eui-scripts serve-app",
12
- "build": "eui-scripts build-app",
13
- "build-dev": "eui-scripts build-app --configuration=development --configEnvTarget=dev",
14
- "build-prod": "eui-scripts build-app --configuration=production-optimized --configEnvTarget=prod",
15
- "build-prod-skip-test": "eui-scripts build-app --configuration=production-optimized --configEnvTarget=prod --skipTest",
16
- "build-prod-stats": "eui-scripts build-app --configuration=production-optimized --configEnvTarget=prod --statsJson",
17
- "app:build": "eui-scripts build-app",
18
- "app:inject-config": "eui-scripts inject-config-app",
19
- "generate-changelog": "eui-scripts generate-changelog",
20
- "generate-sprite": "eui-scripts generate-sprite"
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.22"
24
+ "@eui/deps-base": "21.0.0-alpha.24"
25
25
  },
26
- "resolutions": {
27
- "js-yaml": ">=3.13.1",
28
- "pdfjs-dist": "4.10.38",
29
- "tar": ">=6.2.1",
30
- "katex": ">=0.16.10",
31
- "follow-redirects": ">=1.15.4",
32
- "word-wrap": ">=1.2.4",
33
- "postcss": ">=8.4.31",
34
- "semver": ">=7.5.2",
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,7 +1,47 @@
1
- const karmaConfig = require('@eui/tools/karma/karma.conf');
1
+ function get(config) {
2
+
3
+ return {
4
+ basePath: '',
5
+ frameworks: ['jasmine', '@angular-devkit/build-angular'],
6
+ plugins: [
7
+ require('karma-jasmine'),
8
+ require('karma-chrome-launcher'),
9
+ require('karma-jasmine-html-reporter'),
10
+ require('karma-coverage-istanbul-reporter'),
11
+ require('karma-coverage'),
12
+ require('karma-sourcemap-loader'),
13
+ require('@angular-devkit/build-angular/plugins/karma')
14
+ ],
15
+ client:{
16
+ clearContext: false // leave Jasmine Spec Runner output visible in browser
17
+ },
18
+ coverageIstanbulReporter: {
19
+ reports: [ 'html', 'lcovonly' ],
20
+ fixWebpackSourcePaths: true
21
+ },
22
+ angularCli: {
23
+ environment: 'dev'
24
+ },
25
+ reporters: ['progress', 'kjhtml'],
26
+ port: 9876,
27
+ colors: true,
28
+ logLevel: config.LOG_INFO,
29
+ autoWatch: true,
30
+ browsers: ['ChromeHeadlessCustom'],
31
+ customLaunchers: {
32
+ ChromeHeadlessCustom: {
33
+ base: 'ChromeHeadless',
34
+ flags: [
35
+ '--no-sandbox',
36
+ ],
37
+ },
38
+ },
39
+ singleRun: false
40
+ }
41
+ }
2
42
 
3
43
  module.exports = function (config) {
4
44
  config.set(
5
- karmaConfig.get(config)
45
+ get(config)
6
46
  );
7
47
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "21.0.0-alpha.22",
3
+ "version": "21.0.0-alpha.24",
4
4
  "license": "EUPL-1.1",
5
5
  "scripts": {
6
6
  "ng": "ng",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "21.0.0-alpha.22",
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.22"
21
+ "@eui/deps-base": "21.0.0-alpha.24"
22
22
  }
23
23
  }
package/lib/utils.js CHANGED
@@ -1,3 +1,11 @@
1
+ const childProcess = require('child_process');
2
+ const execSync = childProcess.execSync;
3
+ const fs = require('fs');
4
+ const fse = require('fs-extra');
5
+ const glob = require('glob');
6
+ const path = require('path');
7
+ const figlet = require('figlet');
8
+
1
9
  module.exports.getAngularPath = (targetPath, appName, appType, artifactId) => {
2
10
  switch(appType) {
3
11
  case 'angular':
@@ -11,3 +19,209 @@ module.exports.getAngularPath = (targetPath, appName, appType, artifactId) => {
11
19
  return `${targetPath}/client`;
12
20
  }
13
21
  }
22
+
23
+ module.exports.getArgs = () => {
24
+ const argv = require('yargs').argv;
25
+
26
+ const processArgs = process.env._CSDR_ARGS;
27
+
28
+ let args = {};
29
+
30
+ if (processArgs) {
31
+ processArgs.split(',').forEach((item) => {
32
+ // check if it's defined as array - example format : someArray:test1=test1|test2=test2
33
+ if (item.indexOf('Array') > 0) {
34
+ const arrayItems = item.split(':')[1];
35
+ const subItems = arrayItems.split('|');
36
+ const array = [];
37
+ subItems.forEach((sub) => {
38
+ const subItemSplit = sub.split('=');
39
+ const newItem = {};
40
+ newItem[subItemSplit[0].trim()] = subItemSplit[1].trim();
41
+ array.push(newItem);
42
+ })
43
+ args[item.split(':')[0]] = array;
44
+
45
+ // otherwise normal key/value pairs - example format : test1:test1,test2:test2
46
+ } else {
47
+ const itemSplit = item.split(':');
48
+ args[itemSplit[0].trim()] = itemSplit[1].trim();
49
+ }
50
+ })
51
+ }
52
+
53
+ return {
54
+ root: argv._[0],
55
+ ...argv,
56
+ ...args
57
+ }
58
+ }
59
+
60
+
61
+ module.exports.logBigTitle = (text) => {
62
+ console.log('\n\n');
63
+ console.log('\x1b[33m', figlet.textSync(text, { horizontalLayout: 'full' }) ,'\x1b[0m');
64
+ console.log('\n');
65
+ }
66
+
67
+ module.exports.logTitle = (msg) => {
68
+ log(msg, 0);
69
+ }
70
+
71
+ const logInfo = module.exports.logInfo = (msg) => {
72
+ log(msg, 1);
73
+ }
74
+
75
+ module.exports.logSuccess = (msg) => {
76
+ if (!msg) msg = 'OK';
77
+ log(msg, 2);
78
+ }
79
+
80
+ module.exports.logError = (msg) => {
81
+ log(msg, 3);
82
+ }
83
+ module.exports.logErrorTrace = (filename, method, e) => {
84
+ log(`ERROR in ${filename}`, 3);
85
+ log(`...method : ${method}`, 3);
86
+ log(`...message : ${e.message}`, 3);
87
+ }
88
+
89
+ module.exports.logWarning = (msg) => {
90
+ log(msg, 4);
91
+ }
92
+
93
+ module.exports.logAccent = (msg) => {
94
+ log(msg, 5);
95
+ }
96
+
97
+ module.exports.logBanner = (msg) => {
98
+ log(msg, 6);
99
+ }
100
+
101
+ module.exports.logDebug = (msg) => {
102
+ if (getArgs().debug) {
103
+ log(msg, 7);
104
+ }
105
+ }
106
+ module.exports.logDebugTrace = (filename, method, e) => {
107
+ if (getArgs().debug) {
108
+ log(`ERROR in ${filename}`, 7);
109
+ log(`...method : ${method}`, 7);
110
+ log(`...message : ${e.message}`, 7);
111
+ }
112
+ }
113
+ module.exports.logDebugResponse = (response) => {
114
+ if (getArgs().debug) {
115
+ console.log(response);
116
+ }
117
+ }
118
+
119
+ module.exports.isDirEmpty = (path) => {
120
+ try {
121
+ var files = fse.readdirSync(path);
122
+
123
+ if (files.length === 0) {
124
+ return true;
125
+ } else {
126
+ return false;
127
+ }
128
+
129
+ } catch (err) {
130
+ return false;
131
+ }
132
+ }
133
+
134
+ const isFileExists = module.exports.isFileExists = (path) => {
135
+ try {
136
+ return fs.statSync(path);
137
+ } catch (err) {
138
+ return false;
139
+ }
140
+ }
141
+
142
+
143
+ module.exports.mkdir = (path) => {
144
+ if (!fs.existsSync(path)) {
145
+ fs.mkdirSync(path);
146
+ }
147
+ }
148
+
149
+ module.exports.copydir = (from, to, overwrite = true, globPattern = '**/*') => {
150
+ function _recursiveMkDir(dir) {
151
+ if (!fs.existsSync(dir)) {
152
+ _recursiveMkDir(path.dirname(dir));
153
+ fs.mkdirSync(dir);
154
+ }
155
+ }
156
+
157
+ logInfo('----->copydir from : ' + from + ' ====> to : ' + to );
158
+ var files = glob.sync(globPattern, { cwd: from, nodir: true, follow: true, dot: true });
159
+ files.forEach(file => {
160
+ const origin = path.join(from, file);
161
+ const dest = path.join(to, file);
162
+ _recursiveMkDir(path.dirname(dest));
163
+ fse.copySync(origin, dest, { overwrite: overwrite });
164
+ });
165
+ }
166
+
167
+ module.exports.move = (from, to) => {
168
+ fse.removeSync(to);
169
+ fse.moveSync(from, to, );
170
+ }
171
+
172
+ module.exports.rimraf = (inputPath) => {
173
+ this.logInfo(`Removing ${inputPath}...`);
174
+ let exec = path.resolve(process.cwd(), 'node_modules', 'rimraf', 'bin.js');
175
+ if (!isFileExists(exec)) {
176
+ // special location when used within eUI CLI
177
+ exec = path.resolve(__dirname, '../../../..', 'rimraf', 'bin.js');
178
+ }
179
+ try {
180
+ execSync(`node ${exec} ${inputPath}`, { cwd: process.cwd(), stdio: 'inherit' });
181
+ } catch(e) {
182
+ console.log(e);
183
+ }
184
+ }
185
+
186
+ module.exports.remove = (path) => {
187
+ fse.removeSync(path);
188
+ }
189
+
190
+ const log = (msg, type) => {
191
+ var msgContent;
192
+
193
+ if (type === 0 || !type) {
194
+ msgContent = `\n${msg.toUpperCase()}`;
195
+ console.info('\x1b[33m', msgContent ,'\x1b[0m');
196
+ }
197
+ if (type === 1) {
198
+ msgContent = `${msg}`;
199
+ console.info('\x1b[34m\x1b[1m', msgContent ,'\x1b[0m');
200
+ }
201
+ if (type === 2) {
202
+ msgContent = `${msg}\n`;
203
+ console.info('\x1b[32m\x1b[1m', msgContent ,'\x1b[0m');
204
+ }
205
+ if (type === 3) {
206
+ msgContent = `\n${msg}`;
207
+ console.info('\x1b[31m\x1b[1m', msgContent ,'\x1b[0m');
208
+ }
209
+ if (type === 4) {
210
+ msgContent = `\n${msg}\n`;
211
+ console.info('\x1b[33m', msgContent ,'\x1b[0m');
212
+ }
213
+ if (type === 5) {
214
+ msgContent = `${msg}\n`;
215
+ console.info(msgContent);
216
+ }
217
+ if (type === 6) {
218
+ msgContent = msg
219
+ console.info('\n\n');
220
+ console.info(msgContent);
221
+ console.info('\n');
222
+ }
223
+ if (type === 7) {
224
+ msgContent = `${msg}`;
225
+ console.info(msgContent);
226
+ }
227
+ }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@eui/cli",
3
- "version": "21.0.0-alpha.22",
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
  },
@@ -13,21 +13,19 @@
13
13
  "url": "https://sdlc.webcloud.ec.europa.eu/csdr/eui/eui.git"
14
14
  },
15
15
  "dependencies": {
16
- "@eui/tools": "6.21.124"
17
- },
18
- "peerDependencies": {
19
- "@eui/tools": "^6.0.0",
20
- "chalk": "^4.1.0",
21
- "figlet": "^1.7.0",
22
- "replace-in-file": "^7.1.0",
23
- "execa": "^5.1.1",
24
- "inquirer": "^8.1.0"
16
+ "figlet": "1.9.3",
17
+ "inquirer": "6.5.0",
18
+ "yargs": "17.7.2",
19
+ "fs-extra": "9.0.0",
20
+ "rimraf": "3.0.2",
21
+ "glob": "7.2.3",
22
+ "cross-spawn": "7.0.6"
25
23
  },
26
24
  "preferGlobal": true,
27
25
  "homepage": "https://eui.ecdevops.eu",
28
26
  "author": "ec.europa.eui@gmail.com",
29
27
  "engines": {
30
- "node": "^18.19.1 || ^20.11.1 || >=22.0.0",
28
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
31
29
  "yarn": ">=1.22.4 <2"
32
30
  }
33
31
  }