falak-app-duo 1.1.1 → 1.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/bin/falak-app-duo +32 -4
  2. package/package.json +1 -1
package/bin/falak-app-duo CHANGED
@@ -138,19 +138,47 @@ async function main() {
138
138
  }
139
139
  }
140
140
 
141
- // RTL off: flip the hard-coded Arabic/LTR defaults to English/LTR
141
+ // RTL off: strip Arabic/RTL out of the copied app — English/LTR only.
142
+ // The template is RTL by default, so this must also remove the locale
143
+ // toggle and the Arabic bundle or the app would still "support RTL".
142
144
  if (!rtlEnabled) {
143
145
  const htmlPath = path.join(targetDir, "index.html");
144
146
  const html = await fs.readFile(htmlPath, "utf-8");
145
147
  await fs.writeFile(htmlPath, html.replace('<html lang="ar" dir="rtl">', '<html lang="en" dir="ltr">'));
146
148
 
147
149
  const i18nPath = path.join(targetDir, "src", "i18n", "index.js");
148
- const i18n = await fs.readFile(i18nPath, "utf-8");
149
150
  await fs.writeFile(
150
151
  i18nPath,
151
- i18n.replace('getItem(STORAGE_KEY) || "ar"', 'getItem(STORAGE_KEY) || "en"')
152
+ [
153
+ 'import { createI18n } from "vue-i18n";',
154
+ 'import en from "./locales/en.json";',
155
+ "",
156
+ "export default createI18n({",
157
+ ' legacy: false,',
158
+ ' locale: "en",',
159
+ ' fallbackLocale: "en",',
160
+ " messages: { en },",
161
+ "});",
162
+ "",
163
+ ].join("\n")
152
164
  );
153
- console.log(chalk.gray(" RTL disabled \u2014 English (LTR) set as the default locale."));
165
+ await fs.remove(path.join(targetDir, "src", "i18n", "locales", "ar.json"));
166
+
167
+ const appPath = path.join(targetDir, "src", "App.vue");
168
+ let app = await fs.readFile(appPath, "utf-8");
169
+ app = app.replace('import { setLocale } from "@/i18n";\n', "");
170
+ app = app.replace("const { t, locale } = useI18n();", "const { t } = useI18n();");
171
+ app = app.replace(
172
+ 'function toggleLocale() {\n setLocale(locale.value === "ar" ? "en" : "ar");\n}\n',
173
+ ""
174
+ );
175
+ app = app.replace(
176
+ /\n <button @click="toggleLocale" class="text-sm px-2 py-1 border rounded">\n \{\{ locale === "ar" \? "EN" : "AR" \}\}\n <\/button>/,
177
+ ""
178
+ );
179
+ await fs.writeFile(appPath, app);
180
+
181
+ console.log(chalk.gray(" RTL disabled \u2014 English/LTR only, no Arabic or AR/EN toggle."));
154
182
  }
155
183
 
156
184
  // Generate a real .env from .env.example with a fresh encryption key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "falak-app-duo",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Vue 3 boilerplate scaffolder — Ably (realtime), Brevo, AES-256, Arabic/RTL, and a Laravel API client (API key + user token auth). No Firebase, no Groq/Paymob on the frontend (Groq is backend-only; Paymob dropped).",
5
5
  "type": "module",
6
6
  "bin": {