@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.
- package/package.json +38 -2
- package/src/a11y/run-audit.ts +6 -6
- package/src/brain/adapters/oauth-flow.ts +1 -1
- package/src/brain/architecture/analyzer.ts +0 -2
- package/src/brain/credentials.ts +2 -2
- package/src/bundler/__tests__/build-runner.ts +13 -1
- package/src/bundler/__tests__/extended-watch.test.ts +3 -2
- package/src/bundler/__tests__/fast-refresh.test.ts +10 -12
- package/src/bundler/build.test.ts +30 -33
- package/src/bundler/build.ts +2 -1
- package/src/bundler/dev.ts +23 -22
- package/src/bundler/prerender.ts +63 -0
- package/src/bundler/safe-build.test.ts +2 -1
- package/src/bundler/types.ts +5 -3
- package/src/change/history.ts +1 -1
- package/src/change/snapshot.ts +18 -9
- package/src/client/Link.tsx +9 -9
- package/src/client/globals.ts +3 -2
- package/src/client/hooks.ts +0 -4
- package/src/client/hydrate.ts +1 -1
- package/src/client/router.ts +12 -12
- package/src/client/rpc.ts +1 -1
- package/src/client/use-fetch.ts +6 -6
- package/src/client/use-sse.ts +5 -5
- package/src/config/mcp-status.ts +0 -1
- package/src/config/validate.ts +1 -1
- package/src/config/watcher.ts +1 -1
- package/src/content/collection.ts +8 -12
- package/src/content/content-layer.ts +5 -5
- package/src/content/data-store.ts +2 -2
- package/src/content/loader-context.ts +0 -1
- package/src/content/loaders/file.ts +1 -1
- package/src/content/loaders/glob.ts +4 -4
- package/src/content/loaders/types.ts +1 -1
- package/src/content/meta-store.ts +1 -1
- package/src/content/types.ts +1 -1
- package/src/contract/define.ts +11 -12
- package/src/contract/index.ts +3 -3
- package/src/contract/protection.ts +2 -2
- package/src/contract/types.ts +1 -1
- package/src/contract/validator.ts +0 -1
- package/src/db/__tests__/db.test.ts +4 -7
- package/src/db/migrations/index.ts +3 -0
- package/src/db/migrations/lock.ts +11 -11
- package/src/deploy/cache.ts +1 -0
- package/src/design/__tests__/agents-link.test.ts +109 -0
- package/src/design/__tests__/lint.test.ts +110 -0
- package/src/design/agents-link.ts +165 -0
- package/src/design/extract.ts +2 -1
- package/src/design/index.ts +16 -0
- package/src/design/lint.ts +209 -0
- package/src/design/patch.ts +0 -1
- package/src/devtools/ai/mcp-connector.ts +24 -24
- package/src/devtools/client/components/kitchen-root.tsx +1 -1
- package/src/devtools/client/components/panel/errors-panel.tsx +1 -1
- package/src/devtools/client/state-manager.ts +1 -1
- package/src/devtools/init.ts +2 -3
- package/src/devtools/server/source-context.ts +1 -1
- package/src/devtools/worker/redaction-worker.ts +8 -4
- package/src/devtools/worker/worker-manager.ts +4 -3
- package/src/error/classifier.ts +1 -1
- package/src/error/domains.ts +1 -1
- package/src/filling/sse.ts +5 -5
- package/src/generator/generate.ts +2 -2
- package/src/guard/analyzer.ts +1 -1
- package/src/guard/ast-analyzer.ts +7 -7
- package/src/guard/auto-correct.ts +2 -2
- package/src/guard/config-guard.ts +0 -2
- package/src/guard/contract-guard.ts +1 -1
- package/src/guard/decision-memory.ts +2 -2
- package/src/guard/design-inline-class.ts +2 -1
- package/src/guard/graph.ts +1 -1
- package/src/guard/healing.ts +36 -41
- package/src/guard/negotiation.ts +3 -3
- package/src/guard/reporter.ts +1 -4
- package/src/guard/semantic-slots.ts +2 -2
- package/src/guard/suggestions.ts +2 -2
- package/src/guard/watcher.ts +5 -4
- package/src/index.ts +5 -5
- package/src/intent/index.ts +1 -1
- package/src/kitchen/api/contract-api.ts +1 -1
- package/src/kitchen/api/file-api.ts +3 -3
- package/src/kitchen/kitchen-handler.ts +29 -21
- package/src/lockfile/validate.ts +0 -1
- package/src/openapi/generator.ts +2 -1
- package/src/openapi/openapi.test.ts +43 -14
- package/src/perf/user-marks.ts +1 -1
- package/src/plugins/registry.ts +1 -2
- package/src/plugins/types.ts +1 -1
- package/src/resource/ddl/diff.ts +0 -1
- package/src/resource/generator.ts +1 -1
- package/src/resource/generators/contract.ts +1 -1
- package/src/resource/schema.ts +2 -1
- package/src/router/fs-routes.ts +6 -6
- package/src/router/fs-scanner.ts +1 -1
- package/src/runtime/env.ts +1 -1
- package/src/runtime/image-handler.ts +2 -1
- package/src/runtime/middleware.ts +2 -1
- package/src/runtime/server.ts +67 -60
- package/src/runtime/ssr.ts +3 -3
- package/src/runtime/streaming-ssr.ts +25 -27
- package/src/scheduler/validate.ts +1 -1
- package/src/seo/integration/ssr.ts +2 -3
- package/src/seo/render/opengraph.ts +1 -1
- package/src/seo/resolve/index.ts +0 -4
- package/src/slot/corrector.ts +1 -1
- package/src/slot/validator.ts +4 -4
- package/src/watcher/reporter.ts +1 -1
- 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
|
|
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 || ''
|
package/src/seo/resolve/index.ts
CHANGED
|
@@ -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'
|
package/src/slot/corrector.ts
CHANGED
|
@@ -111,7 +111,7 @@ function fixForbiddenImport(
|
|
|
111
111
|
|
|
112
112
|
// 어떤 금지된 모듈인지 찾기
|
|
113
113
|
let forbiddenModule = "";
|
|
114
|
-
for (const [module,
|
|
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;
|
package/src/slot/validator.ts
CHANGED
|
@@ -125,14 +125,14 @@ function stripComments(content: string): string {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
// 올바른 응답 패턴 (ctx 메서드 호출)
|
|
128
|
-
const
|
|
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
|
|
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,
|
|
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
|
|
407
|
+
const _throwStringPattern = /throw\s+['"`][^'"`]+['"`]/;
|
|
408
408
|
|
|
409
409
|
if (isObjectReturn) {
|
|
410
410
|
// return 문이 있는 라인 번호 찾기
|
package/src/watcher/reporter.ts
CHANGED
package/src/watcher/watcher.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
WatchWarning,
|
|
11
11
|
WatchEventHandler,
|
|
12
12
|
} from "../brain/types";
|
|
13
|
-
import { validateFile
|
|
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();
|