@ecopages/core 0.8.0 → 0.10.0
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 +2 -2
- package/package.json +14 -4
- package/src/adapters/node/create-app.d.ts +5 -5
- package/src/adapters/node/create-app.js +1 -1
- package/src/adapters/node/server-adapter.d.ts +1 -0
- package/src/adapters/node/server-adapter.js +4 -1
- package/src/adapters/shared/hmr/hmr-manager.d.ts +2 -0
- package/src/adapters/shared/hmr/hmr-manager.js +8 -4
- package/src/adapters/shared/http/api-request-pipeline.d.ts +16 -3
- package/src/adapters/shared/http/api-request-pipeline.js +23 -16
- package/src/adapters/shared/http/define-api-handler.d.ts +8 -8
- package/src/adapters/shared/http/explicit-static-route-matcher.js +8 -4
- package/src/adapters/shared/http/file-route-middleware-pipeline.d.ts +10 -11
- package/src/adapters/shared/http/file-route-middleware-pipeline.js +5 -6
- package/src/adapters/shared/http/fs-server-response-matcher.js +12 -4
- package/src/adapters/shared/http/run-middleware-chain.d.ts +29 -2
- package/src/adapters/shared/http/run-middleware-chain.js +108 -10
- package/src/adapters/shared/runtime/render-context.d.ts +2 -0
- package/src/adapters/shared/runtime/render-context.js +6 -21
- package/src/adapters/shared/runtime/server-request-pipeline.d.ts +2 -2
- package/src/adapters/shared/runtime/server-request-pipeline.js +4 -3
- package/src/adapters/shared/runtime/server-static-builder.js +4 -1
- package/src/adapters/shared/runtime/unattached-scripts.d.ts +17 -0
- package/src/adapters/shared/runtime/unattached-scripts.js +57 -0
- package/src/adapters/shared/ws/node-http-websocket-upgrades.js +3 -2
- package/src/adapters/shared/ws/ws-pattern-matcher.d.ts +14 -1
- package/src/adapters/shared/ws/ws-pattern-matcher.js +14 -13
- package/src/assets/app-browser-client-build.js +3 -0
- package/src/assets/asset-processing-service/asset-processing.service.d.ts +9 -0
- package/src/assets/asset-processing-service/asset-processing.service.js +19 -0
- package/src/assets/asset-processing-service/processed-asset-ledger.d.ts +16 -2
- package/src/assets/asset-processing-service/processed-asset-ledger.js +31 -3
- package/src/build/build-graph.d.ts +19 -2
- package/src/build/build-graph.js +19 -18
- package/src/build/cache/pages-unified-graph-build.d.ts +4 -6
- package/src/build/cache/pages-unified-graph-build.js +14 -51
- package/src/build/cache/server-module-entries.d.ts +5 -9
- package/src/build/cache/server-module-entries.js +5 -58
- package/src/build/contracts/build-contracts.d.ts +15 -0
- package/src/build/contracts.d.ts +1 -1
- package/src/build/contracts.js +1 -1
- package/src/build/production-asset-ledger.d.ts +1 -1
- package/src/build/production-asset-ledger.js +4 -2
- package/src/build/rolldown/file-role-grammar-plugin.d.ts +11 -0
- package/src/build/rolldown/file-role-grammar-plugin.js +32 -0
- package/src/build/rolldown/rolldown-adapter-helpers.d.ts +11 -0
- package/src/build/rolldown/rolldown-adapter-helpers.js +79 -10
- package/src/build/rolldown/ssr-script-entries-plugin.d.ts +31 -0
- package/src/build/rolldown/ssr-script-entries-plugin.js +104 -0
- package/src/build/runtime/build-request-policy.js +4 -1
- package/src/build/server/server-modules-manifest.d.ts +6 -1
- package/src/build/server/server-modules-manifest.js +10 -1
- package/src/build/server/view-reference.d.ts +9 -0
- package/src/build/server/view-reference.js +11 -0
- package/src/build.d.ts +3 -1
- package/src/build.js +3 -1
- package/src/cli.d.ts +14 -0
- package/src/cli.js +14 -0
- package/src/config/assembly/app-runtime.d.ts +13 -0
- package/src/config/assembly/app-runtime.js +2 -0
- package/src/config/assembly/finalize-config.js +13 -8
- package/src/config/internal-types.d.ts +0 -12
- package/src/config/resolve-eco-config-path.d.ts +2 -0
- package/src/config/resolve-eco-config-path.js +2 -1
- package/src/config/server-config-bundle.d.ts +0 -1
- package/src/config/server-config-bundle.js +1 -1
- package/src/config/user-config-types.d.ts +0 -12
- package/src/declarations.d.ts +2 -0
- package/src/dev/invalidation/development-invalidation.service.d.ts +0 -2
- package/src/dev/invalidation/development-invalidation.service.js +1 -11
- package/src/dev/transform-server/dev-transform-vendor-registry.js +33 -19
- package/src/eco/discovered-dependencies.d.ts +5 -0
- package/src/eco/discovered-dependencies.js +9 -0
- package/src/eco/eco.browser.js +6 -26
- package/src/eco/eco.js +24 -16
- package/src/eco/migration-docs.d.ts +7 -0
- package/src/eco/migration-docs.js +7 -0
- package/src/eco/page-data-hooks.d.ts +27 -0
- package/src/eco/page-data-hooks.js +64 -0
- package/src/eco/page-layout-normalization.d.ts +2 -2
- package/src/hmr/client/hmr-runtime.js +1 -1
- package/src/hmr/strategies/js-hmr-strategy.d.ts +0 -2
- package/src/hmr/strategies/server-rendered-template-hmr-strategy.d.ts +2 -1
- package/src/hmr/strategies/server-rendered-template-hmr-strategy.js +4 -3
- package/src/html/html-rewriter.d.ts +9 -7
- package/src/html/html-rewriter.js +26 -41
- package/src/html/html-transformer.service.d.ts +2 -2
- package/src/html/html-transformer.service.js +21 -15
- package/src/html-pages/html-page-module-scripts.js +2 -1
- package/src/html-pages/html-pages.plugin.d.ts +1 -1
- package/src/html-pages/html-pages.plugin.js +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/integration.d.ts +2 -2
- package/src/integration.js +2 -2
- package/src/islands/island-host.d.ts +16 -5
- package/src/islands/island-host.js +8 -1
- package/src/middleware/create-middleware.d.ts +41 -0
- package/src/middleware/create-middleware.js +72 -0
- package/src/plugins/component-import-discovery.d.ts +14 -1
- package/src/plugins/component-import-discovery.js +36 -16
- package/src/plugins/eco-component-meta-plugin.d.ts +38 -0
- package/src/plugins/eco-component-meta-plugin.js +208 -44
- package/src/plugins/ecopages-virtual-imports.d.ts +15 -0
- package/src/plugins/ecopages-virtual-imports.js +25 -0
- package/src/plugins/integration-plugin.d.ts +1 -1
- package/src/plugins/integration-plugin.js +1 -1
- package/src/plugins/tsconfig-import-resolver.d.ts +2 -0
- package/src/plugins/tsconfig-import-resolver.js +7 -5
- package/src/route-renderer/error-pages/error-page-renderer.js +32 -3
- package/src/route-renderer/explicit-view-render-preparation.d.ts +28 -3
- package/src/route-renderer/explicit-view-render-preparation.js +63 -11
- package/src/route-renderer/orchestration/document-shell/layout-shell-props.service.d.ts +15 -5
- package/src/route-renderer/orchestration/document-shell/layout-shell-props.service.js +27 -15
- package/src/route-renderer/orchestration/foreign-child/foreign-subtree-execution.service.d.ts +24 -9
- package/src/route-renderer/orchestration/foreign-child/foreign-subtree-execution.service.js +73 -50
- package/src/route-renderer/orchestration/integration-renderer.d.ts +42 -11
- package/src/route-renderer/orchestration/integration-renderer.js +83 -43
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.builder.js +0 -3
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.d.ts +36 -11
- package/src/route-renderer/orchestration/route-pipeline/route-render-orchestrator.js +74 -62
- package/src/route-renderer/page-declaration.d.ts +25 -0
- package/src/route-renderer/page-declaration.js +39 -0
- package/src/route-renderer/page-loading/component-declarations.d.ts +65 -0
- package/src/route-renderer/page-loading/component-declarations.js +77 -0
- package/src/route-renderer/page-loading/component-dependency-collection.d.ts +4 -16
- package/src/route-renderer/page-loading/component-dependency-collection.js +36 -105
- package/src/route-renderer/page-loading/declared-asset-collection.d.ts +19 -14
- package/src/route-renderer/page-loading/declared-asset-collection.js +66 -67
- package/src/route-renderer/page-loading/dependency-resolver.d.ts +18 -10
- package/src/route-renderer/page-loading/dependency-resolver.js +58 -99
- package/src/route-renderer/page-loading/lazy-entry-collection.d.ts +19 -26
- package/src/route-renderer/page-loading/lazy-entry-collection.js +53 -64
- package/src/route-renderer/page-loading/module-declaration-aggregation.d.ts +17 -3
- package/src/route-renderer/page-loading/module-declaration-aggregation.js +14 -13
- package/src/route-renderer/page-loading/page-module-loader.d.ts +31 -12
- package/src/route-renderer/page-loading/page-module-loader.js +66 -35
- package/src/route-renderer/page-loading/resolved-page-dependencies.js +14 -9
- package/src/router/server/pages-dir.d.ts +7 -0
- package/src/router/server/pages-dir.js +7 -0
- package/src/router/server/route-registry.d.ts +22 -10
- package/src/router/server/route-registry.js +54 -23
- package/src/router/server/segment-path-matcher.d.ts +29 -5
- package/src/router/server/segment-path-matcher.js +22 -19
- package/src/static-site-generator/production-page-browser-graph-prebuild.d.ts +2 -2
- package/src/static-site-generator/production-page-browser-graph-prebuild.js +5 -5
- package/src/static-site-generator/static-site-generator.d.ts +17 -2
- package/src/static-site-generator/static-site-generator.js +52 -18
- package/src/types/contracts.d.ts +216 -160
- package/src/types/eco-api-types.d.ts +86 -51
- package/src/types/locals-brand.d.ts +9 -0
- package/src/types/locals-brand.js +9 -0
- package/src/types/middleware-types.d.ts +143 -0
- package/src/types/middleware-types.js +1 -0
- package/src/types/public-types.d.ts +3 -2
- package/src/utils/file-roles.d.ts +48 -0
- package/src/utils/file-roles.js +85 -0
- package/src/utils/node-builtin.d.ts +10 -0
- package/src/utils/node-builtin.js +13 -0
- package/src/watchers/project-watcher.js +2 -2
- package/src/build/contracts/server-only-specifier.d.ts +0 -8
- package/src/build/contracts/server-only-specifier.js +0 -11
- package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.d.ts +0 -5
- package/src/route-renderer/orchestration/route-pipeline/marker-artifact.utils.js +0 -11
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.utils.d.ts +0 -4
- package/src/route-renderer/orchestration/route-pipeline/route-prepared-options.utils.js +0 -30
- package/src/route-renderer/page-loading/ecopages-virtual-imports.d.ts +0 -12
- package/src/route-renderer/page-loading/ecopages-virtual-imports.js +0 -100
- package/src/utils/endpoint-file-extensions.d.ts +0 -11
- package/src/utils/endpoint-file-extensions.js +0 -13
- package/src/utils/locals-utils.d.ts +0 -15
- package/src/utils/locals-utils.js +0 -34
package/src/integration.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { type ForeignChildInterceptionInput, type ForeignChildInterceptionResult
|
|
|
6
6
|
export { ensurePageConfigLayouts } from './eco/page-layout-normalization.js';
|
|
7
7
|
export { moveMdxMetadataOntoPage } from './eco/mdx-page-metadata.js';
|
|
8
8
|
export { collectJsxExtensions, createJsxImportSourcePragma, filterJsxSourceExtensions, isJsxSourceExtension, } from './plugins/jsx-import-source.utils.js';
|
|
9
|
-
export { resolveDocumentShellLayouts, resolveInnermostPageLayout, resolveLayoutEntryProps,
|
|
9
|
+
export { resolveDocumentShellLayouts, resolveInnermostPageLayout, resolveLayoutEntryProps, resolveRenderLayouts, resolvePageLayoutComponents, type DocumentShellLayoutResolutionInput, type LayoutShellPropsContext, } from './route-renderer/orchestration/document-shell/layout-shell-props.service.js';
|
|
10
10
|
export { LayoutChildrenNotRenderedError } from './route-renderer/orchestration/document-shell/layout-children-not-rendered-error.js';
|
|
11
11
|
export { isRegisteredDevTransformEntrypoint, isRegisteredScriptEntrypoint } from './hmr/hmr-entrypoint-output.js';
|
|
12
12
|
export { type HmrRegisteredEntrypointsContext } from './hmr/hmr-registered-entrypoints-context.js';
|
|
@@ -18,7 +18,7 @@ export { installConfiguredServerDom } from './plugins/server-dom.js';
|
|
|
18
18
|
export { CUSTOM_ELEMENT_SSR_PRELOAD_CACHE_SCOPES, CustomElementScriptPreloader, type CustomElementScriptPreloadScopeState, type CustomElementSsrPreloadComponent, invalidateCustomElementScriptPreload, type SsrScriptAssignment, type SsrScriptPreload, type SsrScriptPreloadDeclaration, type SsrScriptPreloaderInit, } from './route-renderer/orchestration/custom-element-scripts/custom-element-script-preloader.js';
|
|
19
19
|
export { createCustomElementServerModuleImporter, createSharedServerModuleImporter, } from './route-renderer/orchestration/custom-element-scripts/custom-element-server-module-importer.js';
|
|
20
20
|
export { type DocumentShellComposeChildrenContext, type DocumentShellComposeChildrenResult, type DocumentShellLayoutInput, } from './route-renderer/orchestration/document-shell/document-shell-render.service.js';
|
|
21
|
-
export { type QueuedForeignSubtreeResolutionContext,
|
|
21
|
+
export { type QueuedForeignSubtreeResolutionContext, type ResolveForeignSubtreeTokens, } from './route-renderer/orchestration/foreign-child/foreign-subtree-execution.service.js';
|
|
22
22
|
export { createIntegrationRenderer, type HtmlDocumentContribution, type HtmlDocumentContributionContext, IntegrationRenderer, type IntegrationRendererHookFactory, type IntegrationRendererHookFactoryOptions, type IntegrationRendererHooks, type IntegrationRendererOptions, type PageBrowserGraphContribution, type PageBrowserGraphContributionContext, type PageBrowserGraphDeclaration, type PageClientBrowserAssets, type PageClientBuildEntry, type PageClientPlan, type RouteModuleLoadOptions, selectHydrationIslandEntries, } from './route-renderer/orchestration/integration-renderer.js';
|
|
23
23
|
export { StringMarkupRenderer } from './route-renderer/orchestration/string-markup-renderer.js';
|
|
24
24
|
export { attachEcoFileMetadataToConfig, collectComponentConfigFilePaths, } from './route-renderer/page-loading/file-scoped-dependency-components.js';
|
package/src/integration.js
CHANGED
|
@@ -5,7 +5,7 @@ export { getComponentRenderContext, runWithComponentRenderContext, } from './eco
|
|
|
5
5
|
export { ensurePageConfigLayouts } from './eco/page-layout-normalization.js';
|
|
6
6
|
export { moveMdxMetadataOntoPage } from './eco/mdx-page-metadata.js';
|
|
7
7
|
export { collectJsxExtensions, createJsxImportSourcePragma, filterJsxSourceExtensions, isJsxSourceExtension, } from './plugins/jsx-import-source.utils.js';
|
|
8
|
-
export { resolveDocumentShellLayouts, resolveInnermostPageLayout, resolveLayoutEntryProps,
|
|
8
|
+
export { resolveDocumentShellLayouts, resolveInnermostPageLayout, resolveLayoutEntryProps, resolveRenderLayouts, resolvePageLayoutComponents, } from './route-renderer/orchestration/document-shell/layout-shell-props.service.js';
|
|
9
9
|
export { LayoutChildrenNotRenderedError } from './route-renderer/orchestration/document-shell/layout-children-not-rendered-error.js';
|
|
10
10
|
export { isRegisteredDevTransformEntrypoint, isRegisteredScriptEntrypoint } from './hmr/hmr-entrypoint-output.js';
|
|
11
11
|
export {} from './hmr/hmr-registered-entrypoints-context.js';
|
|
@@ -17,7 +17,7 @@ export { installConfiguredServerDom } from './plugins/server-dom.js';
|
|
|
17
17
|
export { CUSTOM_ELEMENT_SSR_PRELOAD_CACHE_SCOPES, CustomElementScriptPreloader, invalidateCustomElementScriptPreload, } from './route-renderer/orchestration/custom-element-scripts/custom-element-script-preloader.js';
|
|
18
18
|
export { createCustomElementServerModuleImporter, createSharedServerModuleImporter, } from './route-renderer/orchestration/custom-element-scripts/custom-element-server-module-importer.js';
|
|
19
19
|
export {} from './route-renderer/orchestration/document-shell/document-shell-render.service.js';
|
|
20
|
-
export {
|
|
20
|
+
export {} from './route-renderer/orchestration/foreign-child/foreign-subtree-execution.service.js';
|
|
21
21
|
export { createIntegrationRenderer, IntegrationRenderer, selectHydrationIslandEntries, } from './route-renderer/orchestration/integration-renderer.js';
|
|
22
22
|
export { StringMarkupRenderer } from './route-renderer/orchestration/string-markup-renderer.js';
|
|
23
23
|
export { attachEcoFileMetadataToConfig, collectComponentConfigFilePaths, } from './route-renderer/page-loading/file-scoped-dependency-components.js';
|
|
@@ -22,6 +22,11 @@ export declare function buildIslandHostAttributes(input: IslandHostAttributesInp
|
|
|
22
22
|
export declare function componentRenderHasIslandBootstrap(assets: Array<{
|
|
23
23
|
kind: string;
|
|
24
24
|
}> | undefined): boolean;
|
|
25
|
+
type IslandHostRenderResult = {
|
|
26
|
+
canAttachAttributes: boolean;
|
|
27
|
+
integrationName: string;
|
|
28
|
+
rootAttributes?: Record<string, string>;
|
|
29
|
+
};
|
|
25
30
|
/**
|
|
26
31
|
* Stamps the render result's root as an Island Host when the component ships its own client script.
|
|
27
32
|
*
|
|
@@ -29,14 +34,20 @@ export declare function componentRenderHasIslandBootstrap(assets: Array<{
|
|
|
29
34
|
* and the Foreign Subtrees rendered inside it.
|
|
30
35
|
* @remarks A component without scripts that wraps an island is not an island itself.
|
|
31
36
|
*/
|
|
32
|
-
export declare function finalizeIslandComponentRender<T extends {
|
|
33
|
-
canAttachAttributes: boolean;
|
|
34
|
-
integrationName: string;
|
|
35
|
-
rootAttributes?: Record<string, string>;
|
|
36
|
-
}>(input: {
|
|
37
|
+
export declare function finalizeIslandComponentRender<T extends IslandHostRenderResult>(input: {
|
|
37
38
|
integrationContext?: {
|
|
38
39
|
componentInstanceId?: string;
|
|
39
40
|
};
|
|
40
41
|
}, result: T, ownAssets: Array<{
|
|
41
42
|
kind: string;
|
|
42
43
|
}> | undefined): T;
|
|
44
|
+
/**
|
|
45
|
+
* Stamps the render result's root as an Island Host when `shipsScript` says the component ships its own client
|
|
46
|
+
* script and the render carries a component instance id.
|
|
47
|
+
*/
|
|
48
|
+
export declare function stampIslandHost<T extends IslandHostRenderResult>(input: {
|
|
49
|
+
integrationContext?: {
|
|
50
|
+
componentInstanceId?: string;
|
|
51
|
+
};
|
|
52
|
+
}, result: T, shipsScript: boolean): T;
|
|
53
|
+
export {};
|
|
@@ -49,8 +49,15 @@ export function componentRenderHasIslandBootstrap(assets) {
|
|
|
49
49
|
* @remarks A component without scripts that wraps an island is not an island itself.
|
|
50
50
|
*/
|
|
51
51
|
export function finalizeIslandComponentRender(input, result, ownAssets) {
|
|
52
|
+
return stampIslandHost(input, result, componentRenderHasIslandBootstrap(ownAssets));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Stamps the render result's root as an Island Host when `shipsScript` says the component ships its own client
|
|
56
|
+
* script and the render carries a component instance id.
|
|
57
|
+
*/
|
|
58
|
+
export function stampIslandHost(input, result, shipsScript) {
|
|
52
59
|
const componentInstanceId = input.integrationContext?.componentInstanceId;
|
|
53
|
-
if (!componentInstanceId || !result.canAttachAttributes || !
|
|
60
|
+
if (!componentInstanceId || !result.canAttachAttributes || !shipsScript) {
|
|
54
61
|
return result;
|
|
55
62
|
}
|
|
56
63
|
return {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { MiddlewareHandler } from '../adapters/shared/http/run-middleware-chain.js';
|
|
2
|
+
import type { AnyEcoMiddleware, EcoMiddleware, MiddlewareLocalsAfter, MiddlewareStage, MiddlewareStageInput, ProvidedBy, RuntimeMiddlewareStage, StageResult } from '../types/middleware-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates one middleware from a stage.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The stage continues with `next(locals)` and the locals it passes become typed `locals` for everything after
|
|
8
|
+
* it, with no declaration: the type is read from the `next` calls in the body. Returning a bare `Response` or
|
|
9
|
+
* throwing one stops the request. `next` resolves to the response of the later stages, so a stage can still
|
|
10
|
+
* edit it after `await next()`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createMiddleware<TResult extends StageResult | Promise<StageResult>>(stage: MiddlewareStage<{}, TResult>): EcoMiddleware<ProvidedBy<Awaited<TResult>>>;
|
|
13
|
+
/**
|
|
14
|
+
* Composes middleware and inline stages into one middleware, in order.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Each stage is either a middleware or an inline function whose `ctx.locals` is typed from everything provided
|
|
18
|
+
* by the stages before it, so a dependent stage needs no annotation. The result is itself a middleware: list
|
|
19
|
+
* it in `middleware`, or use it as a stage of another composition. A later stage that provides the same key
|
|
20
|
+
* wins, as it does at runtime. Overloads cover four stages; nest a composition to go further.
|
|
21
|
+
*/
|
|
22
|
+
export declare function composeMiddleware<A extends MiddlewareStageInput<{}>>(a: A): EcoMiddleware<MiddlewareLocalsAfter<{}, A>>;
|
|
23
|
+
export declare function composeMiddleware<A extends MiddlewareStageInput<{}>, B extends MiddlewareStageInput<MiddlewareLocalsAfter<{}, A>>>(a: A, b: B): EcoMiddleware<MiddlewareLocalsAfter<MiddlewareLocalsAfter<{}, A>, B>>;
|
|
24
|
+
export declare function composeMiddleware<A extends MiddlewareStageInput<{}>, B extends MiddlewareStageInput<MiddlewareLocalsAfter<{}, A>>, C extends MiddlewareStageInput<MiddlewareLocalsAfter<MiddlewareLocalsAfter<{}, A>, B>>>(a: A, b: B, c: C): EcoMiddleware<MiddlewareLocalsAfter<MiddlewareLocalsAfter<MiddlewareLocalsAfter<{}, A>, B>, C>>;
|
|
25
|
+
export declare function composeMiddleware<A extends MiddlewareStageInput<{}>, B extends MiddlewareStageInput<MiddlewareLocalsAfter<{}, A>>, C extends MiddlewareStageInput<MiddlewareLocalsAfter<MiddlewareLocalsAfter<{}, A>, B>>, D extends MiddlewareStageInput<MiddlewareLocalsAfter<MiddlewareLocalsAfter<MiddlewareLocalsAfter<{}, A>, B>, C>>>(a: A, b: B, c: C, d: D): EcoMiddleware<MiddlewareLocalsAfter<MiddlewareLocalsAfter<MiddlewareLocalsAfter<MiddlewareLocalsAfter<{}, A>, B>, C>, D>>;
|
|
26
|
+
/**
|
|
27
|
+
* Flattens a middleware list into the ordered functions a request pipeline runs.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* A plain `(ctx, next)` function is one stage. A middleware made by `createMiddleware` or `composeMiddleware`
|
|
31
|
+
* contributes its stages, in order. Every declared stage runs, so the same stage reached twice is rejected: it
|
|
32
|
+
* would run twice, and the locals the types promise after it would no longer match what a stage in between left
|
|
33
|
+
* behind. Declare a shared guard once, in the composition that owns it. A stage is typed for the context it reads,
|
|
34
|
+
* so the pipeline that runs it names that context as `TContext`; this is the one place the two are joined.
|
|
35
|
+
*
|
|
36
|
+
* @throws When one stage appears twice, naming both positions and `label`, or when an entry is an object neither
|
|
37
|
+
* factory made.
|
|
38
|
+
*/
|
|
39
|
+
export declare function flattenMiddleware<TContext extends {
|
|
40
|
+
readonly locals: object;
|
|
41
|
+
}>(entries: readonly (AnyEcoMiddleware | RuntimeMiddlewareStage)[] | undefined, label?: string): MiddlewareHandler<TContext>[];
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { localsBrand } from '../types/locals-brand.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates one middleware from a stage.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* The stage continues with `next(locals)` and the locals it passes become typed `locals` for everything after
|
|
7
|
+
* it, with no declaration: the type is read from the `next` calls in the body. Returning a bare `Response` or
|
|
8
|
+
* throwing one stops the request. `next` resolves to the response of the later stages, so a stage can still
|
|
9
|
+
* edit it after `await next()`.
|
|
10
|
+
*/
|
|
11
|
+
export function createMiddleware(stage) {
|
|
12
|
+
return brand([stage]);
|
|
13
|
+
}
|
|
14
|
+
export function composeMiddleware(...stages) {
|
|
15
|
+
return brand(assertNoDuplicateStages(collectStages(stages), 'composition'));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The key of the stages each made middleware holds.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* The stages are a non-enumerable property, so a copy such as `{ ...auth }` carries the brand but no stages and is
|
|
22
|
+
* rejected when listed, instead of proving locals it never provides. The key is registered with `Symbol.for`, so a
|
|
23
|
+
* Page module that loads its own copy of the package still lists middleware the server's copy can run.
|
|
24
|
+
*/
|
|
25
|
+
const stagesKey = Symbol.for('ecopages.middlewareStages');
|
|
26
|
+
function brand(stages) {
|
|
27
|
+
const made = { [localsBrand]: (locals) => locals };
|
|
28
|
+
Object.defineProperty(made, stagesKey, { value: stages });
|
|
29
|
+
return made;
|
|
30
|
+
}
|
|
31
|
+
function stagesOf(entry) {
|
|
32
|
+
return Object.getOwnPropertyDescriptor(entry, stagesKey)?.value;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Flattens a middleware list into the ordered functions a request pipeline runs.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* A plain `(ctx, next)` function is one stage. A middleware made by `createMiddleware` or `composeMiddleware`
|
|
39
|
+
* contributes its stages, in order. Every declared stage runs, so the same stage reached twice is rejected: it
|
|
40
|
+
* would run twice, and the locals the types promise after it would no longer match what a stage in between left
|
|
41
|
+
* behind. Declare a shared guard once, in the composition that owns it. A stage is typed for the context it reads,
|
|
42
|
+
* so the pipeline that runs it names that context as `TContext`; this is the one place the two are joined.
|
|
43
|
+
*
|
|
44
|
+
* @throws When one stage appears twice, naming both positions and `label`, or when an entry is an object neither
|
|
45
|
+
* factory made.
|
|
46
|
+
*/
|
|
47
|
+
export function flattenMiddleware(entries, label = 'middleware list') {
|
|
48
|
+
return assertNoDuplicateStages(collectStages(entries ?? []), label);
|
|
49
|
+
}
|
|
50
|
+
function collectStages(entries) {
|
|
51
|
+
return entries.flatMap((entry) => {
|
|
52
|
+
if (typeof entry === 'function') {
|
|
53
|
+
return [entry];
|
|
54
|
+
}
|
|
55
|
+
const stages = stagesOf(entry);
|
|
56
|
+
if (!stages) {
|
|
57
|
+
throw new Error('[ecopages] A middleware list holds an object that createMiddleware or composeMiddleware did not make. List the middleware itself, not a copy of it.');
|
|
58
|
+
}
|
|
59
|
+
return [...stages];
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function assertNoDuplicateStages(stages, label) {
|
|
63
|
+
const firstSeen = new Map();
|
|
64
|
+
stages.forEach((stage, index) => {
|
|
65
|
+
const first = firstSeen.get(stage);
|
|
66
|
+
if (first !== undefined) {
|
|
67
|
+
throw new Error(`[ecopages] The ${label} runs the same middleware stage twice, at positions ${first} and ${index}. Declare a shared guard once, in the composition that owns it.`);
|
|
68
|
+
}
|
|
69
|
+
firstSeen.set(stage, index);
|
|
70
|
+
});
|
|
71
|
+
return stages;
|
|
72
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type StylesheetKinds } from './stylesheet-kinds.js';
|
|
2
|
+
import { type EcopagesVirtualImport } from './ecopages-virtual-imports.js';
|
|
2
3
|
/**
|
|
3
4
|
* Whether `program` calls `eco.page`, `eco.component`, `eco.layout` or `eco.html` anywhere.
|
|
4
5
|
*/
|
|
@@ -45,6 +46,14 @@ export type ModuleIndex = {
|
|
|
45
46
|
* plugin for a module that no longer declares anything.
|
|
46
47
|
*/
|
|
47
48
|
export declare function forgetDiscoveryOwner(projectRoot: string, ownerFile: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Drops what discovery from the declaration in `owner`, a real path, recorded as reached.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* The build plugin calls this with the module id the bundler reports, which is already a real path, so no
|
|
54
|
+
* path is resolved again.
|
|
55
|
+
*/
|
|
56
|
+
export declare function forgetCanonicalDiscoveryOwner(projectRoot: string, owner: string): void;
|
|
48
57
|
/**
|
|
49
58
|
* Whether the latest discovery of some Eco declaration of the app at `projectRoot` walked into `file`.
|
|
50
59
|
*
|
|
@@ -125,6 +134,8 @@ export type DiscoveredImports = {
|
|
|
125
134
|
file: string;
|
|
126
135
|
imported: string;
|
|
127
136
|
}>;
|
|
137
|
+
/** The `ecopages:` virtual modules the declaring module imports itself. */
|
|
138
|
+
virtualImports: EcopagesVirtualImport[];
|
|
128
139
|
watchFiles: string[];
|
|
129
140
|
removals: Array<{
|
|
130
141
|
start: number;
|
|
@@ -178,6 +189,8 @@ type PlainModuleWalk = {
|
|
|
178
189
|
export type DiscoveryCache = {
|
|
179
190
|
indexes: Map<string, ModuleIndex>;
|
|
180
191
|
walks: Map<string, PlainModuleWalk>;
|
|
192
|
+
/** The module a bare import resolves to from a folder, or `null` when discovery does not follow it. */
|
|
193
|
+
packageModules: Map<string, string | null>;
|
|
181
194
|
};
|
|
182
195
|
export declare function createDiscoveryCache(): DiscoveryCache;
|
|
183
196
|
/**
|
|
@@ -193,7 +206,7 @@ export declare function createDiscoveryCache(): DiscoveryCache;
|
|
|
193
206
|
* every walked plain module are recorded in `watchFiles` so their edits invalidate caches. Each stylesheet is
|
|
194
207
|
* listed once by real path, and `packageStylesheets` marks those a package import named.
|
|
195
208
|
* `export *`, dynamic imports, namespace imports, packages that ship no CSS Module, and `.server` modules are not
|
|
196
|
-
* followed.
|
|
209
|
+
* followed. `ownerFile` is a real path, as a bundler reports a module id, and every path discovery returns is one.
|
|
197
210
|
*/
|
|
198
211
|
export declare function discoverComponentImports(program: unknown, ownerFile: string, projectRoot: string, options?: DiscoveryOptions): DiscoveredImports;
|
|
199
212
|
export {};
|
|
@@ -4,6 +4,8 @@ import { parseModuleSource } from '../cache/module-parse-cache.js';
|
|
|
4
4
|
import { CSS_MODULE_PROCESSOR_FIX, PLAIN_CSS_KINDS } from './stylesheet-kinds.js';
|
|
5
5
|
import { contentHash } from '../utils/content-hash.js';
|
|
6
6
|
import { findPackageRoot } from '../utils/package-path.js';
|
|
7
|
+
import { isServerOnlyModuleSpecifier } from '../utils/file-roles.js';
|
|
8
|
+
import { collectEcopagesVirtualImports } from './ecopages-virtual-imports.js';
|
|
7
9
|
import { isBarePackageImportSpecifier, loadTsconfigPathPrefixes, matchesTsconfigPathPrefix, resolvePackageModulePath, resolvePackageStylesheetPath, resolveProjectModulePath, } from './tsconfig-import-resolver.js';
|
|
8
10
|
function node(value) {
|
|
9
11
|
return typeof value === 'object' && value !== null ? value : undefined;
|
|
@@ -55,9 +57,6 @@ export function declaresEcoFactory(program) {
|
|
|
55
57
|
});
|
|
56
58
|
return found;
|
|
57
59
|
}
|
|
58
|
-
function isServerSpecifier(source) {
|
|
59
|
-
return /\.server(?:\.[cm]?[jt]sx?)?$/.test(source);
|
|
60
|
-
}
|
|
61
60
|
function isLocalSpecifier(source, pathPrefixes) {
|
|
62
61
|
return source.startsWith('.') || matchesTsconfigPathPrefix(source, pathPrefixes);
|
|
63
62
|
}
|
|
@@ -291,8 +290,17 @@ function reachIn(projectRoot) {
|
|
|
291
290
|
* plugin for a module that no longer declares anything.
|
|
292
291
|
*/
|
|
293
292
|
export function forgetDiscoveryOwner(projectRoot, ownerFile) {
|
|
293
|
+
forgetCanonicalDiscoveryOwner(projectRoot, canonicalFile(ownerFile));
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Drops what discovery from the declaration in `owner`, a real path, recorded as reached.
|
|
297
|
+
*
|
|
298
|
+
* @remarks
|
|
299
|
+
* The build plugin calls this with the module id the bundler reports, which is already a real path, so no
|
|
300
|
+
* path is resolved again.
|
|
301
|
+
*/
|
|
302
|
+
export function forgetCanonicalDiscoveryOwner(projectRoot, owner) {
|
|
294
303
|
const reach = reachIn(projectRoot);
|
|
295
|
-
const owner = canonicalFile(ownerFile);
|
|
296
304
|
for (const module of reach.byOwner.get(owner) ?? []) {
|
|
297
305
|
const owners = reach.byModule.get(module);
|
|
298
306
|
owners?.delete(owner);
|
|
@@ -301,10 +309,9 @@ export function forgetDiscoveryOwner(projectRoot, ownerFile) {
|
|
|
301
309
|
}
|
|
302
310
|
reach.byOwner.delete(owner);
|
|
303
311
|
}
|
|
304
|
-
function recordDiscoveryOwner(projectRoot,
|
|
305
|
-
|
|
312
|
+
function recordDiscoveryOwner(projectRoot, owner, modules) {
|
|
313
|
+
forgetCanonicalDiscoveryOwner(projectRoot, owner);
|
|
306
314
|
const reach = reachIn(projectRoot);
|
|
307
|
-
const owner = canonicalFile(ownerFile);
|
|
308
315
|
const reached = new Set(modules);
|
|
309
316
|
reach.byOwner.set(owner, reached);
|
|
310
317
|
for (const module of reached) {
|
|
@@ -321,7 +328,7 @@ function recordDiscoveryOwner(projectRoot, ownerFile, modules) {
|
|
|
321
328
|
* again once its build is transformed, so a plain module reached from a declaration is recorded in time.
|
|
322
329
|
*/
|
|
323
330
|
export function isReachedByDiscovery(projectRoot, file) {
|
|
324
|
-
return reachIn(projectRoot).byModule.has(
|
|
331
|
+
return reachIn(projectRoot).byModule.has(file);
|
|
325
332
|
}
|
|
326
333
|
/**
|
|
327
334
|
* Whether discovery has seen `file`, as a module a declaration walked into or as a declaration itself.
|
|
@@ -467,10 +474,12 @@ export function createUndeliverablePackageStylesheetError(projectRoot, importer,
|
|
|
467
474
|
return new Error(`[ecopages] ${module}: ${JSON.stringify(source)} never reaches a Page, because no eco.page(), eco.layout(), eco.html() or eco.component() delivers the stylesheets a package module imports. List the stylesheet in eco.component({ dependencies: { stylesheets } }) of the component that uses the package.`);
|
|
468
475
|
}
|
|
469
476
|
export function createDiscoveryCache() {
|
|
470
|
-
return { indexes: new Map(), walks: new Map() };
|
|
477
|
+
return { indexes: new Map(), walks: new Map(), packageModules: new Map() };
|
|
471
478
|
}
|
|
472
479
|
function resolveReexport(file, reexport, state) {
|
|
473
|
-
if (!reexport ||
|
|
480
|
+
if (!reexport ||
|
|
481
|
+
isServerOnlyModuleSpecifier(reexport.source) ||
|
|
482
|
+
!isLocalSpecifier(reexport.source, state.pathPrefixes)) {
|
|
474
483
|
return undefined;
|
|
475
484
|
}
|
|
476
485
|
const resolved = resolveProjectModulePath(state.projectRoot, file, reexport.source, { preserveBarrel: true });
|
|
@@ -495,7 +504,7 @@ function isFactoryExport(file, exportName, state, pending = new Set()) {
|
|
|
495
504
|
return false;
|
|
496
505
|
pending.add(visitKey);
|
|
497
506
|
let result = false;
|
|
498
|
-
if (!file.includes(`/node_modules/`) && !
|
|
507
|
+
if (!file.includes(`/node_modules/`) && !isServerOnlyModuleSpecifier(file)) {
|
|
499
508
|
const { factories, namedReexports } = indexModule(file, state.cache);
|
|
500
509
|
if (factories.has(exportName)) {
|
|
501
510
|
result = true;
|
|
@@ -599,11 +608,20 @@ function assertSameIntegration(importer, local, component, renderedNames, state)
|
|
|
599
608
|
function followPackageImport(entry, importer, state) {
|
|
600
609
|
if (!isInNodeModules(importer) && !isBarePackageImportSpecifier(entry.source, state.projectRoot))
|
|
601
610
|
return undefined;
|
|
602
|
-
|
|
611
|
+
const cache = state.cache?.packageModules;
|
|
612
|
+
if (!cache)
|
|
613
|
+
return resolvePackageModule(importer, entry.source, state.stylesheets);
|
|
614
|
+
const key = `${path.dirname(importer)}\0${entry.source}`;
|
|
615
|
+
let module = cache.get(key);
|
|
616
|
+
if (module === undefined) {
|
|
617
|
+
module = resolvePackageModule(importer, entry.source, state.stylesheets) ?? null;
|
|
618
|
+
cache.set(key, module);
|
|
619
|
+
}
|
|
620
|
+
return module ?? undefined;
|
|
603
621
|
}
|
|
604
622
|
/** Whether `entry` imports a script module for its bindings or its side effects, not a stylesheet or a `.server` module. */
|
|
605
623
|
function isScriptEdge(entry, state) {
|
|
606
|
-
if (entry.attributed || state.stylesheets.isStylesheet(entry.source) ||
|
|
624
|
+
if (entry.attributed || state.stylesheets.isStylesheet(entry.source) || isServerOnlyModuleSpecifier(entry.source))
|
|
607
625
|
return false;
|
|
608
626
|
return entry.sideEffectOnly || entry.bindings.length > 0;
|
|
609
627
|
}
|
|
@@ -695,7 +713,7 @@ function walkPlainModule(file, state, inProgress) {
|
|
|
695
713
|
return { walk, pending: new Set() };
|
|
696
714
|
inProgress.add(file);
|
|
697
715
|
const local = { ...state, resolved: new Map(), watchFiles: walk.watchFiles };
|
|
698
|
-
walk.modules.add(
|
|
716
|
+
walk.modules.add(file);
|
|
699
717
|
walk.watchFiles.add(file);
|
|
700
718
|
collectWalkStylesheets(file, index.imports, local, walk);
|
|
701
719
|
const children = collectModuleEdges(file, index.imports, () => index.renderedNames, local, (binding, target) => {
|
|
@@ -766,7 +784,7 @@ function collectOwnStylesheets(imports, ownerFile, state, result) {
|
|
|
766
784
|
* every walked plain module are recorded in `watchFiles` so their edits invalidate caches. Each stylesheet is
|
|
767
785
|
* listed once by real path, and `packageStylesheets` marks those a package import named.
|
|
768
786
|
* `export *`, dynamic imports, namespace imports, packages that ship no CSS Module, and `.server` modules are not
|
|
769
|
-
* followed.
|
|
787
|
+
* followed. `ownerFile` is a real path, as a bundler reports a module id, and every path discovery returns is one.
|
|
770
788
|
*/
|
|
771
789
|
export function discoverComponentImports(program, ownerFile, projectRoot, options = {}) {
|
|
772
790
|
const result = {
|
|
@@ -775,6 +793,7 @@ export function discoverComponentImports(program, ownerFile, projectRoot, option
|
|
|
775
793
|
plainModuleStylesheets: [],
|
|
776
794
|
packageStylesheets: [],
|
|
777
795
|
plainModuleComponents: [],
|
|
796
|
+
virtualImports: [],
|
|
778
797
|
watchFiles: [],
|
|
779
798
|
removals: [],
|
|
780
799
|
};
|
|
@@ -790,6 +809,7 @@ export function discoverComponentImports(program, ownerFile, projectRoot, option
|
|
|
790
809
|
watchFiles: new Set(),
|
|
791
810
|
};
|
|
792
811
|
const imports = collectStaticImports(program);
|
|
812
|
+
result.virtualImports = collectEcopagesVirtualImports(imports);
|
|
793
813
|
const packageStylesheets = collectOwnStylesheets(imports, ownerFile, state, result);
|
|
794
814
|
let renderedNames;
|
|
795
815
|
const ownComponents = new Set();
|
|
@@ -805,7 +825,7 @@ export function discoverComponentImports(program, ownerFile, projectRoot, option
|
|
|
805
825
|
modules: new Set(),
|
|
806
826
|
watchFiles: new Set(),
|
|
807
827
|
};
|
|
808
|
-
const inProgress = new Set([
|
|
828
|
+
const inProgress = new Set([ownerFile]);
|
|
809
829
|
for (const file of plainModules) {
|
|
810
830
|
const { walk } = walkPlainModule(file, state, inProgress);
|
|
811
831
|
if (walk)
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { EcoPagesAppConfig } from '../config/internal-types.js';
|
|
2
2
|
import type { EcoBuildOnTransformResult, EcoBuildPlugin } from '../build/contracts/build-types.js';
|
|
3
|
+
import type { BuildEnvironment } from '../build/contracts/build-contracts.js';
|
|
3
4
|
import { type StylesheetKinds } from './stylesheet-kinds.js';
|
|
4
5
|
import { type DiscoveryCache, type DiscoveryOptions } from './component-import-discovery.js';
|
|
6
|
+
import type { ComponentIdentity } from '../types/component-identity.js';
|
|
5
7
|
/**
|
|
6
8
|
* Options for the plugin that attributes Eco Component identities.
|
|
7
9
|
*
|
|
@@ -11,6 +13,15 @@ import { type DiscoveryCache, type DiscoveryOptions } from './component-import-d
|
|
|
11
13
|
*/
|
|
12
14
|
export interface EcoComponentDirPluginOptions {
|
|
13
15
|
config: EcoPagesAppConfig;
|
|
16
|
+
/**
|
|
17
|
+
* The environment the build compiles for.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* A browser build gets no plain-module Component imports: only server-side collection reads the discovered
|
|
21
|
+
* Components, and in the browser such an import would load the Component's module for nothing, including one
|
|
22
|
+
* another Integration owns into a React island.
|
|
23
|
+
*/
|
|
24
|
+
environment: BuildEnvironment;
|
|
14
25
|
}
|
|
15
26
|
/**
|
|
16
27
|
* Whether the component meta transform moves the side-effect stylesheet imports of `filePath`
|
|
@@ -45,6 +56,13 @@ export type ComponentIdentityAttributionOptions = {
|
|
|
45
56
|
discoveryCache?: DiscoveryCache;
|
|
46
57
|
/** The stylesheets the build delivers; defaults to plain `.css`. */
|
|
47
58
|
stylesheets?: StylesheetKinds;
|
|
59
|
+
/** The real path of `projectRoot`, when the caller already resolved it; resolved from `projectRoot` otherwise. */
|
|
60
|
+
canonicalProjectRoot?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Whether the discovered Components of plain modules are imported into the declaring module so collection can
|
|
63
|
+
* read them; defaults to `true`. A browser build turns it off, since nothing there reads them.
|
|
64
|
+
*/
|
|
65
|
+
plainModuleComponentImports?: boolean;
|
|
48
66
|
};
|
|
49
67
|
/**
|
|
50
68
|
* Attributes real `eco.*()` factory calls with canonical component identity.
|
|
@@ -58,6 +76,23 @@ export type ComponentIdentityAttributionOptions = {
|
|
|
58
76
|
* loses its side-effect stylesheet imports (see {@link stripPlainModuleStylesheetImports}).
|
|
59
77
|
*/
|
|
60
78
|
export declare function attributeComponentIdentity(contents: string, filePath: string, options: ComponentIdentityAttributionOptions): EcoBuildOnTransformResult;
|
|
79
|
+
/**
|
|
80
|
+
* Reads, without transforming the module, the identity of each export whose value is an `eco.*()` call.
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* The identities are the ones {@link attributeComponentIdentity} binds when it builds the same source, so a
|
|
84
|
+
* browser graph can name a Component another Integration owns without importing its module. An export counts only
|
|
85
|
+
* when its value is the call itself: `export const X = eco.component(...)`, `export default eco.component(...)`, or
|
|
86
|
+
* a top-level `const` holding the call that an `export { local as name }` or `export default local` names. A value
|
|
87
|
+
* a function returns, or any other expression, has no entry, and so does a module that does not parse. A call whose
|
|
88
|
+
* options are not an object literal, or set `integration` or spread another object, has no entry either, since its
|
|
89
|
+
* Component may belong to another Integration than the file.
|
|
90
|
+
* `filePath` is compared as given, so pass the real path the bundler reports.
|
|
91
|
+
*/
|
|
92
|
+
export declare function readExportedComponentIdentities(contents: string, filePath: string, options: {
|
|
93
|
+
integration: string;
|
|
94
|
+
projectRoot: string;
|
|
95
|
+
}): Map<string, ComponentIdentity>;
|
|
61
96
|
/**
|
|
62
97
|
* Attributes a compiled MDX module with canonical component identity and discovered dependencies.
|
|
63
98
|
*
|
|
@@ -81,6 +116,9 @@ export declare function attributeMdxComponentIdentity(contents: string, filePath
|
|
|
81
116
|
* discovery has reached it, and it never fails the reach check. A build can transform a
|
|
82
117
|
* plain module before the declaration that imports it, so the check that a declaration reached each
|
|
83
118
|
* module that lost a stylesheet import runs once the whole build is transformed.
|
|
119
|
+
*
|
|
120
|
+
* A transform id is the bundler's resolved module path, so symbolic links are already resolved and the app-root
|
|
121
|
+
* check compares it as it is.
|
|
84
122
|
*/
|
|
85
123
|
export declare function createEcoComponentMetaPlugin(options: EcoComponentDirPluginOptions): EcoBuildPlugin;
|
|
86
124
|
export default createEcoComponentMetaPlugin;
|