@mandujs/core 0.54.12 β 0.54.14
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 +9 -1
- package/scripts/postinstall-lock.ts +153 -153
- package/src/a11y/run-audit.ts +15 -15
- package/src/agent/__tests__/context.test.ts +49 -1
- package/src/agent/context.ts +535 -535
- package/src/agent/index.ts +6 -6
- package/src/agent/plan.ts +282 -282
- package/src/agent/repair.ts +171 -171
- package/src/agent/sync.ts +200 -200
- package/src/agent/types.ts +8 -0
- package/src/agent/verify.ts +100 -2
- package/src/brain/doctor/analyzer.ts +7 -7
- package/src/bundler/__tests__/build-runner.ts +36 -16
- package/src/bundler/__tests__/cold-start.test.ts +60 -60
- package/src/bundler/__tests__/css.test.ts +20 -20
- package/src/bundler/__tests__/fast-refresh.test.ts +24 -17
- package/src/bundler/analyzer.ts +15 -15
- package/src/bundler/build.test.ts +136 -48
- package/src/bundler/build.ts +193 -122
- package/src/bundler/css.ts +42 -42
- package/src/bundler/manifest-schema.ts +21 -21
- package/src/bundler/plugins/__tests__/block-generated-imports.test.ts +13 -13
- package/src/bundler/plugins/block-generated-imports.ts +13 -13
- package/src/bundler/types.ts +31 -31
- package/src/client/island.ts +79 -79
- package/src/config/validate.ts +1 -1
- package/src/contract/schema.ts +7 -0
- package/src/deploy/inference/context.ts +82 -82
- package/src/devtools/client/components/panel/islands-panel.tsx +16 -16
- package/src/devtools/client/components/panel/panel-container.tsx +1 -1
- package/src/error/formatter.ts +10 -1
- package/src/experimental/index.ts +10 -0
- package/src/filling/context.ts +17 -17
- package/src/filling/filling.ts +22 -1
- package/src/filling/index.ts +15 -1
- package/src/generator/generate.ts +30 -30
- package/src/generator/index.ts +3 -3
- package/src/generator/templates.ts +210 -210
- package/src/guard/check.ts +9 -9
- package/src/guard/config-guard.ts +13 -13
- package/src/guard/fs-routes-policy.ts +51 -51
- package/src/guard/index.ts +11 -11
- package/src/index.ts +0 -10
- package/src/internal/index.ts +25 -0
- package/src/kitchen/api/file-api.ts +11 -11
- package/src/report/index.ts +1 -1
- package/src/resource/__tests__/generator.test.ts +6 -6
- package/src/resource/__tests__/schema.test.ts +14 -14
- package/src/resource/ddl/__tests__/emit.test.ts +165 -165
- package/src/resource/ddl/emit.ts +146 -146
- package/src/resource/generator-schema.ts +11 -11
- package/src/resource/generators/slot.ts +72 -72
- package/src/resource/schema.ts +21 -21
- package/src/router/client-entry.test.ts +84 -41
- package/src/router/client-entry.ts +156 -89
- package/src/router/fs-routes.test.ts +90 -0
- package/src/router/fs-routes.ts +37 -29
- package/src/router/fs-scanner.ts +81 -33
- package/src/router/fs-types.ts +8 -5
- package/src/runtime/__tests__/devtools-adapter.test.ts +68 -68
- package/src/runtime/__tests__/observability-lifecycle.test.ts +103 -103
- package/src/runtime/__tests__/page-render-response.test.ts +164 -103
- package/src/runtime/__tests__/request-middleware.test.ts +70 -70
- package/src/runtime/devtools-adapter.ts +68 -68
- package/src/runtime/escape.ts +34 -34
- package/src/runtime/image-feature.ts +15 -0
- package/src/runtime/observability-lifecycle.ts +290 -290
- package/src/runtime/page-render-response.ts +208 -106
- package/src/runtime/rate-limit.ts +231 -0
- package/src/runtime/request-middleware.ts +31 -31
- package/src/runtime/router.test.ts +4 -4
- package/src/runtime/router.ts +10 -12
- package/src/runtime/scheduler-lifecycle.ts +64 -0
- package/src/runtime/server.ts +148 -353
- package/src/runtime/ssr.ts +59 -59
- package/src/runtime/static-files.ts +289 -289
- package/src/runtime/streaming-ssr.ts +22 -22
- package/src/spec/schema.ts +4 -3
- package/src/watcher/__tests__/watcher.test.ts +59 -59
- package/src/watcher/watcher.ts +61 -61
|
@@ -187,19 +187,19 @@ export function formatConfigGuardResult(result: ConfigGuardResult): string {
|
|
|
187
187
|
} else if (!result.lockfileExists) {
|
|
188
188
|
lines.push("π‘ Lockfile μμ");
|
|
189
189
|
lines.push(" 'mandu lock'μΌλ‘ μμ± κΆμ₯");
|
|
190
|
-
} else {
|
|
191
|
-
lines.push("β μ€μ λ¬΄κ²°μ± κ²μ¦ μ€ν¨");
|
|
192
|
-
|
|
193
|
-
for (const error of result.errors) {
|
|
194
|
-
lines.push(` π΄ ${error.message}`);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
lines.push("");
|
|
198
|
-
lines.push(" λ€μ λ¨κ³:");
|
|
199
|
-
lines.push(" β³ λ³κ²½ νμΈ: mandu lock --diff");
|
|
200
|
-
lines.push(" β³ μλν λ³κ²½μ΄λ©΄: mandu lock");
|
|
201
|
-
lines.push(" β³ ν¨ν€μ§ μ
λ°μ΄νΈ μ§νλΌλ©΄ μ Mandu κΈ°λ³Έκ°μΌλ‘ lockfileμ κ°±μ νμΈμ.");
|
|
202
|
-
}
|
|
190
|
+
} else {
|
|
191
|
+
lines.push("β μ€μ λ¬΄κ²°μ± κ²μ¦ μ€ν¨");
|
|
192
|
+
|
|
193
|
+
for (const error of result.errors) {
|
|
194
|
+
lines.push(` π΄ ${error.message}`);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
lines.push("");
|
|
198
|
+
lines.push(" λ€μ λ¨κ³:");
|
|
199
|
+
lines.push(" β³ λ³κ²½ νμΈ: mandu lock --diff");
|
|
200
|
+
lines.push(" β³ μλν λ³κ²½μ΄λ©΄: mandu lock");
|
|
201
|
+
lines.push(" β³ ν¨ν€μ§ μ
λ°μ΄νΈ μ§νλΌλ©΄ μ Mandu κΈ°λ³Έκ°μΌλ‘ lockfileμ κ°±μ νμΈμ.");
|
|
202
|
+
}
|
|
203
203
|
|
|
204
204
|
if (result.warnings.length > 0 && result.lockfileExists) {
|
|
205
205
|
lines.push("");
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import type { FSRoutesGuardConfig } from "./types";
|
|
2
|
-
|
|
3
|
-
export const DEFAULT_FS_ROUTES_GUARD_POLICY: FSRoutesGuardConfig = {
|
|
4
|
-
noPageToPage: true,
|
|
5
|
-
pageCanImport: [
|
|
6
|
-
"client/pages",
|
|
7
|
-
"client/widgets",
|
|
8
|
-
"client/features",
|
|
9
|
-
"client/entities",
|
|
10
|
-
"client/shared",
|
|
11
|
-
"shared/contracts",
|
|
12
|
-
"shared/types",
|
|
13
|
-
"shared/utils/client",
|
|
14
|
-
],
|
|
15
|
-
layoutCanImport: [
|
|
16
|
-
"client/app",
|
|
17
|
-
"client/widgets",
|
|
18
|
-
"client/shared",
|
|
19
|
-
"shared/contracts",
|
|
20
|
-
"shared/types",
|
|
21
|
-
"shared/utils/client",
|
|
22
|
-
],
|
|
23
|
-
routeCanImport: [
|
|
24
|
-
"server/api",
|
|
25
|
-
"server/application",
|
|
26
|
-
"server/domain",
|
|
27
|
-
"server/infra",
|
|
28
|
-
"server/core",
|
|
29
|
-
"shared/contracts",
|
|
30
|
-
"shared/schema",
|
|
31
|
-
"shared/types",
|
|
32
|
-
"shared/utils/client",
|
|
33
|
-
"shared/utils/server",
|
|
34
|
-
"shared/env",
|
|
35
|
-
],
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
function clonePolicy(policy: FSRoutesGuardConfig): FSRoutesGuardConfig {
|
|
39
|
-
return {
|
|
40
|
-
noPageToPage: policy.noPageToPage,
|
|
41
|
-
pageCanImport: policy.pageCanImport ? [...policy.pageCanImport] : undefined,
|
|
42
|
-
layoutCanImport: policy.layoutCanImport ? [...policy.layoutCanImport] : undefined,
|
|
43
|
-
routeCanImport: policy.routeCanImport ? [...policy.routeCanImport] : undefined,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function getDefaultFsRoutesGuardPolicy(
|
|
48
|
-
enabled: boolean
|
|
49
|
-
): FSRoutesGuardConfig | undefined {
|
|
50
|
-
return enabled ? clonePolicy(DEFAULT_FS_ROUTES_GUARD_POLICY) : undefined;
|
|
51
|
-
}
|
|
1
|
+
import type { FSRoutesGuardConfig } from "./types";
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_FS_ROUTES_GUARD_POLICY: FSRoutesGuardConfig = {
|
|
4
|
+
noPageToPage: true,
|
|
5
|
+
pageCanImport: [
|
|
6
|
+
"client/pages",
|
|
7
|
+
"client/widgets",
|
|
8
|
+
"client/features",
|
|
9
|
+
"client/entities",
|
|
10
|
+
"client/shared",
|
|
11
|
+
"shared/contracts",
|
|
12
|
+
"shared/types",
|
|
13
|
+
"shared/utils/client",
|
|
14
|
+
],
|
|
15
|
+
layoutCanImport: [
|
|
16
|
+
"client/app",
|
|
17
|
+
"client/widgets",
|
|
18
|
+
"client/shared",
|
|
19
|
+
"shared/contracts",
|
|
20
|
+
"shared/types",
|
|
21
|
+
"shared/utils/client",
|
|
22
|
+
],
|
|
23
|
+
routeCanImport: [
|
|
24
|
+
"server/api",
|
|
25
|
+
"server/application",
|
|
26
|
+
"server/domain",
|
|
27
|
+
"server/infra",
|
|
28
|
+
"server/core",
|
|
29
|
+
"shared/contracts",
|
|
30
|
+
"shared/schema",
|
|
31
|
+
"shared/types",
|
|
32
|
+
"shared/utils/client",
|
|
33
|
+
"shared/utils/server",
|
|
34
|
+
"shared/env",
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function clonePolicy(policy: FSRoutesGuardConfig): FSRoutesGuardConfig {
|
|
39
|
+
return {
|
|
40
|
+
noPageToPage: policy.noPageToPage,
|
|
41
|
+
pageCanImport: policy.pageCanImport ? [...policy.pageCanImport] : undefined,
|
|
42
|
+
layoutCanImport: policy.layoutCanImport ? [...policy.layoutCanImport] : undefined,
|
|
43
|
+
routeCanImport: policy.routeCanImport ? [...policy.routeCanImport] : undefined,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function getDefaultFsRoutesGuardPolicy(
|
|
48
|
+
enabled: boolean
|
|
49
|
+
): FSRoutesGuardConfig | undefined {
|
|
50
|
+
return enabled ? clonePolicy(DEFAULT_FS_ROUTES_GUARD_POLICY) : undefined;
|
|
51
|
+
}
|
package/src/guard/index.ts
CHANGED
|
@@ -120,17 +120,17 @@ export {
|
|
|
120
120
|
// Architecture Guard - Watcher
|
|
121
121
|
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
122
122
|
|
|
123
|
-
export {
|
|
124
|
-
createGuardWatcher,
|
|
125
|
-
checkFile,
|
|
126
|
-
checkDirectory,
|
|
127
|
-
clearAnalysisCache,
|
|
128
|
-
} from "./watcher";
|
|
129
|
-
|
|
130
|
-
export {
|
|
131
|
-
DEFAULT_FS_ROUTES_GUARD_POLICY,
|
|
132
|
-
getDefaultFsRoutesGuardPolicy,
|
|
133
|
-
} from "./fs-routes-policy";
|
|
123
|
+
export {
|
|
124
|
+
createGuardWatcher,
|
|
125
|
+
checkFile,
|
|
126
|
+
checkDirectory,
|
|
127
|
+
clearAnalysisCache,
|
|
128
|
+
} from "./watcher";
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
DEFAULT_FS_ROUTES_GUARD_POLICY,
|
|
132
|
+
getDefaultFsRoutesGuardPolicy,
|
|
133
|
+
} from "./fs-routes-policy";
|
|
134
134
|
|
|
135
135
|
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
136
136
|
// Architecture Guard - Presets
|
package/src/index.ts
CHANGED
|
@@ -22,34 +22,24 @@ export const __MANDU_CORE_VERSION__: string = (() => {
|
|
|
22
22
|
})();
|
|
23
23
|
|
|
24
24
|
export * from "./spec";
|
|
25
|
-
export * from "./agent";
|
|
26
25
|
export * from "./runtime";
|
|
27
|
-
export * from "./generator";
|
|
28
26
|
export * from "./guard";
|
|
29
27
|
export * from "./report";
|
|
30
28
|
export * from "./filling";
|
|
31
|
-
export * from "./change";
|
|
32
29
|
export * from "./errors";
|
|
33
30
|
export * from "./logging";
|
|
34
31
|
export * from "./slot";
|
|
35
|
-
export * from "./bundler";
|
|
36
32
|
export * from "./contract";
|
|
37
33
|
export * from "./openapi";
|
|
38
|
-
export * from "./brain";
|
|
39
|
-
export * from "./watcher";
|
|
40
34
|
export * from "./router";
|
|
41
35
|
export * from "./config";
|
|
42
|
-
export * from "./lockfile";
|
|
43
36
|
export * from "./utils";
|
|
44
37
|
export * from "./seo";
|
|
45
38
|
export * from "./island";
|
|
46
39
|
export * from "./intent";
|
|
47
|
-
export * from "./devtools";
|
|
48
|
-
export * from "./paths";
|
|
49
40
|
export * from "./observability";
|
|
50
41
|
export * from "./resource";
|
|
51
42
|
export * from "./types";
|
|
52
|
-
export * from "./kitchen";
|
|
53
43
|
export { runHook } from "./plugins";
|
|
54
44
|
export type { ManduPlugin, ManduHooks } from "./plugins";
|
|
55
45
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * as bundler from "../bundler";
|
|
2
|
+
export * as change from "../change";
|
|
3
|
+
export * as generator from "../generator";
|
|
4
|
+
export * as lockfile from "../lockfile";
|
|
5
|
+
export * as paths from "../paths";
|
|
6
|
+
export * as report from "../report";
|
|
7
|
+
export * as spec from "../spec";
|
|
8
|
+
export * as utils from "../utils";
|
|
9
|
+
export * as watcher from "../watcher";
|
|
10
|
+
|
|
11
|
+
export * as runtimeCache from "../runtime/cache";
|
|
12
|
+
export * as runtimeRouter from "../runtime/router";
|
|
13
|
+
export * as runtimeServer from "../runtime/server";
|
|
14
|
+
export * as runtimeFastRefreshTypes from "../runtime/fast-refresh-types";
|
|
15
|
+
|
|
16
|
+
export * as resourceDdlDiff from "../resource/ddl/diff";
|
|
17
|
+
export * as resourceDdlEmit from "../resource/ddl/emit";
|
|
18
|
+
export * as resourceDdlSnapshot from "../resource/ddl/snapshot";
|
|
19
|
+
export * as resourceDdlTypeMap from "../resource/ddl/type-map";
|
|
20
|
+
export * as resourceDdlTypes from "../resource/ddl/types";
|
|
21
|
+
export * as resourceGeneratorRepo from "../resource/generator-repo";
|
|
22
|
+
|
|
23
|
+
export * as pluginRunner from "../plugins/runner";
|
|
24
|
+
export * as devErrorOverlay from "../dev-error-overlay";
|
|
25
|
+
export * as tsgolintBridge from "../guard/tsgolint-bridge";
|
|
@@ -229,17 +229,17 @@ export class FileAPI {
|
|
|
229
229
|
for (const line of stdout.split("\n")) {
|
|
230
230
|
if (!line.trim()) continue;
|
|
231
231
|
|
|
232
|
-
const statusCode = line.substring(0, 2);
|
|
233
|
-
const gitFilePath = line.substring(3).trim();
|
|
234
|
-
const filePath = this.getProjectRelativePath(gitFilePath, gitRoot);
|
|
235
|
-
if (!filePath || filePath === ".") {
|
|
236
|
-
continue;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
changes.push({
|
|
240
|
-
filePath,
|
|
241
|
-
status: parseGitStatus(statusCode),
|
|
242
|
-
});
|
|
232
|
+
const statusCode = line.substring(0, 2);
|
|
233
|
+
const gitFilePath = line.substring(3).trim();
|
|
234
|
+
const filePath = this.getProjectRelativePath(gitFilePath, gitRoot);
|
|
235
|
+
if (!filePath || filePath === ".") {
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
changes.push({
|
|
240
|
+
filePath,
|
|
241
|
+
status: parseGitStatus(statusCode),
|
|
242
|
+
});
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
return changes;
|
package/src/report/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./build";
|
|
1
|
+
export * from "./build";
|
|
@@ -671,12 +671,12 @@ describe("generateSchemaArtifacts β diff + migration orchestration", () => {
|
|
|
671
671
|
const result = await computeSchemaGeneration(resources, rootDir);
|
|
672
672
|
expect(result.changes.length).toBe(2);
|
|
673
673
|
expect(result.changes.every((c) => c.kind === "create-table")).toBe(true);
|
|
674
|
-
expect(result.migrationFilename).not.toBeNull();
|
|
675
|
-
expect(result.migrationSql).toContain("CREATE TABLE");
|
|
676
|
-
expect(result.migrationSql).not.toMatch(/\bBEGIN\b/i);
|
|
677
|
-
expect(result.migrationSql).not.toMatch(/\bCOMMIT\b/i);
|
|
678
|
-
expect(result.desiredSchema).toContain("CREATE TABLE");
|
|
679
|
-
expect(Object.keys(result.desiredSchemaByTable).sort()).toEqual(["products", "users"]);
|
|
674
|
+
expect(result.migrationFilename).not.toBeNull();
|
|
675
|
+
expect(result.migrationSql).toContain("CREATE TABLE");
|
|
676
|
+
expect(result.migrationSql).not.toMatch(/\bBEGIN\b/i);
|
|
677
|
+
expect(result.migrationSql).not.toMatch(/\bCOMMIT\b/i);
|
|
678
|
+
expect(result.desiredSchema).toContain("CREATE TABLE");
|
|
679
|
+
expect(Object.keys(result.desiredSchemaByTable).sort()).toEqual(["products", "users"]);
|
|
680
680
|
} finally {
|
|
681
681
|
await fs.rm(rootDir, { recursive: true, force: true });
|
|
682
682
|
}
|
|
@@ -108,20 +108,20 @@ describe("validateResourceDefinition", () => {
|
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
describe("getPluralName", () => {
|
|
111
|
-
test("should add 's' for simple pluralization", () => {
|
|
112
|
-
const result = getPluralName(userResourceFixture);
|
|
113
|
-
expect(result).toBe("users");
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
test("should use conservative English pluralization for common resource names", () => {
|
|
117
|
-
expect(getPluralName({ ...minimalResourceFixture, name: "party" })).toBe("parties");
|
|
118
|
-
expect(getPluralName({ ...minimalResourceFixture, name: "box" })).toBe("boxes");
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
test("should use custom plural name if provided", () => {
|
|
122
|
-
const result = getPluralName(productResourceFixture);
|
|
123
|
-
expect(result).toBe("inventory");
|
|
124
|
-
});
|
|
111
|
+
test("should add 's' for simple pluralization", () => {
|
|
112
|
+
const result = getPluralName(userResourceFixture);
|
|
113
|
+
expect(result).toBe("users");
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test("should use conservative English pluralization for common resource names", () => {
|
|
117
|
+
expect(getPluralName({ ...minimalResourceFixture, name: "party" })).toBe("parties");
|
|
118
|
+
expect(getPluralName({ ...minimalResourceFixture, name: "box" })).toBe("boxes");
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test("should use custom plural name if provided", () => {
|
|
122
|
+
const result = getPluralName(productResourceFixture);
|
|
123
|
+
expect(result).toBe("inventory");
|
|
124
|
+
});
|
|
125
125
|
|
|
126
126
|
test("should respect autoPlural: false", () => {
|
|
127
127
|
const definition = {
|