lapeh 1.0.6 → 1.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.
- package/bin/index.js +5 -2
- package/framework.md +8 -0
- package/package.json +4 -2
- package/prisma/base.prisma +1 -1
- package/readme.md +12 -0
- package/scripts/init-project.js +5 -2
package/bin/index.js
CHANGED
|
@@ -173,8 +173,11 @@ const selectOption = async (query, options) => {
|
|
|
173
173
|
console.log("📄 Updating prisma/base.prisma...");
|
|
174
174
|
if (fs.existsSync(prismaBaseFile)) {
|
|
175
175
|
let baseContent = fs.readFileSync(prismaBaseFile, "utf8");
|
|
176
|
-
// Replace provider
|
|
177
|
-
baseContent = baseContent.replace(
|
|
176
|
+
// Replace provider in datasource block
|
|
177
|
+
baseContent = baseContent.replace(
|
|
178
|
+
/(datasource\s+db\s+\{[\s\S]*?provider\s*=\s*")([^"]+)(")/,
|
|
179
|
+
`$1${dbProvider}$3`
|
|
180
|
+
);
|
|
178
181
|
fs.writeFileSync(prismaBaseFile, baseContent);
|
|
179
182
|
}
|
|
180
183
|
|
package/framework.md
CHANGED
|
@@ -26,6 +26,14 @@ Setelah selesai, Anda bisa langsung menjalankan project:
|
|
|
26
26
|
npm run dev
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
### Akun Default
|
|
30
|
+
|
|
31
|
+
Jika seeder dijalankan (via `npm run first` atau `npm run db:seed`), gunakan akun berikut:
|
|
32
|
+
|
|
33
|
+
- **Super Admin**: `sa@sa.com` / `string`
|
|
34
|
+
- **Admin**: `a@a.com` / `string`
|
|
35
|
+
- **User**: `u@u.com` / `string`
|
|
36
|
+
|
|
29
37
|
## Database Workflow (Prisma)
|
|
30
38
|
|
|
31
39
|
Framework ini menggunakan **Prisma ORM** dengan struktur schema yang modular (dipecah per file). Berikut adalah panduan lengkap dari Development hingga Deployment.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lapeh",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Framework API Express yang siap pakai (Standardized)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
"boilerplate",
|
|
33
33
|
"typescript",
|
|
34
34
|
"prisma",
|
|
35
|
-
"
|
|
35
|
+
"roby",
|
|
36
|
+
"roby-karti-s",
|
|
37
|
+
"lapeh"
|
|
36
38
|
],
|
|
37
39
|
"author": "Roby Karti S <robyfull.dev@gmail.com>",
|
|
38
40
|
"license": "MIT",
|
package/prisma/base.prisma
CHANGED
package/readme.md
CHANGED
|
@@ -44,6 +44,18 @@ npm run dev
|
|
|
44
44
|
|
|
45
45
|
Server akan berjalan di `http://localhost:4000`.
|
|
46
46
|
|
|
47
|
+
### 🔑 Akun Default (Jika menggunakan `--full` atau `npm run db:seed`)
|
|
48
|
+
|
|
49
|
+
Jika Anda melakukan setup dengan flag `--full`, database akan terisi dengan akun default berikut:
|
|
50
|
+
|
|
51
|
+
| Role | Email | Password |
|
|
52
|
+
| :-------------- | :---------- | :------- |
|
|
53
|
+
| **Super Admin** | `sa@sa.com` | `string` |
|
|
54
|
+
| **Admin** | `a@a.com` | `string` |
|
|
55
|
+
| **User** | `u@u.com` | `string` |
|
|
56
|
+
|
|
57
|
+
> **Catatan:** Segera ubah password akun-akun ini jika Anda mendeploy ke production!
|
|
58
|
+
|
|
47
59
|
---
|
|
48
60
|
|
|
49
61
|
## 🛠 Development Tools
|
package/scripts/init-project.js
CHANGED
|
@@ -108,8 +108,11 @@ const selectOption = async (query, options) => {
|
|
|
108
108
|
console.log("📄 Updating prisma/base.prisma...");
|
|
109
109
|
if (fs.existsSync(prismaBaseFile)) {
|
|
110
110
|
let baseContent = fs.readFileSync(prismaBaseFile, "utf8");
|
|
111
|
-
// Replace provider
|
|
112
|
-
baseContent = baseContent.replace(
|
|
111
|
+
// Replace provider in datasource block
|
|
112
|
+
baseContent = baseContent.replace(
|
|
113
|
+
/(datasource\s+db\s+\{[\s\S]*?provider\s*=\s*")([^"]+)(")/,
|
|
114
|
+
`$1${dbProvider}$3`
|
|
115
|
+
);
|
|
113
116
|
fs.writeFileSync(prismaBaseFile, baseContent);
|
|
114
117
|
} else {
|
|
115
118
|
console.warn("⚠️ prisma/base.prisma not found. Skipping.");
|