@mandujs/core 0.52.0 → 0.53.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.
Files changed (109) hide show
  1. package/package.json +38 -2
  2. package/src/a11y/run-audit.ts +6 -6
  3. package/src/brain/adapters/oauth-flow.ts +1 -1
  4. package/src/brain/architecture/analyzer.ts +0 -2
  5. package/src/brain/credentials.ts +2 -2
  6. package/src/bundler/__tests__/build-runner.ts +13 -1
  7. package/src/bundler/__tests__/extended-watch.test.ts +3 -2
  8. package/src/bundler/__tests__/fast-refresh.test.ts +10 -12
  9. package/src/bundler/build.test.ts +30 -33
  10. package/src/bundler/build.ts +2 -1
  11. package/src/bundler/dev.ts +23 -22
  12. package/src/bundler/prerender.ts +63 -0
  13. package/src/bundler/safe-build.test.ts +2 -1
  14. package/src/bundler/types.ts +5 -3
  15. package/src/change/history.ts +1 -1
  16. package/src/change/snapshot.ts +18 -9
  17. package/src/client/Link.tsx +9 -9
  18. package/src/client/globals.ts +3 -2
  19. package/src/client/hooks.ts +0 -4
  20. package/src/client/hydrate.ts +1 -1
  21. package/src/client/router.ts +12 -12
  22. package/src/client/rpc.ts +1 -1
  23. package/src/client/use-fetch.ts +6 -6
  24. package/src/client/use-sse.ts +5 -5
  25. package/src/config/mcp-status.ts +0 -1
  26. package/src/config/validate.ts +1 -1
  27. package/src/config/watcher.ts +1 -1
  28. package/src/content/collection.ts +8 -12
  29. package/src/content/content-layer.ts +5 -5
  30. package/src/content/data-store.ts +2 -2
  31. package/src/content/loader-context.ts +0 -1
  32. package/src/content/loaders/file.ts +1 -1
  33. package/src/content/loaders/glob.ts +4 -4
  34. package/src/content/loaders/types.ts +1 -1
  35. package/src/content/meta-store.ts +1 -1
  36. package/src/content/types.ts +1 -1
  37. package/src/contract/define.ts +11 -12
  38. package/src/contract/index.ts +3 -3
  39. package/src/contract/protection.ts +2 -2
  40. package/src/contract/types.ts +1 -1
  41. package/src/contract/validator.ts +0 -1
  42. package/src/db/__tests__/db.test.ts +4 -7
  43. package/src/db/migrations/index.ts +3 -0
  44. package/src/db/migrations/lock.ts +11 -11
  45. package/src/deploy/cache.ts +1 -0
  46. package/src/design/__tests__/agents-link.test.ts +109 -0
  47. package/src/design/__tests__/lint.test.ts +110 -0
  48. package/src/design/agents-link.ts +165 -0
  49. package/src/design/extract.ts +2 -1
  50. package/src/design/index.ts +16 -0
  51. package/src/design/lint.ts +209 -0
  52. package/src/design/patch.ts +0 -1
  53. package/src/devtools/ai/mcp-connector.ts +24 -24
  54. package/src/devtools/client/components/kitchen-root.tsx +1 -1
  55. package/src/devtools/client/components/panel/errors-panel.tsx +1 -1
  56. package/src/devtools/client/state-manager.ts +1 -1
  57. package/src/devtools/init.ts +2 -3
  58. package/src/devtools/server/source-context.ts +1 -1
  59. package/src/devtools/worker/redaction-worker.ts +8 -4
  60. package/src/devtools/worker/worker-manager.ts +4 -3
  61. package/src/error/classifier.ts +1 -1
  62. package/src/error/domains.ts +1 -1
  63. package/src/filling/sse.ts +5 -5
  64. package/src/generator/generate.ts +2 -2
  65. package/src/guard/analyzer.ts +1 -1
  66. package/src/guard/ast-analyzer.ts +7 -7
  67. package/src/guard/auto-correct.ts +2 -2
  68. package/src/guard/config-guard.ts +0 -2
  69. package/src/guard/contract-guard.ts +1 -1
  70. package/src/guard/decision-memory.ts +2 -2
  71. package/src/guard/design-inline-class.ts +2 -1
  72. package/src/guard/graph.ts +1 -1
  73. package/src/guard/healing.ts +36 -41
  74. package/src/guard/negotiation.ts +3 -3
  75. package/src/guard/reporter.ts +1 -4
  76. package/src/guard/semantic-slots.ts +2 -2
  77. package/src/guard/suggestions.ts +2 -2
  78. package/src/guard/watcher.ts +5 -4
  79. package/src/index.ts +5 -5
  80. package/src/intent/index.ts +1 -1
  81. package/src/kitchen/api/contract-api.ts +1 -1
  82. package/src/kitchen/api/file-api.ts +3 -3
  83. package/src/kitchen/kitchen-handler.ts +29 -21
  84. package/src/lockfile/validate.ts +0 -1
  85. package/src/openapi/generator.ts +2 -1
  86. package/src/openapi/openapi.test.ts +43 -14
  87. package/src/perf/user-marks.ts +1 -1
  88. package/src/plugins/registry.ts +1 -2
  89. package/src/plugins/types.ts +1 -1
  90. package/src/resource/ddl/diff.ts +0 -1
  91. package/src/resource/generator.ts +1 -1
  92. package/src/resource/generators/contract.ts +1 -1
  93. package/src/resource/schema.ts +2 -1
  94. package/src/router/fs-routes.ts +6 -6
  95. package/src/router/fs-scanner.ts +1 -1
  96. package/src/runtime/env.ts +1 -1
  97. package/src/runtime/image-handler.ts +2 -1
  98. package/src/runtime/middleware.ts +2 -1
  99. package/src/runtime/server.ts +67 -60
  100. package/src/runtime/ssr.ts +3 -3
  101. package/src/runtime/streaming-ssr.ts +25 -27
  102. package/src/scheduler/validate.ts +1 -1
  103. package/src/seo/integration/ssr.ts +2 -3
  104. package/src/seo/render/opengraph.ts +1 -1
  105. package/src/seo/resolve/index.ts +0 -4
  106. package/src/slot/corrector.ts +1 -1
  107. package/src/slot/validator.ts +4 -4
  108. package/src/watcher/reporter.ts +1 -1
  109. package/src/watcher/watcher.ts +19 -19
@@ -27,7 +27,6 @@
27
27
  * ```
28
28
  */
29
29
 
30
- import type { ReactElement } from 'react'
31
30
  import type { Metadata, MetadataItem, ResolvedMetadata } from '../types'
32
31
  import { resolveMetadata, createDefaultMetadata } from '../resolve'
33
32
  import { renderMetadata } from '../render'
@@ -88,7 +87,7 @@ export async function resolveSEO(options: SEOOptions = {}): Promise<SEOResult> {
88
87
  resolved = await resolveMetadata(metadata, routeParams, searchParams)
89
88
  } else if (staticMetadata) {
90
89
  // 단일 정적 메타데이터
91
- const base = createDefaultMetadata()
90
+ const _base = createDefaultMetadata()
92
91
  resolved = await resolveMetadata([staticMetadata], routeParams, searchParams)
93
92
  } else {
94
93
  // 기본 메타데이터
@@ -186,7 +185,7 @@ export async function injectSEOIntoOptions<T extends { title?: string; headTags?
186
185
  options: T,
187
186
  seoOptions: SEOOptions
188
187
  ): Promise<T & { title: string; headTags: string }> {
189
- const { resolved, html, title } = await resolveSEO(seoOptions)
188
+ const { resolved: _resolved, html, title } = await resolveSEO(seoOptions)
190
189
 
191
190
  // 기존 headTags와 병합
192
191
  const existingHeadTags = options.headTags || ''
@@ -2,7 +2,7 @@
2
2
  * Mandu SEO - Open Graph Meta Tags Rendering
3
3
  */
4
4
 
5
- import type { ResolvedMetadata, ResolvedOpenGraph } from '../types'
5
+ import type { ResolvedMetadata } from '../types'
6
6
  import { urlToString } from '../resolve/url'
7
7
 
8
8
  /**
@@ -17,10 +17,6 @@ import type {
17
17
  ResolvedVerification,
18
18
  JsonLd,
19
19
  ThemeColor,
20
- ResourceHint,
21
- FormatDetection,
22
- GoogleMeta,
23
- AppLinks,
24
20
  } from '../types'
25
21
  import { resolveTitle, extractTitleTemplate } from './title'
26
22
  import { normalizeMetadataBase, resolveUrl } from './url'
@@ -111,7 +111,7 @@ function fixForbiddenImport(
111
111
 
112
112
  // 어떤 금지된 모듈인지 찾기
113
113
  let forbiddenModule = "";
114
- for (const [module, alternative] of Object.entries(SAFE_ALTERNATIVES)) {
114
+ for (const [module, _alternative] of Object.entries(SAFE_ALTERNATIVES)) {
115
115
  if (originalLine.includes(`'${module}'`) || originalLine.includes(`"${module}"`)) {
116
116
  forbiddenModule = module;
117
117
  break;
@@ -125,14 +125,14 @@ function stripComments(content: string): string {
125
125
  }
126
126
 
127
127
  // 올바른 응답 패턴 (ctx 메서드 호출)
128
- const VALID_RESPONSE_PATTERNS = [
128
+ const _VALID_RESPONSE_PATTERNS = [
129
129
  /return\s+ctx\s*\.\s*(ok|json|created|noContent|notFound|badRequest|error|html|redirect|stream)\s*\(/,
130
130
  /return\s+new\s+Response\s*\(/,
131
131
  /return\s+Response\s*\.\s*(json|redirect)\s*\(/,
132
132
  ];
133
133
 
134
134
  // 잘못된 반환 패턴 (일반 객체 직접 반환)
135
- const INVALID_RETURN_PATTERNS = [
135
+ const _INVALID_RETURN_PATTERNS = [
136
136
  /return\s+\{\s*[^}]*\}\s*;?\s*$/m, // return { ... }; (Response가 아닌 객체)
137
137
  ];
138
138
 
@@ -337,7 +337,7 @@ function checkBasicSyntax(
337
337
  /**
338
338
  * HTTP 메서드 핸들러 검사
339
339
  */
340
- function checkHttpMethods(content: string, lines: string[]): SlotValidationIssue[] {
340
+ function checkHttpMethods(content: string, _lines: string[]): SlotValidationIssue[] {
341
341
  const issues: SlotValidationIssue[] = [];
342
342
 
343
343
  // .get(), .post() 등의 핸들러가 있는지 확인
@@ -404,7 +404,7 @@ function checkHandlerReturns(content: string, lines: string[]): SlotValidationIs
404
404
  const isStringReturn = /return\s+['"`]/.test(returnStmt) && !isValidReturn;
405
405
 
406
406
  // throw 문자열 감지 (Error 객체가 아닌 문자열)
407
- const throwStringPattern = /throw\s+['"`][^'"`]+['"`]/;
407
+ const _throwStringPattern = /throw\s+['"`][^'"`]+['"`]/;
408
408
 
409
409
  if (isObjectReturn) {
410
410
  // return 문이 있는 라인 번호 찾기
@@ -5,7 +5,7 @@
5
5
  * Warnings only - never blocks operations.
6
6
  */
7
7
 
8
- import type { WatchWarning, WatchStatus, ArchRule } from "../brain/types";
8
+ import type { WatchWarning, WatchStatus } from "../brain/types";
9
9
  import { getRule } from "./rules";
10
10
 
11
11
  /**
@@ -10,7 +10,7 @@ import type {
10
10
  WatchWarning,
11
11
  WatchEventHandler,
12
12
  } from "../brain/types";
13
- import { validateFile, MVP_RULES } from "./rules";
13
+ import { validateFile } from "./rules";
14
14
  import path from "path";
15
15
  import fs from "fs";
16
16
  import { spawn, type ChildProcess } from "child_process";
@@ -156,20 +156,20 @@ export class FileWatcher {
156
156
  this._fileCount = count;
157
157
  });
158
158
 
159
- // Handle events (v5 passes absolute paths when watching absolute rootDir)
160
- this.chokidarWatcher.on("change", (filePath) => {
161
- this.processFileEvent("modify", filePath);
162
- });
163
-
164
- this.chokidarWatcher.on("add", (filePath) => {
165
- this._fileCount++;
166
- this.processFileEvent("create", filePath);
167
- });
168
-
169
- this.chokidarWatcher.on("unlink", (filePath) => {
170
- this._fileCount = Math.max(0, this._fileCount - 1);
171
- this.processFileEvent("delete", filePath);
172
- });
159
+ // Handle events (v5 passes absolute paths when watching absolute rootDir)
160
+ this.chokidarWatcher.on("change", (filePath) => {
161
+ void this.processFileEvent("modify", filePath);
162
+ });
163
+
164
+ this.chokidarWatcher.on("add", (filePath) => {
165
+ this._fileCount++;
166
+ void this.processFileEvent("create", filePath);
167
+ });
168
+
169
+ this.chokidarWatcher.on("unlink", (filePath) => {
170
+ this._fileCount = Math.max(0, this._fileCount - 1);
171
+ void this.processFileEvent("delete", filePath);
172
+ });
173
173
 
174
174
  this.chokidarWatcher.on("error", (error: unknown) => {
175
175
  const message = error instanceof Error ? error.message : String(error);
@@ -406,10 +406,10 @@ export function getWatcher(config?: WatcherConfig): FileWatcher | null {
406
406
  /**
407
407
  * Start the global watcher
408
408
  */
409
- export async function startWatcher(config: WatcherConfig): Promise<FileWatcher> {
410
- if (globalWatcher) {
411
- globalWatcher.stop();
412
- }
409
+ export async function startWatcher(config: WatcherConfig): Promise<FileWatcher> {
410
+ if (globalWatcher) {
411
+ await globalWatcher.stop();
412
+ }
413
413
 
414
414
  globalWatcher = createWatcher(config);
415
415
  await globalWatcher.start();