Disable unwanted default applications and clean up related scripts

Remove `enable-default-apps.ts` script, add `disable-deprecated-apps.ts`, update seeding logic in `seed.ts` to set `isActive` to false for documents, and modify `DOCKER.md` and `scripts/package.json` accordingly.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: ac51f801-911b-4be5-b27c-e3212d5c0c73
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/1WKAcHk
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
riyadhafraa
2026-05-18 07:18:15 +00:00
parent aba984d238
commit 7d65198298
4 changed files with 17 additions and 10 deletions
+4 -4
View File
@@ -115,12 +115,12 @@ git pull
> رقم البناء (`build`) يُولَّد تلقائياً من git قبل كل `pnpm run build` (انظر `scripts/update-version.mjs`)، فلا تحتاج تعديله يدوياً في `version.json`. > رقم البناء (`build`) يُولَّد تلقائياً من git قبل كل `pnpm run build` (انظر `scripts/update-version.mjs`)، فلا تحتاج تعديله يدوياً في `version.json`.
## تفعيل تطبيقي التقويم والإشعارات ## تعطيل تطبيقات التقويم والإشعارات والمستندات
افتراضياً يصلان مُعطَّلَين في البيئات الجديدة. لتفعيلهما على بيئة موجودة (مرة واحدة): افتراضياً تصل الثلاثة مُعطَّلة في البيئات الجديدة (السيد فقط يُدخل صفوفاً جديدة، ولا يعدّل الموجودة). لتعطيلها على بيئة موجودة فيها هذه التطبيقات مفعّلة (مرة واحدة):
```bash ```bash
docker compose exec api pnpm --filter @workspace/scripts run enable-default-apps docker compose exec api pnpm --filter @workspace/scripts run disable-deprecated-apps
``` ```
السكربت idempotent (آمن لإعادة التشغيل) ويعيد فقط `is_active=true` لـ `calendar` و `notifications`. السكربت idempotent (آمن لإعادة التشغيل) ويضبط `is_active=false` لـ `calendar` و `notifications` و `documents` فقط. يمكن إعادة تفعيل أي منها لاحقاً من إعدادات التطبيقات داخل لوحة التحكم.
+1 -1
View File
@@ -7,7 +7,7 @@
"hello": "tsx ./src/hello.ts", "hello": "tsx ./src/hello.ts",
"seed": "tsx ./src/seed.ts", "seed": "tsx ./src/seed.ts",
"remove-chat": "tsx ./src/remove-chat.ts", "remove-chat": "tsx ./src/remove-chat.ts",
"enable-default-apps": "tsx ./src/enable-default-apps.ts", "disable-deprecated-apps": "tsx ./src/disable-deprecated-apps.ts",
"typecheck": "tsc -p tsconfig.json --noEmit", "typecheck": "tsc -p tsconfig.json --noEmit",
"test": "node --test 'tests/**/*.test.mjs'" "test": "node --test 'tests/**/*.test.mjs'"
}, },
@@ -1,13 +1,13 @@
import { db, appsTable } from "@workspace/db"; import { db, appsTable } from "@workspace/db";
import { inArray } from "drizzle-orm"; import { inArray } from "drizzle-orm";
const SLUGS = ["calendar", "notifications"]; const SLUGS = ["calendar", "notifications", "documents"];
async function main() { async function main() {
console.log(`Enabling apps: ${SLUGS.join(", ")}...`); console.log(`Disabling apps: ${SLUGS.join(", ")}...`);
const updated = await db const updated = await db
.update(appsTable) .update(appsTable)
.set({ isActive: true }) .set({ isActive: false })
.where(inArray(appsTable.slug, SLUGS)) .where(inArray(appsTable.slug, SLUGS))
.returning({ slug: appsTable.slug, isActive: appsTable.isActive }); .returning({ slug: appsTable.slug, isActive: appsTable.isActive });
@@ -15,7 +15,7 @@ async function main() {
console.warn("No matching apps found — did seed run yet?"); console.warn("No matching apps found — did seed run yet?");
} else { } else {
for (const row of updated) { for (const row of updated) {
console.log(` ${row.slug} (isActive=${row.isActive})`); console.log(` - ${row.slug} (isActive=${row.isActive})`);
} }
} }
console.log("Done."); console.log("Done.");
+8 -1
View File
@@ -294,7 +294,14 @@ async function main() {
iconName: "FileText", iconName: "FileText",
route: "/documents", route: "/documents",
color: "#64748b", color: "#64748b",
isActive: true, // #577: same policy as notifications/calendar — ship Documents
// DISABLED on fresh installs. There is no Documents surface the
// user is actively using yet and the tile cluttered the home
// launcher. Insert uses onConflictDoNothing, so existing
// environments keep whatever the current row says — see
// scripts/src/disable-deprecated-apps.ts for the one-shot that
// flips already-seeded rows off.
isActive: false,
isSystem: false, isSystem: false,
sortOrder: 6, sortOrder: 6,
}, },