wormclaude 1.0.234 → 1.0.236

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.
@@ -4,7 +4,7 @@
4
4
  // puppeteer-core kullanır (Chromium İNDİRMEZ) → sistemde kurulu Chrome/Edge'i çalıştırır.
5
5
  import fs from 'node:fs';
6
6
  import path from 'node:path';
7
- import { pageFile, assetFile, relHref, ASSET_EXT, PAGE_EXT } from './clone.js';
7
+ import { pageFile, assetFile, relHref, mirrorRootAssets, ASSET_EXT, PAGE_EXT } from './clone.js';
8
8
  // Sistemde kurulu Chrome/Edge'i bul (puppeteer kendi Chromium'unu indirmesin)
9
9
  export function findChrome() {
10
10
  const win = [
@@ -177,5 +177,6 @@ export async function cloneSiteRendered(startUrl, outDir, opts = {}) {
177
177
  fs.mkdirSync(path.dirname(pg.file), { recursive: true });
178
178
  fs.writeFileSync(pg.file, html);
179
179
  }
180
+ mirrorRootAssets(root); // /_next/ vb. kök-mutlak yollar statik sunucuda çözülsün (SPA çalışsın)
180
181
  return { pages: rendered.length, assets: assetMap.size, outDir: root, pageFiles: rendered.map((p) => p.file), errors: errors.slice(0, 30) };
181
182
  }
package/dist/clone.js CHANGED
@@ -31,6 +31,34 @@ export function assetFile(u, assetsDir) {
31
31
  rel += '.bin';
32
32
  return path.join(assetsDir, rel);
33
33
  }
34
+ // Next.js/Nuxt/Vite/Astro SPA'ların JS RUNTIME'ı chunk'ları /_next/ gibi KÖK-MUTLAK yoldan yükler;
35
+ // statik HTML rewrite bunu düzeltemez (yol JS'in içinde). Kök-mutlak asset dizinlerini _assets/<host>/'tan
36
+ // klon KÖKÜNE aynala → statik sunucuda /_next/... kökten çözülür, SPA çalışır (yoksa "client-side exception").
37
+ export function mirrorRootAssets(root) {
38
+ const assetsDir = path.join(root, '_assets');
39
+ let hostDirs = [];
40
+ try {
41
+ hostDirs = fs.readdirSync(assetsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
42
+ }
43
+ catch {
44
+ return;
45
+ }
46
+ for (const dir of ['_next', '_nuxt', '_astro', 'assets']) {
47
+ const dst = path.join(root, dir);
48
+ if (fs.existsSync(dst))
49
+ continue;
50
+ for (const h of hostDirs) {
51
+ const src = path.join(assetsDir, h, dir);
52
+ try {
53
+ if (fs.existsSync(src) && fs.statSync(src).isDirectory()) {
54
+ fs.cpSync(src, dst, { recursive: true });
55
+ break;
56
+ }
57
+ }
58
+ catch { }
59
+ }
60
+ }
61
+ }
34
62
  export function relHref(fromFile, toFile) {
35
63
  let r = path.relative(path.dirname(fromFile), toFile).replace(/\\/g, '/');
36
64
  if (!r.startsWith('.'))
@@ -184,5 +212,6 @@ export async function cloneSite(startUrl, outDir, opts = {}) {
184
212
  fs.mkdirSync(path.dirname(pg.file), { recursive: true });
185
213
  fs.writeFileSync(pg.file, html);
186
214
  }
215
+ mirrorRootAssets(root); // /_next/ vb. kök-mutlak yollar statik sunucuda çözülsün (SPA çalışsın)
187
216
  return { pages: rawPages.length, assets: [...assetCache.values()].filter(Boolean).length, outDir: root, pageFiles: rawPages.map((p) => p.file), errors: errors.slice(0, 30) };
188
217
  }
package/dist/theme.js CHANGED
@@ -16,4 +16,4 @@ export const theme = {
16
16
  synType: '#a78bfa', // tip/sınıf adları, sabitler
17
17
  synProp: '#e0e0e0', // özellik/anahtar adları
18
18
  };
19
- export const VERSION = '1.0.234';
19
+ export const VERSION = '1.0.236';
package/dist/tools.js CHANGED
@@ -2062,7 +2062,8 @@ export async function executeTool(name, args) {
2062
2062
  const fmt = (r, mode) => {
2063
2063
  const lines = [
2064
2064
  `✓ Klon tamam (${mode}): ${r.pages} sayfa + ${r.assets} asset → ${r.outDir}`,
2065
- `Aç: ${path.join(r.outDir, 'index.html')} (tarayıcıda offline açılır, yollar yerele düzeltildi)`,
2065
+ `Çalıştır (önerilen, SPA/Next.js için güvenilir): cd "${r.outDir}" && python -m http.server 8000 → tarayıcıda http://localhost:8000`,
2066
+ `(Basit statik sitede index.html'i çift-tıklamak da yeterli; ama SPA/Next.js klonunda file:// altında alt-sayfa/asset yolları kırılabilir, o yüzden statik sunucu daha sağlam.)`,
2066
2067
  ];
2067
2068
  if (r.pageFiles.length)
2068
2069
  lines.push('Sayfalar: ' + r.pageFiles.slice(0, 12).map((f) => path.relative(r.outDir, f)).join(', ') + (r.pageFiles.length > 12 ? ` (+${r.pageFiles.length - 12})` : ''));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.234",
3
+ "version": "1.0.236",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {