@ecopages/core 0.2.0-beta.27 → 0.2.0-beta.29
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/README.md +1 -1
- package/package.json +42 -26
- package/src/adapters/abstract/application-adapter.d.ts +22 -4
- package/src/adapters/abstract/application-adapter.js +27 -4
- package/src/adapters/abstract/server-adapter.d.ts +10 -0
- package/src/adapters/bun/create-app.d.ts +1 -0
- package/src/adapters/bun/create-app.js +11 -4
- package/src/adapters/bun/server-adapter.js +1 -0
- package/src/adapters/node/create-app.d.ts +1 -0
- package/src/adapters/node/create-app.js +10 -3
- package/src/adapters/node/server-adapter.js +1 -0
- package/src/adapters/shared/fs-server-response-factory.d.ts +5 -0
- package/src/adapters/shared/fs-server-response-factory.js +20 -0
- package/src/adapters/shared/fs-server-response-matcher.d.ts +18 -0
- package/src/adapters/shared/fs-server-response-matcher.js +75 -15
- package/src/config/config-builder.d.ts +12 -2
- package/src/config/config-builder.js +41 -2
- package/src/config/constants.d.ts +1 -0
- package/src/config/constants.js +2 -1
- package/src/eco/eco.js +2 -2
- package/src/eco/eco.utils.d.ts +1 -1
- package/src/eco/eco.utils.js +1 -1
- package/src/hmr/client/hmr-runtime.js +1 -1
- package/src/hmr/hmr-file-change-prep.d.ts +1 -1
- package/src/hmr/hmr-file-change-prep.js +1 -1
- package/src/plugins/processor.d.ts +8 -0
- package/src/route-renderer/GRAPH.md +11 -11
- package/src/route-renderer/README.md +11 -6
- package/src/route-renderer/orchestration/{document-shell-render.service.d.ts → document-shell/document-shell-render.service.d.ts} +19 -2
- package/src/route-renderer/orchestration/{document-shell-render.service.js → document-shell/document-shell-render.service.js} +28 -0
- package/src/route-renderer/orchestration/{layout-shell-props.service.d.ts → document-shell/layout-shell-props.service.d.ts} +1 -1
- package/src/route-renderer/orchestration/{component-render-context.d.ts → foreign-child/component-render-context.d.ts} +1 -1
- package/src/route-renderer/orchestration/{component-render-context.js → foreign-child/component-render-context.js} +1 -1
- package/src/route-renderer/orchestration/{render-output.utils.d.ts → foreign-child/foreign-child-output.utils.d.ts} +1 -7
- package/src/route-renderer/orchestration/{render-output.utils.js → foreign-child/foreign-child-output.utils.js} +1 -26
- package/src/route-renderer/orchestration/{foreign-subtree-execution.service.d.ts → foreign-child/foreign-subtree-execution.service.d.ts} +5 -5
- package/src/route-renderer/orchestration/{foreign-subtree-execution.service.js → foreign-child/foreign-subtree-execution.service.js} +2 -2
- package/src/route-renderer/orchestration/foreign-child/owning-renderer-resolution.d.ts +19 -0
- package/src/route-renderer/orchestration/foreign-child/owning-renderer-resolution.js +35 -0
- package/src/route-renderer/orchestration/integration-renderer.d.ts +4 -46
- package/src/route-renderer/orchestration/integration-renderer.js +53 -157
- package/src/route-renderer/orchestration/integration-renderer.test-fixtures.d.ts +75 -0
- package/src/route-renderer/orchestration/integration-renderer.test-fixtures.js +177 -0
- package/src/route-renderer/orchestration/{component-graph-collectors.d.ts → ownership-graph/component-graph-collectors.d.ts} +4 -4
- package/src/route-renderer/orchestration/{component-graph-collectors.js → ownership-graph/component-graph-collectors.js} +1 -1
- package/src/route-renderer/orchestration/{component-graph.d.ts → ownership-graph/component-graph.d.ts} +1 -3
- package/src/route-renderer/orchestration/{component-graph.js → ownership-graph/component-graph.js} +0 -2
- package/src/route-renderer/orchestration/{ownership-validation.service.d.ts → ownership-graph/ownership-validation.service.d.ts} +2 -2
- package/src/route-renderer/orchestration/{ownership-validation.service.js → ownership-graph/ownership-validation.service.js} +3 -4
- package/src/route-renderer/orchestration/{global-injector-assets.service.d.ts → page-browser-graph/global-injector-assets.service.d.ts} +3 -3
- package/src/route-renderer/orchestration/{global-injector-assets.service.js → page-browser-graph/global-injector-assets.service.js} +2 -2
- package/src/route-renderer/orchestration/{page-browser-graph-contribution.loader.d.ts → page-browser-graph/page-browser-graph-contribution.loader.d.ts} +1 -1
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-merge.utils.d.ts +12 -0
- package/src/route-renderer/orchestration/page-browser-graph/page-browser-graph-merge.utils.js +29 -0
- package/src/route-renderer/orchestration/{page-browser-graph-session.d.ts → page-browser-graph/page-browser-graph-session.d.ts} +3 -3
- package/src/route-renderer/orchestration/{page-browser-graph-session.js → page-browser-graph/page-browser-graph-session.js} +1 -1
- package/src/route-renderer/orchestration/{page-browser-graph.service.d.ts → page-browser-graph/page-browser-graph.service.d.ts} +3 -3
- package/src/route-renderer/orchestration/{page-browser-graph.service.js → page-browser-graph/page-browser-graph.service.js} +3 -3
- package/src/route-renderer/orchestration/{processed-asset-dedupe.d.ts → page-browser-graph/processed-asset-dedupe.d.ts} +1 -1
- package/src/route-renderer/orchestration/{integration-route-render-adapter.d.ts → route-pipeline/integration-route-render-adapter.d.ts} +3 -3
- package/src/route-renderer/orchestration/{integration-route-render-adapter.js → route-pipeline/integration-route-render-adapter.js} +1 -1
- package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.d.ts +6 -0
- package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.js +27 -0
- package/src/route-renderer/orchestration/route-pipeline/robots-meta.contribution.d.ts +15 -0
- package/src/route-renderer/orchestration/route-pipeline/robots-meta.contribution.js +36 -0
- package/src/route-renderer/orchestration/{route-html-finalization.service.d.ts → route-pipeline/route-html-finalization.service.d.ts} +6 -2
- package/src/route-renderer/orchestration/{route-html-finalization.service.js → route-pipeline/route-html-finalization.service.js} +5 -2
- package/src/route-renderer/orchestration/{route-prepared-options.builder.d.ts → route-pipeline/route-prepared-options.builder.d.ts} +3 -3
- package/src/route-renderer/orchestration/{route-prepared-options.builder.js → route-pipeline/route-prepared-options.builder.js} +8 -4
- package/src/route-renderer/orchestration/{route-prepared-options.utils.js → route-pipeline/route-prepared-options.utils.js} +1 -1
- package/src/route-renderer/orchestration/{route-render-orchestrator.d.ts → route-pipeline/route-render-orchestrator.d.ts} +6 -6
- package/src/route-renderer/orchestration/{route-render-orchestrator.js → route-pipeline/route-render-orchestrator.js} +8 -5
- package/src/route-renderer/orchestration/string-markup-renderer.js +1 -1
- package/src/services/html/html-transformer.service.js +1 -1
- package/src/services/invalidation/development-invalidation.service.d.ts +5 -0
- package/src/services/invalidation/development-invalidation.service.js +8 -9
- package/src/static-site-generator/README.md +9 -1
- package/src/static-site-generator/production-page-browser-graph-prebuild.js +1 -1
- package/src/static-site-generator/sitemap-routes.d.ts +14 -0
- package/src/static-site-generator/sitemap-routes.js +31 -0
- package/src/static-site-generator/sitemap.d.ts +15 -0
- package/src/static-site-generator/sitemap.js +33 -0
- package/src/static-site-generator/static-export-context.d.ts +9 -1
- package/src/static-site-generator/static-site-generator.d.ts +27 -6
- package/src/static-site-generator/static-site-generator.js +200 -50
- package/src/types/internal-types.d.ts +9 -2
- package/src/types/public-types.d.ts +78 -2
- package/src/utils/ecopages-route-info.d.ts +26 -0
- package/src/utils/ecopages-route-info.js +26 -0
- package/src/utils/html-escaping.d.ts +7 -0
- package/src/utils/html-escaping.js +5 -1
- package/src/utils/path-pattern.d.ts +23 -0
- package/src/utils/path-pattern.js +27 -0
- package/src/watchers/project-watcher.d.ts +3 -3
- package/src/watchers/project-watcher.js +4 -4
- package/src/route-renderer/orchestration/declared-ownership-graph.d.ts +0 -1
- package/src/route-renderer/orchestration/declared-ownership-graph.js +0 -8
- package/src/route-renderer/orchestration/template-serialization.d.ts +0 -38
- package/src/route-renderer/orchestration/template-serialization.js +0 -45
- /package/src/route-renderer/orchestration/{layout-shell-props.service.js → document-shell/layout-shell-props.service.js} +0 -0
- /package/src/route-renderer/orchestration/{page-browser-graph-contribution.loader.js → page-browser-graph/page-browser-graph-contribution.loader.js} +0 -0
- /package/src/route-renderer/orchestration/{processed-asset-dedupe.js → page-browser-graph/processed-asset-dedupe.js} +0 -0
- /package/src/route-renderer/orchestration/{route-prepared-options.utils.d.ts → route-pipeline/route-prepared-options.utils.d.ts} +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function normalizePathname(pathname) {
|
|
2
|
+
if (!pathname || pathname === "/") {
|
|
3
|
+
return "/";
|
|
4
|
+
}
|
|
5
|
+
const withLeadingSlash = pathname.startsWith("/") ? pathname : `/${pathname}`;
|
|
6
|
+
return withLeadingSlash.replace(/\/+$/, "") || "/";
|
|
7
|
+
}
|
|
8
|
+
function matchPathPattern(pathname, pattern) {
|
|
9
|
+
const normalizedPath = normalizePathname(pathname);
|
|
10
|
+
const normalizedPattern = pattern.trim();
|
|
11
|
+
if (normalizedPattern.endsWith("/**")) {
|
|
12
|
+
const prefix = normalizePathname(normalizedPattern.slice(0, -3));
|
|
13
|
+
if (prefix === "/") {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
return normalizedPath === prefix || normalizedPath.startsWith(`${prefix}/`);
|
|
17
|
+
}
|
|
18
|
+
return normalizedPath === normalizePathname(normalizedPattern);
|
|
19
|
+
}
|
|
20
|
+
function matchesAnyPathPattern(pathname, patterns) {
|
|
21
|
+
return patterns.some((pattern) => matchPathPattern(pathname, pattern));
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
matchPathPattern,
|
|
25
|
+
matchesAnyPathPattern,
|
|
26
|
+
normalizePathname
|
|
27
|
+
};
|
|
@@ -116,9 +116,9 @@ export declare class ProjectWatcher {
|
|
|
116
116
|
*/
|
|
117
117
|
private matchesAdditionalWatchPaths;
|
|
118
118
|
/**
|
|
119
|
-
* Checks if a file is
|
|
120
|
-
*
|
|
121
|
-
*
|
|
119
|
+
* Checks if a file is owned by a processor as an asset input.
|
|
120
|
+
* Ownership requires declared asset capabilities; watch config only drives
|
|
121
|
+
* {@link notifyProcessors} notifications.
|
|
122
122
|
*/
|
|
123
123
|
private isHandledByProcessor;
|
|
124
124
|
/**
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
DevelopmentInvalidationService
|
|
7
7
|
} from "../services/invalidation/development-invalidation.service.js";
|
|
8
8
|
import { prepareHmrFileChange } from "../hmr/hmr-file-change-prep.js";
|
|
9
|
-
import { getAppPageBrowserGraphSession } from "../route-renderer/orchestration/page-browser-graph-session.js";
|
|
9
|
+
import { getAppPageBrowserGraphSession } from "../route-renderer/orchestration/page-browser-graph/page-browser-graph-session.js";
|
|
10
10
|
import { isRegisteredScriptEntrypoint } from "../hmr/hmr-entrypoint-output.js";
|
|
11
11
|
import { resolveInternalExecutionDir } from "../utils/resolve-work-dir.js";
|
|
12
12
|
import { createProjectWatcherIgnorePredicate } from "./project-watcher-ignore.js";
|
|
@@ -275,9 +275,9 @@ class ProjectWatcher {
|
|
|
275
275
|
return this.invalidationService.matchesAdditionalWatchPaths(filePath);
|
|
276
276
|
}
|
|
277
277
|
/**
|
|
278
|
-
* Checks if a file is
|
|
279
|
-
*
|
|
280
|
-
*
|
|
278
|
+
* Checks if a file is owned by a processor as an asset input.
|
|
279
|
+
* Ownership requires declared asset capabilities; watch config only drives
|
|
280
|
+
* {@link notifyProcessors} notifications.
|
|
281
281
|
*/
|
|
282
282
|
isHandledByProcessor(filePath) {
|
|
283
283
|
return this.invalidationService.isProcessorOwnedAsset(filePath);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { mapComponentGraph, mapDeclaredOwnershipGraph, type ComponentGraphRoot, type ComponentGraphWalkInput, type DeclaredOwnershipNodeInput, type DeclaredOwnershipRoot, } from './component-graph.js';
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal template-result shape that core can serialize generically.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Core intentionally models only the transport shape used during deferred
|
|
6
|
-
* cross-integration child passing: alternating static string segments plus
|
|
7
|
-
* interpolated runtime values. Concrete runtime markers that identify a given
|
|
8
|
-
* framework's template payload must stay outside core and be registered by the
|
|
9
|
-
* owning integration package.
|
|
10
|
-
*/
|
|
11
|
-
export type SerializableTemplateShape = {
|
|
12
|
-
strings: readonly string[];
|
|
13
|
-
values?: readonly unknown[];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Integration-owned adapter that teaches core how to serialize one deferred
|
|
17
|
-
* template payload shape.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* The separation here is intentional: core owns the HTML serialization logic,
|
|
21
|
-
* but integrations own runtime-shape detection. That keeps package-specific
|
|
22
|
-
* markers such as framework template sentinels out of core while still letting
|
|
23
|
-
* deferred children round-trip through mixed renderer boundaries.
|
|
24
|
-
*/
|
|
25
|
-
export type DeferredTemplateSerializer<TTemplate extends SerializableTemplateShape = SerializableTemplateShape> = {
|
|
26
|
-
matches(value: unknown): value is TTemplate;
|
|
27
|
-
serialize(template: TTemplate, serializeValue: (value: unknown) => string | undefined): string;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Serializes a generic template shape into HTML.
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* This handles only HTML reconstruction semantics: quoted attribute values,
|
|
34
|
-
* boolean attributes, and omission of client-only event or property bindings.
|
|
35
|
-
* It does not decide whether an arbitrary value belongs to a framework-specific
|
|
36
|
-
* template runtime; integrations must make that decision before delegating here.
|
|
37
|
-
*/
|
|
38
|
-
export declare function serializeTemplateShape(template: SerializableTemplateShape, serializeValue: (value: unknown) => string | undefined): string;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { escapeHtmlAttribute } from "../../utils/html-escaping.js";
|
|
2
|
-
const ATTRIBUTE_TAIL_PATTERN = /(\s+)([@.?!]?)([^\s"'<>/=`@.?!]+)=$/;
|
|
3
|
-
function getSerializableTemplateAttribute(stringPart) {
|
|
4
|
-
const match = ATTRIBUTE_TAIL_PATTERN.exec(stringPart);
|
|
5
|
-
if (!match) return void 0;
|
|
6
|
-
return {
|
|
7
|
-
leading: stringPart.slice(0, match.index),
|
|
8
|
-
whitespace: match[1],
|
|
9
|
-
prefix: match[2],
|
|
10
|
-
name: match[3]
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function serializeTemplateShape(template, serializeValue) {
|
|
14
|
-
const values = template.values ?? [];
|
|
15
|
-
let html = "";
|
|
16
|
-
for (let index = 0; index < values.length; index += 1) {
|
|
17
|
-
const stringPart = template.strings[index] ?? "";
|
|
18
|
-
const serializedValue = serializeValue(values[index]);
|
|
19
|
-
const attribute = getSerializableTemplateAttribute(stringPart);
|
|
20
|
-
if (!attribute) {
|
|
21
|
-
html += stringPart;
|
|
22
|
-
html += serializedValue ?? "";
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
html += attribute.leading;
|
|
26
|
-
if (attribute.prefix === "@" || attribute.prefix === "!" || attribute.prefix === ".") {
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
if (attribute.prefix === "?") {
|
|
30
|
-
if (serializedValue) {
|
|
31
|
-
html += `${attribute.whitespace}${attribute.name}`;
|
|
32
|
-
}
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
if (serializedValue === void 0) {
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
html += `${attribute.whitespace}${attribute.name}="${escapeHtmlAttribute(serializedValue)}"`;
|
|
39
|
-
}
|
|
40
|
-
html += template.strings[values.length] ?? "";
|
|
41
|
-
return html;
|
|
42
|
-
}
|
|
43
|
-
export {
|
|
44
|
-
serializeTemplateShape
|
|
45
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|