@ecopages/core 0.2.0-alpha.51 → 0.2.0-alpha.52

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecopages/core",
3
- "version": "0.2.0-alpha.51",
3
+ "version": "0.2.0-alpha.52",
4
4
  "description": "Core package for Ecopages",
5
5
  "keywords": [
6
6
  "ecopages",
@@ -17,7 +17,7 @@
17
17
  "directory": "packages/core"
18
18
  },
19
19
  "dependencies": {
20
- "@ecopages/file-system": "0.2.0-alpha.51",
20
+ "@ecopages/file-system": "0.2.0-alpha.52",
21
21
  "@ecopages/logger": "^0.2.3",
22
22
  "@ecopages/scripts-injector": "^0.1.5",
23
23
  "@worker-tools/html-rewriter": "0.1.0-pre.19",
@@ -177,6 +177,7 @@ class SharedHmrManager {
177
177
  getPagesDir: () => this.appConfig.absolutePaths.pagesDir,
178
178
  getBuildExecutor: () => getAppBuildExecutor(this.appConfig),
179
179
  getBrowserBundleService: () => this.browserBundleService,
180
+ getEntrypointDependencyGraph: () => this.entrypointDependencyGraph,
180
181
  importServerModule: async (filePath) => await this.serverModuleTranspiler.importModule({
181
182
  filePath,
182
183
  outdir: path.join(resolveInternalExecutionDir(this.appConfig), ".server-modules"),
@@ -138,6 +138,9 @@ function createBrowserRuntimeImportRewritePlugin(options) {
138
138
  return void 0;
139
139
  }
140
140
  const code = readFileSync(args.path, "utf-8");
141
+ if (!Array.from(specifierMap.keys()).some((specifier) => code.includes(specifier))) {
142
+ return void 0;
143
+ }
141
144
  const rewritten = rewriteBrowserRuntimeImports(code, specifierMap, args.path);
142
145
  if (rewritten === code) {
143
146
  return void 0;
@@ -10,6 +10,7 @@ import type { BrowserBundleExecutor } from '../services/assets/browser-bundle.se
10
10
  import type { AssetDefinition, ProcessedAsset } from '../services/assets/asset-processing-service/assets.types.js';
11
11
  import type { CacheStats, CacheStrategy } from '../services/cache/cache.types.js';
12
12
  import type { InteractionEventsString as ScriptsInjectorInteractionEventsString } from '@ecopages/scripts-injector/types';
13
+ import type { EntrypointDependencyGraph } from '../services/runtime-state/entrypoint-dependency-graph.service.js';
13
14
  export type { EcoPagesAppConfig } from './internal-types.js';
14
15
  export type { EcoPageComponent } from '../eco/eco.types.js';
15
16
  export type { ProcessedAsset } from '../services/assets/asset-processing-service/assets.types.js';
@@ -128,6 +129,10 @@ export interface DefaultHmrContext {
128
129
  * Server-side module loader owned by the active app/runtime.
129
130
  */
130
131
  importServerModule<T = unknown>(filePath: string | URL): Promise<T>;
132
+ /**
133
+ * Entrypoint dependency graph for selective HMR invalidation.
134
+ */
135
+ getEntrypointDependencyGraph(): EntrypointDependencyGraph;
131
136
  }
132
137
  /**
133
138
  * Represents an event broadcast to connected clients via the ClientBridge.