@curenorway/kode-cli 1.13.0 → 1.14.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/{chunk-C2BM7IJ6.js → chunk-I7TVOZJR.js} +19 -7
- package/dist/cli.js +6 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1229,13 +1229,16 @@ Full documentation: [.cure-kode/KODE.md](.cure-kode/KODE.md)
|
|
|
1229
1229
|
function hasKodeReference(content) {
|
|
1230
1230
|
return content.includes(".cure-kode/KODE.md") || content.includes("cure-kode/KODE.md") || content.includes("KODE.md");
|
|
1231
1231
|
}
|
|
1232
|
-
function generateKodeMd(siteName, siteSlug, scripts, pages) {
|
|
1232
|
+
function generateKodeMd(siteName, siteSlug, scripts, pages, options) {
|
|
1233
|
+
const productionEnabled = options?.productionEnabled ?? false;
|
|
1233
1234
|
let md = `# Cure Kode: ${siteName}
|
|
1234
1235
|
|
|
1235
1236
|
This project uses **Cure Kode** CDN for JavaScript/CSS delivery to Webflow.
|
|
1236
1237
|
|
|
1237
1238
|
> **This file is auto-generated.** Do not edit manually - changes will be overwritten by \`kode pull\`, \`kode push\`, and \`kode sync\`.
|
|
1238
1239
|
|
|
1240
|
+
**Produksjon:** ${productionEnabled ? "\u2713 Aktivert \u2014 deploy til staging og produksjon" : "\u25CB Deaktivert \u2014 kun staging. Ikke hent fra produksjons-URL."}
|
|
1241
|
+
|
|
1239
1242
|
---
|
|
1240
1243
|
|
|
1241
1244
|
`;
|
|
@@ -1394,15 +1397,15 @@ function ensureClaudeMdReference(projectRoot) {
|
|
|
1394
1397
|
writeFileSync3(claudeMdPath, newContent);
|
|
1395
1398
|
return { created: false, updated: true, skipped: false };
|
|
1396
1399
|
}
|
|
1397
|
-
function updateKodeMd(projectRoot, siteName, siteSlug, scripts, pages) {
|
|
1400
|
+
function updateKodeMd(projectRoot, siteName, siteSlug, scripts, pages, options) {
|
|
1398
1401
|
const kodeMdPath = join3(projectRoot, ".cure-kode", "KODE.md");
|
|
1399
1402
|
const existed = existsSync3(kodeMdPath);
|
|
1400
|
-
const content = generateKodeMd(siteName, siteSlug, scripts, pages);
|
|
1403
|
+
const content = generateKodeMd(siteName, siteSlug, scripts, pages, options);
|
|
1401
1404
|
writeFileSync3(kodeMdPath, content);
|
|
1402
1405
|
return { created: !existed, updated: existed };
|
|
1403
1406
|
}
|
|
1404
|
-
function updateKodeDocs(projectRoot, siteName, siteSlug, scripts, pages) {
|
|
1405
|
-
const kodeMd = updateKodeMd(projectRoot, siteName, siteSlug, scripts, pages);
|
|
1407
|
+
function updateKodeDocs(projectRoot, siteName, siteSlug, scripts, pages, options) {
|
|
1408
|
+
const kodeMd = updateKodeMd(projectRoot, siteName, siteSlug, scripts, pages, options);
|
|
1406
1409
|
const claudeMd = ensureClaudeMdReference(projectRoot);
|
|
1407
1410
|
return { kodeMd, claudeMd };
|
|
1408
1411
|
}
|
|
@@ -1593,13 +1596,17 @@ config.json
|
|
|
1593
1596
|
spinner.start("Genererer AI-dokumentasjon...");
|
|
1594
1597
|
let scripts = [];
|
|
1595
1598
|
let pages = [];
|
|
1599
|
+
let productionEnabled = false;
|
|
1596
1600
|
try {
|
|
1597
|
-
const [scriptsResponse, pagesResponse] = await Promise.all([
|
|
1601
|
+
const [scriptsResponse, pagesResponse, prodResponse] = await Promise.all([
|
|
1598
1602
|
fetch(`https://app.cure.no/api/cdn/sites/${site.id}/scripts`, {
|
|
1599
1603
|
headers: { "X-API-Key": apiKey }
|
|
1600
1604
|
}),
|
|
1601
1605
|
fetch(`https://app.cure.no/api/cdn/sites/${site.id}/pages`, {
|
|
1602
1606
|
headers: { "X-API-Key": apiKey }
|
|
1607
|
+
}),
|
|
1608
|
+
fetch(`https://app.cure.no/api/cdn/sites/${site.id}/production`, {
|
|
1609
|
+
headers: { "X-API-Key": apiKey }
|
|
1603
1610
|
})
|
|
1604
1611
|
]);
|
|
1605
1612
|
if (scriptsResponse.ok) {
|
|
@@ -1608,6 +1615,10 @@ config.json
|
|
|
1608
1615
|
if (pagesResponse.ok) {
|
|
1609
1616
|
pages = await pagesResponse.json();
|
|
1610
1617
|
}
|
|
1618
|
+
if (prodResponse.ok) {
|
|
1619
|
+
const prodData = await prodResponse.json();
|
|
1620
|
+
productionEnabled = prodData.production_enabled ?? false;
|
|
1621
|
+
}
|
|
1611
1622
|
} catch {
|
|
1612
1623
|
}
|
|
1613
1624
|
const docsResult = updateKodeDocs(
|
|
@@ -1615,7 +1626,8 @@ config.json
|
|
|
1615
1626
|
config.siteName,
|
|
1616
1627
|
config.siteSlug,
|
|
1617
1628
|
scriptsToDocsFormat(scripts, pages),
|
|
1618
|
-
pagesToInfoFormat(pages)
|
|
1629
|
+
pagesToInfoFormat(pages),
|
|
1630
|
+
{ productionEnabled }
|
|
1619
1631
|
);
|
|
1620
1632
|
const siteInfo = {
|
|
1621
1633
|
domain: site.domain,
|
package/dist/cli.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
updateClaudeMd,
|
|
22
22
|
updateKodeDocs,
|
|
23
23
|
watchCommand
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-I7TVOZJR.js";
|
|
25
25
|
|
|
26
26
|
// src/cli.ts
|
|
27
27
|
import { Command } from "commander";
|
|
@@ -836,9 +836,10 @@ async function updateClaudeMdCommand() {
|
|
|
836
836
|
const spinner = ora5("Henter skript og sider...").start();
|
|
837
837
|
try {
|
|
838
838
|
const client = createApiClient(config);
|
|
839
|
-
const [scripts, pages] = await Promise.all([
|
|
839
|
+
const [scripts, pages, deployStatus] = await Promise.all([
|
|
840
840
|
client.listScripts(config.siteId),
|
|
841
|
-
client.listPages(config.siteId)
|
|
841
|
+
client.listPages(config.siteId),
|
|
842
|
+
client.getDeploymentStatus(config.siteId).catch(() => null)
|
|
842
843
|
]);
|
|
843
844
|
spinner.succeed(`Fant ${scripts.length} skript og ${pages.length} sider`);
|
|
844
845
|
const result = updateKodeDocs(
|
|
@@ -846,7 +847,8 @@ async function updateClaudeMdCommand() {
|
|
|
846
847
|
config.siteName,
|
|
847
848
|
config.siteSlug,
|
|
848
849
|
scriptsToDocsFormat(scripts, pages),
|
|
849
|
-
pagesToInfoFormat(pages)
|
|
850
|
+
pagesToInfoFormat(pages),
|
|
851
|
+
{ productionEnabled: deployStatus?.productionEnabled ?? false }
|
|
850
852
|
);
|
|
851
853
|
if (result.kodeMd.created) {
|
|
852
854
|
console.log(chalk6.green("\u2705 Opprettet .cure-kode/KODE.md"));
|
package/dist/index.js
CHANGED