@curenorway/kode-cli 1.0.4 → 1.1.1
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-RS5LGRLV.js → chunk-SQEIO2SM.js} +103 -21
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -358,22 +358,87 @@ function upsertPage(projectRoot, page, agent = "kode html") {
|
|
|
358
358
|
context.updatedBy = agent;
|
|
359
359
|
writeContext(projectRoot, context);
|
|
360
360
|
}
|
|
361
|
-
function generateClaudeMdMinimal(siteName) {
|
|
362
|
-
|
|
361
|
+
function generateClaudeMdMinimal(siteName, siteSlug) {
|
|
362
|
+
const slug = siteSlug || "your-site-slug";
|
|
363
|
+
return `## Cure Kode: ${siteName}
|
|
363
364
|
|
|
364
|
-
|
|
365
|
+
### What is Cure Kode?
|
|
365
366
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
367
|
+
Cure Kode is an **internal CDN tool by Cure Norway** for managing JavaScript/CSS on Webflow sites.
|
|
368
|
+
|
|
369
|
+
**IMPORTANT**: This is NOT a public product. Do NOT search the web for documentation - all info is here.
|
|
370
|
+
|
|
371
|
+
**How it works**:
|
|
372
|
+
1. Scripts live locally in the \`scripts/\` folder (or configured folder)
|
|
373
|
+
2. \`kode push\` uploads scripts to Cure's CDN at \`app.cure.no\`
|
|
374
|
+
3. \`kode deploy\` makes them live on staging or production
|
|
375
|
+
4. A single \`init.js\` script tag in Webflow loads all your scripts
|
|
376
|
+
|
|
377
|
+
### CDN URL
|
|
378
|
+
|
|
379
|
+
Add this to Webflow \u2192 Project Settings \u2192 Custom Code \u2192 Footer Code:
|
|
380
|
+
|
|
381
|
+
\`\`\`html
|
|
382
|
+
<script async src="https://app.cure.no/api/cdn/${slug}/init.js"></script>
|
|
383
|
+
\`\`\`
|
|
384
|
+
|
|
385
|
+
### Workflow
|
|
386
|
+
|
|
387
|
+
1. \`kode pull\` - Download latest scripts from remote
|
|
388
|
+
2. \`kode status\` - Check what's changed, see CDN URL
|
|
389
|
+
3. Edit scripts locally
|
|
390
|
+
4. \`kode push\` - Upload changes
|
|
391
|
+
5. \`kode deploy --env staging\` - Deploy to staging for testing
|
|
392
|
+
6. \`kode deploy --env production\` - Deploy to production when ready
|
|
393
|
+
|
|
394
|
+
### Commands
|
|
395
|
+
|
|
396
|
+
| Command | Description |
|
|
397
|
+
|---------|-------------|
|
|
398
|
+
| \`kode pull\` | Download scripts from remote |
|
|
399
|
+
| \`kode push\` | Upload local scripts |
|
|
400
|
+
| \`kode status\` | Show sync status and CDN URL |
|
|
401
|
+
| \`kode deploy --env staging\` | Deploy to staging |
|
|
402
|
+
| \`kode deploy --env production\` | Deploy to production |
|
|
403
|
+
| \`kode html <url> --save\` | Analyze and cache page HTML structure |
|
|
404
|
+
|
|
405
|
+
### Context
|
|
406
|
+
|
|
407
|
+
**Read \`.cure-kode/context.md\` before working on scripts** - it contains:
|
|
408
|
+
- Script inventory with purposes
|
|
409
|
+
- Cached page structures (sections, CTAs, forms)
|
|
410
|
+
- Notes from previous sessions
|
|
411
|
+
|
|
412
|
+
Update context.md after your session with discoveries and changes.
|
|
369
413
|
|
|
370
414
|
`;
|
|
371
415
|
}
|
|
372
|
-
function generateClaudeMd(siteName, scriptsDir = "scripts") {
|
|
416
|
+
function generateClaudeMd(siteName, scriptsDir = "scripts", siteSlug) {
|
|
417
|
+
const slug = siteSlug || "your-site-slug";
|
|
373
418
|
return `# Cure Kode Project: ${siteName}
|
|
374
419
|
|
|
375
420
|
> AI Agent Instructions for Webflow Script Management
|
|
376
421
|
|
|
422
|
+
## What is Cure Kode?
|
|
423
|
+
|
|
424
|
+
Cure Kode is an **internal CDN tool by Cure** for managing JavaScript/CSS on Webflow sites. It is NOT a public product - do not search the web for documentation.
|
|
425
|
+
|
|
426
|
+
**How it works:**
|
|
427
|
+
1. You write scripts locally in \`${scriptsDir}/\`
|
|
428
|
+
2. Push scripts to Cure's CDN via \`kode push\`
|
|
429
|
+
3. Deploy to staging or production via \`kode deploy\`
|
|
430
|
+
4. Scripts are served from \`https://app.cure.no/api/cdn/${slug}/init.js\`
|
|
431
|
+
|
|
432
|
+
## CDN URL (Add to Webflow)
|
|
433
|
+
|
|
434
|
+
Add this script tag to your Webflow site's **Custom Code** (Project Settings \u2192 Custom Code \u2192 Footer Code):
|
|
435
|
+
|
|
436
|
+
\`\`\`html
|
|
437
|
+
<script async src="https://app.cure.no/api/cdn/${slug}/init.js"></script>
|
|
438
|
+
\`\`\`
|
|
439
|
+
|
|
440
|
+
**Important**: Use \`async\` for best PageSpeed scores. The init.js automatically loads all your scripts.
|
|
441
|
+
|
|
377
442
|
## Commands
|
|
378
443
|
|
|
379
444
|
| Command | Description |
|
|
@@ -383,7 +448,7 @@ function generateClaudeMd(siteName, scriptsDir = "scripts") {
|
|
|
383
448
|
| \`kode watch\` | Auto-sync on file changes |
|
|
384
449
|
| \`kode deploy --env staging\` | Deploy to staging |
|
|
385
450
|
| \`kode deploy --env production\` | Deploy to production |
|
|
386
|
-
| \`kode status\` | Show sync status |
|
|
451
|
+
| \`kode status\` | Show sync status and CDN URLs |
|
|
387
452
|
| \`kode html <url>\` | Analyze page HTML |
|
|
388
453
|
| \`kode html <url> --save\` | Analyze and cache page structure |
|
|
389
454
|
| \`kode pages\` | List cached page contexts |
|
|
@@ -402,6 +467,18 @@ ${scriptsDir}/
|
|
|
402
467
|
\u2514\u2500\u2500 (your scripts)
|
|
403
468
|
\`\`\`
|
|
404
469
|
|
|
470
|
+
## Workflow
|
|
471
|
+
|
|
472
|
+
1. **Pull latest**: \`kode pull\`
|
|
473
|
+
2. **Read context**: Check \`.cure-kode/context.md\` for project state
|
|
474
|
+
3. **Analyze pages**: \`kode html <url> --save\` to understand HTML structure
|
|
475
|
+
4. **Write scripts**: Edit files in \`${scriptsDir}/\`
|
|
476
|
+
5. **Push changes**: \`kode push\`
|
|
477
|
+
6. **Deploy staging**: \`kode deploy --env staging\`
|
|
478
|
+
7. **Test**: Verify on staging domain
|
|
479
|
+
8. **Deploy production**: \`kode deploy --env production\`
|
|
480
|
+
9. **Update context**: Record session in context.md
|
|
481
|
+
|
|
405
482
|
## Dynamic Context
|
|
406
483
|
|
|
407
484
|
**IMPORTANT**: Read \`.cure-kode/context.md\` before starting work.
|
|
@@ -430,17 +507,6 @@ Page context includes:
|
|
|
430
507
|
- **Forms**: Form fields, labels, and submit buttons
|
|
431
508
|
- **CMS**: Collection patterns with item counts
|
|
432
509
|
|
|
433
|
-
## Workflow
|
|
434
|
-
|
|
435
|
-
1. \`kode pull\` to get latest scripts
|
|
436
|
-
2. Read \`.cure-kode/context.md\` for project state
|
|
437
|
-
3. If working on specific page: \`kode html <url> --save\`
|
|
438
|
-
4. Make changes to scripts in \`${scriptsDir}/\`
|
|
439
|
-
5. \`kode push\` to upload
|
|
440
|
-
6. \`kode deploy --env staging\` to test
|
|
441
|
-
7. Update context.md with session notes
|
|
442
|
-
8. \`kode deploy --env production\` when ready
|
|
443
|
-
|
|
444
510
|
## Best Practices
|
|
445
511
|
|
|
446
512
|
1. **Always deploy to staging first** - Test before production
|
|
@@ -590,8 +656,8 @@ config.json
|
|
|
590
656
|
} catch {
|
|
591
657
|
}
|
|
592
658
|
const claudeMdPath = join3(cwd, "CLAUDE.md");
|
|
593
|
-
const claudeMdContentFull = generateClaudeMd(config.siteName, config.scriptsDir || "scripts");
|
|
594
|
-
const claudeMdContentMinimal = generateClaudeMdMinimal(config.siteName);
|
|
659
|
+
const claudeMdContentFull = generateClaudeMd(config.siteName, config.scriptsDir || "scripts", config.siteSlug);
|
|
660
|
+
const claudeMdContentMinimal = generateClaudeMdMinimal(config.siteName, config.siteSlug);
|
|
595
661
|
let claudeMdAction = "created";
|
|
596
662
|
if (existsSync3(claudeMdPath)) {
|
|
597
663
|
spinner.stop();
|
|
@@ -1174,6 +1240,9 @@ async function deployCommand(environment, options) {
|
|
|
1174
1240
|
console.log(chalk5.dim(` Version: ${deployment.version}`));
|
|
1175
1241
|
console.log(chalk5.dim(` Status: ${deployment.status}`));
|
|
1176
1242
|
console.log();
|
|
1243
|
+
console.log(chalk5.bold("CDN URL:"));
|
|
1244
|
+
console.log(chalk5.cyan(` https://app.cure.no/api/cdn/${config.siteSlug}/init.js`));
|
|
1245
|
+
console.log();
|
|
1177
1246
|
console.log(chalk5.green("\u2705 Production is now running the latest staging version!"));
|
|
1178
1247
|
} catch (error) {
|
|
1179
1248
|
spinner2.fail("Promotion failed");
|
|
@@ -1192,10 +1261,16 @@ async function deployCommand(environment, options) {
|
|
|
1192
1261
|
console.log(chalk5.dim(` Status: ${deployment.status}`));
|
|
1193
1262
|
console.log(chalk5.dim(` Started: ${new Date(deployment.started_at).toLocaleString("nb-NO")}`));
|
|
1194
1263
|
console.log();
|
|
1264
|
+
console.log(chalk5.bold("CDN URL:"));
|
|
1265
|
+
console.log(chalk5.cyan(` https://app.cure.no/api/cdn/${config.siteSlug}/init.js`));
|
|
1266
|
+
console.log();
|
|
1195
1267
|
if (env === "staging") {
|
|
1196
1268
|
console.log(chalk5.cyan('\u{1F4A1} Tip: Use "kode deploy production" or "kode deploy --promote" to go live.'));
|
|
1197
1269
|
} else {
|
|
1198
1270
|
console.log(chalk5.green("\u2705 Changes are now live!"));
|
|
1271
|
+
console.log();
|
|
1272
|
+
console.log(chalk5.dim("Make sure this script tag is in your Webflow site:"));
|
|
1273
|
+
console.log(chalk5.dim(`<script async src="https://app.cure.no/api/cdn/${config.siteSlug}/init.js"></script>`));
|
|
1199
1274
|
}
|
|
1200
1275
|
} catch (error) {
|
|
1201
1276
|
spinner.fail("Deployment failed");
|
|
@@ -1566,6 +1641,13 @@ async function statusCommand(options) {
|
|
|
1566
1641
|
console.log(chalk7.dim(` Slug: ${config.siteSlug}`));
|
|
1567
1642
|
console.log(chalk7.dim(` ID: ${config.siteId}`));
|
|
1568
1643
|
console.log();
|
|
1644
|
+
console.log(chalk7.bold("CDN URL"));
|
|
1645
|
+
console.log();
|
|
1646
|
+
console.log(chalk7.cyan(` https://app.cure.no/api/cdn/${config.siteSlug}/init.js`));
|
|
1647
|
+
console.log();
|
|
1648
|
+
console.log(chalk7.dim(" Add to Webflow \u2192 Project Settings \u2192 Custom Code \u2192 Footer:"));
|
|
1649
|
+
console.log(chalk7.dim(` <script async src="https://app.cure.no/api/cdn/${config.siteSlug}/init.js"></script>`));
|
|
1650
|
+
console.log();
|
|
1569
1651
|
const spinner = ora6("Fetching status...").start();
|
|
1570
1652
|
try {
|
|
1571
1653
|
const client = createApiClient(config);
|
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -308,6 +308,6 @@ declare function generateInitialContext(config: ProjectConfig, scripts: CdnScrip
|
|
|
308
308
|
/**
|
|
309
309
|
* Generate full CLAUDE.md content for new projects
|
|
310
310
|
*/
|
|
311
|
-
declare function generateClaudeMd(siteName: string, scriptsDir?: string): string;
|
|
311
|
+
declare function generateClaudeMd(siteName: string, scriptsDir?: string, siteSlug?: string): string;
|
|
312
312
|
|
|
313
313
|
export { type CdnDeployment, type CdnPage, type CdnScript, type CdnSite, KodeApiClient, KodeApiError, type KodeContext, type KodeScriptContext, type KodeSession, type ParsedHtmlResult, type ProjectConfig, addSession, appendNote, contextCommand, createApiClient, deployCommand, findProjectRoot, generateClaudeMd, generateInitialContext, getApiKey, getApiUrl, getContextPath, getProjectConfig, getScriptsDir, htmlCommand, initCommand, parseContext, pullCommand, pushCommand, readContext, saveProjectConfig, serializeContext, setGlobalConfig, statusCommand, updateScriptPurpose, watchCommand, writeContext };
|
package/dist/index.js
CHANGED