@kdrgny/justjson 1.1.0 → 1.2.0
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/dist/cli.js +240 -1
- package/dist/editor/assets/index-BoAqd15W.js +612 -0
- package/dist/editor/assets/index-CP_v5575.css +1 -0
- package/dist/editor/assets/public-sans-latin-ext-wght-normal-MQgHevqp.woff2 +0 -0
- package/dist/editor/assets/public-sans-latin-wght-normal-DdeTHZLK.woff2 +0 -0
- package/dist/editor/assets/public-sans-vietnamese-wght-normal-CtlIRbEm.woff2 +0 -0
- package/dist/editor/assets/space-mono-latin-400-normal-Rg4St2Dn.woff2 +0 -0
- package/dist/editor/assets/space-mono-latin-400-normal-_3DlpgIW.woff +0 -0
- package/dist/editor/assets/space-mono-latin-700-normal-D7A851RN.woff +0 -0
- package/dist/editor/assets/space-mono-latin-700-normal-mWgeinG7.woff2 +0 -0
- package/dist/editor/assets/space-mono-latin-ext-400-normal-D4cJI_B-.woff +0 -0
- package/dist/editor/assets/space-mono-latin-ext-400-normal-DTLbW2xa.woff2 +0 -0
- package/dist/editor/assets/space-mono-latin-ext-700-normal-B2s3bDs2.woff2 +0 -0
- package/dist/editor/assets/space-mono-latin-ext-700-normal-B_E7P90g.woff +0 -0
- package/dist/editor/assets/space-mono-vietnamese-400-normal-B0PMp_xB.woff +0 -0
- package/dist/editor/assets/space-mono-vietnamese-400-normal-BNOj0Qhp.woff2 +0 -0
- package/dist/editor/assets/space-mono-vietnamese-700-normal-D-KrLuLr.woff +0 -0
- package/dist/editor/assets/space-mono-vietnamese-700-normal-DWQgDHuA.woff2 +0 -0
- package/dist/editor/index.html +2 -2
- package/package.json +3 -14
- package/dist/editor/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/editor/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/editor/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/editor/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/editor/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/editor/assets/index-B-aBBk0p.css +0 -1
- package/dist/editor/assets/index-DhyPvr9S.js +0 -574
package/dist/cli.js
CHANGED
|
@@ -4548,6 +4548,57 @@ var blog_default = {
|
|
|
4548
4548
|
}
|
|
4549
4549
|
};
|
|
4550
4550
|
|
|
4551
|
+
// src/templates/catalog.json
|
|
4552
|
+
var catalog_default = {
|
|
4553
|
+
title: "\xDCr\xFCn Katalo\u011Fu",
|
|
4554
|
+
description: "Fiyat, kategori ve g\xF6rselli \xFCr\xFCnler; bir de Ma\u011Faza ayarlar\u0131.",
|
|
4555
|
+
schema: {
|
|
4556
|
+
version: 1,
|
|
4557
|
+
collections: [
|
|
4558
|
+
{
|
|
4559
|
+
name: "urunler",
|
|
4560
|
+
label: "\xDCr\xFCnler",
|
|
4561
|
+
path: "urunler",
|
|
4562
|
+
fields: [
|
|
4563
|
+
{ key: "title", label: "Ba\u015Fl\u0131k", type: "text", required: true },
|
|
4564
|
+
{ key: "slug", label: "Slug", type: "text", required: true },
|
|
4565
|
+
{ key: "fiyat", label: "Fiyat", type: "number" },
|
|
4566
|
+
{
|
|
4567
|
+
key: "kategori",
|
|
4568
|
+
label: "Kategori",
|
|
4569
|
+
type: "select",
|
|
4570
|
+
options: ["Ev", "Giyim", "Aksesuar"]
|
|
4571
|
+
},
|
|
4572
|
+
{ key: "kapak", label: "G\xF6rsel", type: "image" },
|
|
4573
|
+
{ key: "aciklama", label: "A\xE7\u0131klama", type: "richtext" }
|
|
4574
|
+
]
|
|
4575
|
+
}
|
|
4576
|
+
],
|
|
4577
|
+
singletons: [
|
|
4578
|
+
{
|
|
4579
|
+
name: "magaza",
|
|
4580
|
+
label: "Ma\u011Faza",
|
|
4581
|
+
path: "magaza.json",
|
|
4582
|
+
fields: [
|
|
4583
|
+
{ key: "title", label: "Ma\u011Faza ad\u0131", type: "text" },
|
|
4584
|
+
{ key: "slogan", label: "Slogan", type: "text" }
|
|
4585
|
+
]
|
|
4586
|
+
}
|
|
4587
|
+
]
|
|
4588
|
+
},
|
|
4589
|
+
samples: {
|
|
4590
|
+
urunler: [
|
|
4591
|
+
{
|
|
4592
|
+
title: "Seramik Kupa",
|
|
4593
|
+
slug: "seramik-kupa",
|
|
4594
|
+
fiyat: 180,
|
|
4595
|
+
kategori: "Ev",
|
|
4596
|
+
aciklama: "Elde yap\u0131m seramik kupa."
|
|
4597
|
+
}
|
|
4598
|
+
]
|
|
4599
|
+
}
|
|
4600
|
+
};
|
|
4601
|
+
|
|
4551
4602
|
// src/templates/changelog.json
|
|
4552
4603
|
var changelog_default = {
|
|
4553
4604
|
title: "Changelog",
|
|
@@ -4660,6 +4711,54 @@ var docs_default = {
|
|
|
4660
4711
|
}
|
|
4661
4712
|
};
|
|
4662
4713
|
|
|
4714
|
+
// src/templates/event.json
|
|
4715
|
+
var event_default = {
|
|
4716
|
+
title: "Etkinlik Program\u0131",
|
|
4717
|
+
description: "Tarih, saat ve konu\u015Fmac\u0131l\u0131 oturumlardan olu\u015Fan bir etkinlik ajandas\u0131.",
|
|
4718
|
+
schema: {
|
|
4719
|
+
version: 1,
|
|
4720
|
+
collections: [
|
|
4721
|
+
{
|
|
4722
|
+
name: "oturumlar",
|
|
4723
|
+
label: "Oturumlar",
|
|
4724
|
+
path: "oturumlar",
|
|
4725
|
+
fields: [
|
|
4726
|
+
{ key: "title", label: "Ba\u015Fl\u0131k", type: "text", required: true },
|
|
4727
|
+
{ key: "slug", label: "Slug", type: "text", required: true },
|
|
4728
|
+
{ key: "tarih", label: "Tarih", type: "date" },
|
|
4729
|
+
{ key: "saat", label: "Saat", type: "text" },
|
|
4730
|
+
{ key: "konusmaci", label: "Konu\u015Fmac\u0131", type: "text" },
|
|
4731
|
+
{ key: "yer", label: "Salon", type: "text" },
|
|
4732
|
+
{ key: "aciklama", label: "A\xE7\u0131klama", type: "richtext" }
|
|
4733
|
+
]
|
|
4734
|
+
}
|
|
4735
|
+
],
|
|
4736
|
+
singletons: [
|
|
4737
|
+
{
|
|
4738
|
+
name: "etkinlik",
|
|
4739
|
+
label: "Etkinlik",
|
|
4740
|
+
path: "etkinlik.json",
|
|
4741
|
+
fields: [
|
|
4742
|
+
{ key: "title", label: "Etkinlik ad\u0131", type: "text" },
|
|
4743
|
+
{ key: "slogan", label: "Slogan", type: "text" }
|
|
4744
|
+
]
|
|
4745
|
+
}
|
|
4746
|
+
]
|
|
4747
|
+
},
|
|
4748
|
+
samples: {
|
|
4749
|
+
oturumlar: [
|
|
4750
|
+
{
|
|
4751
|
+
title: "A\xE7\u0131l\u0131\u015F Konu\u015Fmas\u0131",
|
|
4752
|
+
slug: "acilis-konusmasi",
|
|
4753
|
+
saat: "09:00",
|
|
4754
|
+
konusmaci: "Ay\u015Fe Y\u0131lmaz",
|
|
4755
|
+
yer: "Ana Salon",
|
|
4756
|
+
aciklama: "Etkinli\u011Fe ho\u015F geldiniz."
|
|
4757
|
+
}
|
|
4758
|
+
]
|
|
4759
|
+
}
|
|
4760
|
+
};
|
|
4761
|
+
|
|
4663
4762
|
// src/templates/portfolio.json
|
|
4664
4763
|
var portfolio_default = {
|
|
4665
4764
|
title: "Portfolyo",
|
|
@@ -4714,13 +4813,61 @@ var portfolio_default = {
|
|
|
4714
4813
|
}
|
|
4715
4814
|
};
|
|
4716
4815
|
|
|
4816
|
+
// src/templates/recipe.json
|
|
4817
|
+
var recipe_default = {
|
|
4818
|
+
title: "Tarif Defteri",
|
|
4819
|
+
description: "Malzeme, yap\u0131l\u0131\u015F ve kapak g\xF6rselli tarifler; bir de Mutfak ayarlar\u0131.",
|
|
4820
|
+
schema: {
|
|
4821
|
+
version: 1,
|
|
4822
|
+
collections: [
|
|
4823
|
+
{
|
|
4824
|
+
name: "tarifler",
|
|
4825
|
+
label: "Tarifler",
|
|
4826
|
+
path: "tarifler",
|
|
4827
|
+
fields: [
|
|
4828
|
+
{ key: "title", label: "Ba\u015Fl\u0131k", type: "text", required: true },
|
|
4829
|
+
{ key: "slug", label: "Slug", type: "text", required: true },
|
|
4830
|
+
{ key: "sure", label: "S\xFCre", type: "text" },
|
|
4831
|
+
{ key: "porsiyon", label: "Porsiyon", type: "number" },
|
|
4832
|
+
{ key: "kapak", label: "Kapak", type: "image" },
|
|
4833
|
+
{ key: "malzemeler", label: "Malzemeler", type: "richtext" },
|
|
4834
|
+
{ key: "yapilis", label: "Yap\u0131l\u0131\u015F", type: "richtext" }
|
|
4835
|
+
]
|
|
4836
|
+
}
|
|
4837
|
+
],
|
|
4838
|
+
singletons: [
|
|
4839
|
+
{
|
|
4840
|
+
name: "mutfak",
|
|
4841
|
+
label: "Mutfak",
|
|
4842
|
+
path: "mutfak.json",
|
|
4843
|
+
fields: [{ key: "title", label: "Site ad\u0131", type: "text" }]
|
|
4844
|
+
}
|
|
4845
|
+
]
|
|
4846
|
+
},
|
|
4847
|
+
samples: {
|
|
4848
|
+
tarifler: [
|
|
4849
|
+
{
|
|
4850
|
+
title: "Ak\u015Fam Makarnas\u0131",
|
|
4851
|
+
slug: "aksam-makarnasi",
|
|
4852
|
+
sure: "20 dk",
|
|
4853
|
+
porsiyon: 2,
|
|
4854
|
+
malzemeler: "- 200g makarna\n- 2 di\u015F sar\u0131msak\n- Zeytinya\u011F\u0131",
|
|
4855
|
+
yapilis: "Makarnay\u0131 ha\u015Fla. Sar\u0131msa\u011F\u0131 zeytinya\u011F\u0131nda kavur. Kar\u0131\u015Ft\u0131r."
|
|
4856
|
+
}
|
|
4857
|
+
]
|
|
4858
|
+
}
|
|
4859
|
+
};
|
|
4860
|
+
|
|
4717
4861
|
// src/commands/init.ts
|
|
4718
4862
|
var templates = {
|
|
4719
4863
|
blog: blog_default,
|
|
4720
4864
|
cv: cv_default,
|
|
4721
4865
|
portfolio: portfolio_default,
|
|
4722
4866
|
docs: docs_default,
|
|
4723
|
-
changelog: changelog_default
|
|
4867
|
+
changelog: changelog_default,
|
|
4868
|
+
recipe: recipe_default,
|
|
4869
|
+
event: event_default,
|
|
4870
|
+
catalog: catalog_default
|
|
4724
4871
|
};
|
|
4725
4872
|
function listTemplates() {
|
|
4726
4873
|
return Object.keys(templates);
|
|
@@ -4785,6 +4932,65 @@ import { fileURLToPath } from "url";
|
|
|
4785
4932
|
import { serve } from "@hono/node-server";
|
|
4786
4933
|
import { Hono } from "hono";
|
|
4787
4934
|
var editorDir = fileURLToPath(new URL("./editor", import.meta.url));
|
|
4935
|
+
var PROVIDER_BASE_URLS = {
|
|
4936
|
+
groq: "https://api.groq.com/openai/v1",
|
|
4937
|
+
openrouter: "https://openrouter.ai/api/v1"
|
|
4938
|
+
};
|
|
4939
|
+
async function callGemini(apiKey, model, system, prompt) {
|
|
4940
|
+
const cleanModel = model.trim().replace(/^models\//, "");
|
|
4941
|
+
const url = `https://generativelanguage.googleapis.com/v1beta/models/${encodeURIComponent(cleanModel)}:generateContent?key=${encodeURIComponent(apiKey)}`;
|
|
4942
|
+
const res = await fetch(url, {
|
|
4943
|
+
method: "POST",
|
|
4944
|
+
headers: { "content-type": "application/json" },
|
|
4945
|
+
body: JSON.stringify({
|
|
4946
|
+
contents: [{ role: "user", parts: [{ text: prompt }] }],
|
|
4947
|
+
...system ? { systemInstruction: { parts: [{ text: system }] } } : {}
|
|
4948
|
+
})
|
|
4949
|
+
});
|
|
4950
|
+
const data = await res.json();
|
|
4951
|
+
if (!res.ok) throw new Error(data.error?.message ?? `Gemini iste\u011Fi ba\u015Far\u0131s\u0131z (${res.status})`);
|
|
4952
|
+
const text = data.candidates?.[0]?.content?.parts?.map((p) => p.text ?? "").join("") ?? "";
|
|
4953
|
+
if (!text) throw new Error("Gemini bo\u015F yan\u0131t d\xF6nd\xFC");
|
|
4954
|
+
return text;
|
|
4955
|
+
}
|
|
4956
|
+
async function listGeminiModels(apiKey) {
|
|
4957
|
+
const url = `https://generativelanguage.googleapis.com/v1beta/models?key=${encodeURIComponent(apiKey)}&pageSize=1000`;
|
|
4958
|
+
const res = await fetch(url);
|
|
4959
|
+
const data = await res.json();
|
|
4960
|
+
if (!res.ok) throw new Error(data.error?.message ?? `Model listesi al\u0131namad\u0131 (${res.status})`);
|
|
4961
|
+
return (data.models ?? []).filter((m) => m.supportedGenerationMethods?.includes("generateContent")).map((m) => ({
|
|
4962
|
+
id: (m.name ?? "").replace(/^models\//, ""),
|
|
4963
|
+
label: m.displayName ?? (m.name ?? "").replace(/^models\//, "")
|
|
4964
|
+
})).filter(
|
|
4965
|
+
(m) => m.id && !/tts|image|embedding|robotics|computer-use|veo|lyria|imagen|aqa/i.test(m.id)
|
|
4966
|
+
);
|
|
4967
|
+
}
|
|
4968
|
+
async function listOpenAiCompatibleModels(baseUrl, apiKey) {
|
|
4969
|
+
if (!baseUrl) throw new Error("Bu sa\u011Flay\u0131c\u0131 i\xE7in taban URL gerekli");
|
|
4970
|
+
const res = await fetch(`${baseUrl.replace(/\/$/, "")}/models`, {
|
|
4971
|
+
headers: apiKey ? { authorization: `Bearer ${apiKey}` } : {}
|
|
4972
|
+
});
|
|
4973
|
+
const data = await res.json();
|
|
4974
|
+
if (!res.ok) throw new Error(data.error?.message ?? `Model listesi al\u0131namad\u0131 (${res.status})`);
|
|
4975
|
+
return (data.data ?? []).map((m) => ({ id: m.id ?? "", label: m.id ?? "" })).filter((m) => m.id);
|
|
4976
|
+
}
|
|
4977
|
+
async function callOpenAiCompatible(baseUrl, apiKey, model, system, prompt) {
|
|
4978
|
+
if (!baseUrl) throw new Error("Bu sa\u011Flay\u0131c\u0131 i\xE7in taban URL gerekli");
|
|
4979
|
+
const messages = [
|
|
4980
|
+
...system ? [{ role: "system", content: system }] : [],
|
|
4981
|
+
{ role: "user", content: prompt }
|
|
4982
|
+
];
|
|
4983
|
+
const res = await fetch(`${baseUrl.replace(/\/$/, "")}/chat/completions`, {
|
|
4984
|
+
method: "POST",
|
|
4985
|
+
headers: { "content-type": "application/json", authorization: `Bearer ${apiKey}` },
|
|
4986
|
+
body: JSON.stringify({ model, messages })
|
|
4987
|
+
});
|
|
4988
|
+
const data = await res.json();
|
|
4989
|
+
if (!res.ok) throw new Error(data.error?.message ?? `\u0130stek ba\u015Far\u0131s\u0131z (${res.status})`);
|
|
4990
|
+
const text = data.choices?.[0]?.message?.content ?? "";
|
|
4991
|
+
if (!text) throw new Error("Sa\u011Flay\u0131c\u0131 bo\u015F yan\u0131t d\xF6nd\xFC");
|
|
4992
|
+
return text;
|
|
4993
|
+
}
|
|
4788
4994
|
var MIME = {
|
|
4789
4995
|
".html": "text/html; charset=utf-8",
|
|
4790
4996
|
".js": "text/javascript",
|
|
@@ -4906,6 +5112,39 @@ async function createServer(root2) {
|
|
|
4906
5112
|
await writeFile3(abs, Buffer.from(body.dataBase64, "base64"));
|
|
4907
5113
|
return c.json({ path: rel });
|
|
4908
5114
|
});
|
|
5115
|
+
app.post("/api/_ai/models", async (c) => {
|
|
5116
|
+
const body = await c.req.json();
|
|
5117
|
+
const { provider, apiKey } = body;
|
|
5118
|
+
if (!provider) return c.json({ error: "provider zorunlu" }, 400);
|
|
5119
|
+
try {
|
|
5120
|
+
const models = provider === "gemini" ? await listGeminiModels(apiKey ?? "") : await listOpenAiCompatibleModels(
|
|
5121
|
+
body.baseUrl || PROVIDER_BASE_URLS[provider] || "",
|
|
5122
|
+
apiKey ?? ""
|
|
5123
|
+
);
|
|
5124
|
+
return c.json({ models });
|
|
5125
|
+
} catch (e) {
|
|
5126
|
+
return c.json({ error: e.message }, 502);
|
|
5127
|
+
}
|
|
5128
|
+
});
|
|
5129
|
+
app.post("/api/_ai/generate", async (c) => {
|
|
5130
|
+
const body = await c.req.json();
|
|
5131
|
+
const { provider, apiKey, model, system, prompt } = body;
|
|
5132
|
+
if (!provider || !apiKey || !model || !prompt) {
|
|
5133
|
+
return c.json({ error: "provider, model, apiKey ve prompt zorunlu" }, 400);
|
|
5134
|
+
}
|
|
5135
|
+
try {
|
|
5136
|
+
const text = provider === "gemini" ? await callGemini(apiKey, model, system, prompt) : await callOpenAiCompatible(
|
|
5137
|
+
body.baseUrl || PROVIDER_BASE_URLS[provider] || "",
|
|
5138
|
+
apiKey,
|
|
5139
|
+
model,
|
|
5140
|
+
system,
|
|
5141
|
+
prompt
|
|
5142
|
+
);
|
|
5143
|
+
return c.json({ text });
|
|
5144
|
+
} catch (e) {
|
|
5145
|
+
return c.json({ error: e.message }, 502);
|
|
5146
|
+
}
|
|
5147
|
+
});
|
|
4909
5148
|
app.get("/media/:file", async (c) => {
|
|
4910
5149
|
const file = c.req.param("file");
|
|
4911
5150
|
if (file.includes("/") || file.includes("\\") || file.includes("..")) {
|