opticore-installer 1.2.60 → 1.2.62

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
@@ -8,5 +8,12 @@ This is the official installer to start new projects based on the OptiCoreJs ful
8
8
  **This installer is OptiCoreJS's runner** and newer versions. Create your OptiCoreJS project as follows:
9
9
 
10
10
  ```bash
11
- npm exec create-new-project
11
+ npm i opticore-installer
12
+ opticore-new <projectName>
13
+ ```
14
+
15
+ Or without installing it first:
16
+
17
+ ```bash
18
+ npx --package=opticore-installer opticore-new <projectName>
12
19
  ```
package/dist/index.cjs CHANGED
@@ -35,19 +35,19 @@ var UWelcomeMessage = () => {
35
35
  import_cfonts.default.say("OpticoreJS", {
36
36
  font: "block",
37
37
  align: "left",
38
- colors: ["yellow", "#FF6B35"],
38
+ colors: ["#D4E4FF", "#427ff5"],
39
39
  background: "transparent",
40
40
  letterSpacing: 1,
41
41
  lineHeight: 1,
42
42
  space: true,
43
43
  maxLength: "0"
44
44
  });
45
- const orange = import_chalk.default.bold.hex("#FF6B35");
46
- const dim = import_chalk.default.bold.yellow;
47
- console.log(` ${orange("OPTICORE F R A M E W O R K I N S T A L L E R")}`);
48
- console.log(` ${dim("Create \xB7 Configure \xB7 Deploy")}
45
+ const name = import_chalk.default.bold.hex("#003A9F");
46
+ const dim = import_chalk.default.bold.hex("#D4E4FF");
47
+ console.log(`${name("OPTICORE I N S T A L L E R")}`);
48
+ console.log(`${dim("Create \xB7 Configure \xB7 Deploy")}
49
49
  `);
50
- console.log(` ${import_chalk.default.bold.dim("Documentation")} ${import_chalk.default.underline.cyan("https://github.com/guyzoum77/opticore-installer")}
50
+ console.log(`${import_chalk.default.bold.dim("Documentation")} ${import_chalk.default.underline.cyan("https://github.com/guyzoum77/opticore-installer")}
51
51
  `);
52
52
  };
53
53
 
@@ -86,7 +86,7 @@ var CGeneralMsg = {
86
86
  noDbCredentials: "You will have to manually set all the variable values in the .env file.",
87
87
  starterMsg: "Which starter project would you like to use ?",
88
88
  starterInitValue: "restfull_api_project",
89
- starterOptionsRestFullLabel: "RestFull API project",
89
+ starterOptionsRestFullLabel: "Standard projet",
90
90
  starterOptionsRestFullValue: "restfull_api_project",
91
91
  starterOptionsRestFullHint: "OptiCoreJS app tailored to create a RestFull APIs",
92
92
  projectNameMessage: "Enter the name of project :",
@@ -464,11 +464,7 @@ function endingMessageInfo(projectName) {
464
464
  `);
465
465
  console.log(` ${import_chalk4.default.dim("NB: Before running app, make sure to define in .env file application host and port.")}
466
466
  `);
467
- console.log(` ${import_chalk4.default.bold("Recommended packages:")}`);
468
- console.log(` ${import_chalk4.default.dim("\u276F")} ${import_chalk4.default.cyan("npm install opticore-validator")} ${import_chalk4.default.dim("\u2014 data schema validation with rich rules and custom messages.")}`);
469
- console.log(` ${import_chalk4.default.dim("\u276F")} ${import_chalk4.default.cyan("npm install opticore-orm-orchestrator")} ${import_chalk4.default.dim("\u2014 interactive model/entity generator for Prisma, TypeORM, Drizzle ORM, MikroORM and Sequelize.")}
470
- `);
471
- (0, import_prompts9.outro)(import_chalk4.default.dim("To install opticore components: ") + import_chalk4.default.green("npx opticore list"));
467
+ (0, import_prompts9.outro)(import_chalk4.default.dim("Useful to see all commands : ") + import_chalk4.default.green("opticore list"));
472
468
  }
473
469
 
474
470
  // src/presentations/starter/projectCreation.starter.ts
@@ -517,16 +513,29 @@ var SProjectCreation = async (gitRepo, projectPath, currentPath, projectName) =>
517
513
  pkg.dependencies["opticore-feature-component"] = pkg.dependencies["opticore-feature-module"];
518
514
  delete pkg.dependencies["opticore-feature-module"];
519
515
  }
520
- if (pkg.dependencies) pkg.dependencies = await UpdateOpticoreDeps(exec, pkg.dependencies);
521
- if (pkg.devDependencies) pkg.devDependencies = await UpdateOpticoreDeps(exec, pkg.devDependencies);
516
+ if (pkg.dependencies) {
517
+ pkg.dependencies = await UpdateOpticoreDeps(exec, pkg.dependencies);
518
+ }
519
+ if (pkg.devDependencies) {
520
+ pkg.devDependencies = await UpdateOpticoreDeps(exec, pkg.devDependencies);
521
+ }
522
522
  import_fs3.default.writeFileSync(pkgPath, JSON.stringify(pkg, null, 4));
523
523
  const lockPath = import_path2.default.join(escapedPath, "package-lock.json");
524
- if (import_fs3.default.existsSync(lockPath)) import_fs3.default.unlinkSync(lockPath);
524
+ if (import_fs3.default.existsSync(lockPath)) {
525
+ import_fs3.default.unlinkSync(lockPath);
526
+ }
525
527
  await exec("npm uninstall ora ansi-colors cli-spinner dotenv gradient-string util tsup path fs node ts-node tslib @types/cli-spinner @clack/prompts");
526
528
  cleanSpinner.succeed();
527
529
  const npmSpinner = ora("Installing dependencies").start();
528
530
  await exec("npm install");
529
531
  npmSpinner.succeed();
532
+ const cliSpinner = ora("Installing opticore CLI globally").start();
533
+ try {
534
+ await exec("npm install -g opticore-cli@latest");
535
+ cliSpinner.succeed();
536
+ } catch {
537
+ cliSpinner.fail("Could not install opticore-cli globally, run 'npm install -g opticore-cli@latest' manually");
538
+ }
530
539
  import_fs3.default.writeFileSync(import_path2.default.join(escapedPath, ".npmrc"), "loglevel=silent\n");
531
540
  endingMessageInfo(projectName);
532
541
  } catch (err) {
@@ -749,7 +758,8 @@ var PPostgres = (arg) => {
749
758
  host: arg.host ?? import_dotenv3.default.config()?.parsed?.DATA_BASE_HOST,
750
759
  user: arg.user ?? import_dotenv3.default.config()?.parsed?.DATA_BASE_USER,
751
760
  password: arg.password ?? import_dotenv3.default.config()?.parsed?.DATA_BASE_PASSWORD,
752
- port: arg.port ?? import_dotenv3.default.config()?.parsed?.DATA_BASE_PORT
761
+ port: arg.port ?? import_dotenv3.default.config()?.parsed?.DATA_BASE_PORT,
762
+ database: arg.database ?? import_dotenv3.default.config()?.parsed?.DATA_BASE_NAME
753
763
  };
754
764
  };
755
765
 
@@ -966,7 +976,7 @@ var SShellEscape = (str) => {
966
976
  var installerCore = async (initialProjectName2) => {
967
977
  let projectName;
968
978
  UWelcomeMessage();
969
- (0, import_prompts12.intro)(import_chalk6.default.bgYellow.black(" Opticore Framework Installer "));
979
+ (0, import_prompts12.intro)(import_chalk6.default.bgHex("#427ff5").white(" Opticore Framework Installer "));
970
980
  const starter = await SOutputPromptSelect(StarterOptions);
971
981
  starter instanceof Function ? (() => {
972
982
  (0, import_prompts12.cancel)(import_ansi_colors9.default.bgRed(import_ansi_colors9.default.white(" Operation cancelled ")));
package/dist/index.js CHANGED
@@ -12,19 +12,19 @@ var UWelcomeMessage = () => {
12
12
  cfonts.say("OpticoreJS", {
13
13
  font: "block",
14
14
  align: "left",
15
- colors: ["yellow", "#FF6B35"],
15
+ colors: ["#D4E4FF", "#427ff5"],
16
16
  background: "transparent",
17
17
  letterSpacing: 1,
18
18
  lineHeight: 1,
19
19
  space: true,
20
20
  maxLength: "0"
21
21
  });
22
- const orange = chalk.bold.hex("#FF6B35");
23
- const dim = chalk.bold.yellow;
24
- console.log(` ${orange("OPTICORE F R A M E W O R K I N S T A L L E R")}`);
25
- console.log(` ${dim("Create \xB7 Configure \xB7 Deploy")}
22
+ const name = chalk.bold.hex("#003A9F");
23
+ const dim = chalk.bold.hex("#D4E4FF");
24
+ console.log(`${name("OPTICORE I N S T A L L E R")}`);
25
+ console.log(`${dim("Create \xB7 Configure \xB7 Deploy")}
26
26
  `);
27
- console.log(` ${chalk.bold.dim("Documentation")} ${chalk.underline.cyan("https://github.com/guyzoum77/opticore-installer")}
27
+ console.log(`${chalk.bold.dim("Documentation")} ${chalk.underline.cyan("https://github.com/guyzoum77/opticore-installer")}
28
28
  `);
29
29
  };
30
30
 
@@ -63,7 +63,7 @@ var CGeneralMsg = {
63
63
  noDbCredentials: "You will have to manually set all the variable values in the .env file.",
64
64
  starterMsg: "Which starter project would you like to use ?",
65
65
  starterInitValue: "restfull_api_project",
66
- starterOptionsRestFullLabel: "RestFull API project",
66
+ starterOptionsRestFullLabel: "Standard projet",
67
67
  starterOptionsRestFullValue: "restfull_api_project",
68
68
  starterOptionsRestFullHint: "OptiCoreJS app tailored to create a RestFull APIs",
69
69
  projectNameMessage: "Enter the name of project :",
@@ -441,11 +441,7 @@ function endingMessageInfo(projectName) {
441
441
  `);
442
442
  console.log(` ${chalk4.dim("NB: Before running app, make sure to define in .env file application host and port.")}
443
443
  `);
444
- console.log(` ${chalk4.bold("Recommended packages:")}`);
445
- console.log(` ${chalk4.dim("\u276F")} ${chalk4.cyan("npm install opticore-validator")} ${chalk4.dim("\u2014 data schema validation with rich rules and custom messages.")}`);
446
- console.log(` ${chalk4.dim("\u276F")} ${chalk4.cyan("npm install opticore-orm-orchestrator")} ${chalk4.dim("\u2014 interactive model/entity generator for Prisma, TypeORM, Drizzle ORM, MikroORM and Sequelize.")}
447
- `);
448
- outro(chalk4.dim("To install opticore components: ") + chalk4.green("npx opticore list"));
444
+ outro(chalk4.dim("Useful to see all commands : ") + chalk4.green("opticore list"));
449
445
  }
450
446
 
451
447
  // src/presentations/starter/projectCreation.starter.ts
@@ -494,16 +490,29 @@ var SProjectCreation = async (gitRepo, projectPath, currentPath, projectName) =>
494
490
  pkg.dependencies["opticore-feature-component"] = pkg.dependencies["opticore-feature-module"];
495
491
  delete pkg.dependencies["opticore-feature-module"];
496
492
  }
497
- if (pkg.dependencies) pkg.dependencies = await UpdateOpticoreDeps(exec, pkg.dependencies);
498
- if (pkg.devDependencies) pkg.devDependencies = await UpdateOpticoreDeps(exec, pkg.devDependencies);
493
+ if (pkg.dependencies) {
494
+ pkg.dependencies = await UpdateOpticoreDeps(exec, pkg.dependencies);
495
+ }
496
+ if (pkg.devDependencies) {
497
+ pkg.devDependencies = await UpdateOpticoreDeps(exec, pkg.devDependencies);
498
+ }
499
499
  fs3.writeFileSync(pkgPath, JSON.stringify(pkg, null, 4));
500
500
  const lockPath = path2.join(escapedPath, "package-lock.json");
501
- if (fs3.existsSync(lockPath)) fs3.unlinkSync(lockPath);
501
+ if (fs3.existsSync(lockPath)) {
502
+ fs3.unlinkSync(lockPath);
503
+ }
502
504
  await exec("npm uninstall ora ansi-colors cli-spinner dotenv gradient-string util tsup path fs node ts-node tslib @types/cli-spinner @clack/prompts");
503
505
  cleanSpinner.succeed();
504
506
  const npmSpinner = ora("Installing dependencies").start();
505
507
  await exec("npm install");
506
508
  npmSpinner.succeed();
509
+ const cliSpinner = ora("Installing opticore CLI globally").start();
510
+ try {
511
+ await exec("npm install -g opticore-cli@latest");
512
+ cliSpinner.succeed();
513
+ } catch {
514
+ cliSpinner.fail("Could not install opticore-cli globally, run 'npm install -g opticore-cli@latest' manually");
515
+ }
507
516
  fs3.writeFileSync(path2.join(escapedPath, ".npmrc"), "loglevel=silent\n");
508
517
  endingMessageInfo(projectName);
509
518
  } catch (err) {
@@ -726,7 +735,8 @@ var PPostgres = (arg) => {
726
735
  host: arg.host ?? dotenv3.config()?.parsed?.DATA_BASE_HOST,
727
736
  user: arg.user ?? dotenv3.config()?.parsed?.DATA_BASE_USER,
728
737
  password: arg.password ?? dotenv3.config()?.parsed?.DATA_BASE_PASSWORD,
729
- port: arg.port ?? dotenv3.config()?.parsed?.DATA_BASE_PORT
738
+ port: arg.port ?? dotenv3.config()?.parsed?.DATA_BASE_PORT,
739
+ database: arg.database ?? dotenv3.config()?.parsed?.DATA_BASE_NAME
730
740
  };
731
741
  };
732
742
 
@@ -943,7 +953,7 @@ var SShellEscape = (str) => {
943
953
  var installerCore = async (initialProjectName2) => {
944
954
  let projectName;
945
955
  UWelcomeMessage();
946
- intro(chalk6.bgYellow.black(" Opticore Framework Installer "));
956
+ intro(chalk6.bgHex("#427ff5").white(" Opticore Framework Installer "));
947
957
  const starter = await SOutputPromptSelect(StarterOptions);
948
958
  starter instanceof Function ? (() => {
949
959
  cancel5(colors9.bgRed(colors9.white(" Operation cancelled ")));
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "opticore-installer",
3
- "version": "1.2.60",
3
+ "version": "1.2.62",
4
4
  "description": "opticore framework installer",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "type": "module",
9
9
  "bin": {
10
- "opticore-new-project": "dist/index.js"
10
+ "opticore-new": "dist/index.js"
11
11
  },
12
12
  "scripts": {
13
13
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -43,5 +43,8 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/pg": "^8.20.0"
46
+ },
47
+ "overrides": {
48
+ "esbuild": "^0.28.2"
46
49
  }
47
50
  }