@enfyra/create 0.1.0 → 0.1.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 (2) hide show
  1. package/index.js +18 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -14,13 +14,24 @@ const { createProject } = require('./components/project-setup');
14
14
  const { detectPackageManagers, getWorkspaceRunCommand, getPackageRunCommand } = require('./components/package-managers');
15
15
 
16
16
  const SERVER_PORT = 1105;
17
+ const BANNER_WIDTH = 42;
18
+
19
+ function renderBanner() {
20
+ const border = chalk.cyan.bold(`+${'-'.repeat(BANNER_WIDTH)}+`);
21
+ return [
22
+ '',
23
+ border,
24
+ renderBannerLine('Create Enfyra', chalk.white.bold),
25
+ renderBannerLine('App + Server in one workspace', chalk.gray),
26
+ border,
27
+ '',
28
+ ].join('\n');
29
+ }
17
30
 
18
- const banner = `
19
- ${chalk.cyan.bold('╔═══════════════════════════════════════╗')}
20
- ${chalk.cyan.bold('')} ${chalk.white.bold('Create Enfyra')} ${chalk.cyan.bold('')}
21
- ${chalk.cyan.bold('║')} ${chalk.gray('App + Server in one workspace')} ${chalk.cyan.bold('║')}
22
- ${chalk.cyan.bold('╚═══════════════════════════════════════╝')}
23
- `;
31
+ function renderBannerLine(text, format = (value) => value) {
32
+ const padding = Math.max(0, BANNER_WIDTH - text.length - 2);
33
+ return `${chalk.cyan.bold('|')} ${format(text)}${' '.repeat(padding)} ${chalk.cyan.bold('|')}`;
34
+ }
24
35
 
25
36
  async function main() {
26
37
  const program = new Command();
@@ -33,7 +44,7 @@ async function main() {
33
44
  .option('--skip-connection-check', 'Skip database and Redis connection checks')
34
45
  .parse();
35
46
 
36
- console.log(banner);
47
+ console.log(renderBanner());
37
48
  checkNodeVersion();
38
49
  const packageManagers = detectPackageManagers();
39
50
  if (packageManagers.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enfyra/create",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Create a complete Enfyra app with frontend and server workspaces",
5
5
  "main": "index.js",
6
6
  "bin": {