lapeh 2.0.6 → 2.0.8

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/bin/index.js +12 -15
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -191,27 +191,21 @@ function createProject() {
191
191
  const dbType = await selectOption("Database apa yang akan digunakan?", [
192
192
  { key: "pgsql", label: "PostgreSQL", provider: "postgresql", defaultPort: "5432" },
193
193
  { key: "mysql", label: "MySQL", provider: "mysql", defaultPort: "3306" },
194
- { key: "mariadb", label: "MariaDB", provider: "mysql", defaultPort: "3306" },
195
- { key: "sqlite", label: "SQLite", provider: "sqlite", defaultPort: "" },
196
194
  ]);
197
195
 
198
196
  let dbUrl = "";
199
197
  let dbProvider = dbType.provider;
200
198
 
201
- if (dbType.key === "sqlite") {
202
- dbUrl = "file:./dev.db";
199
+ const host = await ask("Database Host", "localhost");
200
+ const port = await ask("Database Port", dbType.defaultPort);
201
+ const user = await ask("Database User", "root");
202
+ const password = await ask("Database Password", "");
203
+ const dbName = await ask("Database Name", projectName.replace(/-/g, '_')); // Default db name based on project name
204
+
205
+ if (dbType.key === "pgsql") {
206
+ dbUrl = `postgresql://${user}:${password}@${host}:${port}/${dbName}?schema=public`;
203
207
  } else {
204
- const host = await ask("Database Host", "localhost");
205
- const port = await ask("Database Port", dbType.defaultPort);
206
- const user = await ask("Database User", "root");
207
- const password = await ask("Database Password", "");
208
- const dbName = await ask("Database Name", projectName.replace(/-/g, '_')); // Default db name based on project name
209
-
210
- if (dbType.key === "pgsql") {
211
- dbUrl = `postgresql://${user}:${password}@${host}:${port}/${dbName}?schema=public`;
212
- } else {
213
- dbUrl = `mysql://${user}:${password}@${host}:${port}/${dbName}`;
214
- }
208
+ dbUrl = `mysql://${user}:${password}@${host}:${port}/${dbName}`;
215
209
  }
216
210
 
217
211
  rl.close();
@@ -225,6 +219,9 @@ function createProject() {
225
219
  'bin', // Don't copy the CLI script itself
226
220
  'package-lock.json',
227
221
  '.DS_Store',
222
+ 'prisma/migrations', // Exclude existing migrations
223
+ 'prisma/dev.db', // Exclude sqlite db if exists
224
+ 'prisma/dev.db-journal',
228
225
  projectName // Don't copy the destination folder itself if creating inside the template
229
226
  ];
230
227
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lapeh",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "Framework API Express yang siap pakai (Standardized)",
5
5
  "main": "index.js",
6
6
  "bin": {