@blocofy/cli 0.1.6 → 0.1.7
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/blocofy.mjs +9 -1
- package/lib/messages.mjs +21 -0
- package/package.json +1 -1
package/bin/blocofy.mjs
CHANGED
|
@@ -15,11 +15,12 @@ import { createInterface } from "node:readline/promises";
|
|
|
15
15
|
import { credentialsPath, loadCredentials, saveCredentials } from "../lib/credentials.mjs";
|
|
16
16
|
import { startDevServer } from "../lib/dev-server.mjs";
|
|
17
17
|
import { readLocalTemplates } from "../lib/local-theme.mjs";
|
|
18
|
+
import { githubNote } from "../lib/messages.mjs";
|
|
18
19
|
import { fetchDevSession, pullTheme, pushTheme } from "../lib/theme-sync.mjs";
|
|
19
20
|
import { hyperlink, openUrl } from "../lib/term.mjs";
|
|
20
21
|
import { isValidToken, isValidUrl, normalizeUrl } from "../lib/validate.mjs";
|
|
21
22
|
|
|
22
|
-
const VERSION = "0.1.
|
|
23
|
+
const VERSION = "0.1.7";
|
|
23
24
|
const args = process.argv.slice(2);
|
|
24
25
|
|
|
25
26
|
/** Parse `--key value` and `--flag` (boolean) arguments. */
|
|
@@ -217,6 +218,13 @@ async function themeDev(rest) {
|
|
|
217
218
|
console.log(`\n Press: ${keys}`);
|
|
218
219
|
console.log(` Edit a theme file and save — every open view reloads automatically.\n`);
|
|
219
220
|
|
|
221
|
+
// Düzlem uyarısı: CLI yalnız tema KODUNU taşır; editörde yapılan içerik/ayar
|
|
222
|
+
// bulutta yaşar (githubNote → lib/messages.mjs, oturum durumuna göre uyarlanır).
|
|
223
|
+
const note = githubNote(session);
|
|
224
|
+
if (note) {
|
|
225
|
+
console.log(` ℹ ${note}\n`);
|
|
226
|
+
}
|
|
227
|
+
|
|
220
228
|
// Tanılama: kaç tema dosyası izleniyor? Boşsa hot-reload mümkün değil — yanlış
|
|
221
229
|
// dizinde ya da `theme pull` yapılmamış demektir; sebebini açıkça söyle.
|
|
222
230
|
const localFiles = readLocalTemplates(themeDir);
|
package/lib/messages.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `theme dev` kullanıcı-yönelik mesajları (saf → test edilebilir). Düzlem uyarısı:
|
|
3
|
+
* CLI yalnız tema KODUNU taşır; editörde yapılan içerik/ayar bulutta yaşar.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Dev oturumuna göre "düzlem" uyarısı döndürür (string), oturum yoksa null.
|
|
8
|
+
* - GitHub bağlı → repo@branch + `git pull` ipucu.
|
|
9
|
+
* - Bağlı değil → içerik/ayar bulutta kalır + repo bağla ipucu.
|
|
10
|
+
* - Eski platform (githubConnected undefined) → ipuçsuz nötr uyarı.
|
|
11
|
+
*/
|
|
12
|
+
export function githubNote(session) {
|
|
13
|
+
if (!session) return null;
|
|
14
|
+
if (session.githubConnected === true) {
|
|
15
|
+
return `GitHub: ${session.githubRepo}@${session.githubBranch} — editor edits auto-commit there; run 'git pull' to sync them here.`;
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
"Content & settings edited in the admin editor stay server-side — they won't appear in these local files." +
|
|
19
|
+
(session.githubConnected === false ? " Connect a GitHub repo for two-way sync." : "")
|
|
20
|
+
);
|
|
21
|
+
}
|