@jay-framework/production-build 0.24.2 → 0.24.4

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -11
  2. package/package.json +14 -14
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import fs from "node:fs/promises";
7
7
  import { createRequire } from "node:module";
8
8
  import { DevSlowlyChangingPhase, slowRenderInstances, scanPlugins, runLoadParams } from "@jay-framework/stack-server-runtime";
9
9
  import { parseJayFile, JAY_IMPORT_RESOLVER, injectHeadfullFSTemplates, assignCoordinatesToJayHtml, discoverHeadlessInstances, generateElementHydrateFile, generateServerElementFile } from "@jay-framework/compiler-jay-html";
10
- import { checkValidationErrors, RuntimeMode } from "@jay-framework/compiler-shared";
10
+ import { checkValidationErrors, normalizeActionEntry, RuntimeMode } from "@jay-framework/compiler-shared";
11
11
  import crypto, { createHash } from "node:crypto";
12
12
  import { generateSitemap } from "@jay-framework/production-server";
13
13
  export * from "@jay-framework/production-server";
@@ -597,16 +597,18 @@ async function discoverActions(actionPaths, serverOutputDir, buildDir, projectRo
597
597
  plugins.push({ name: plugin.manifest.name, packageName });
598
598
  const pluginActions = plugin.manifest.actions;
599
599
  if (pluginActions && pluginActions.length > 0) {
600
- actions.push({
601
- serverModule: "",
602
- packageName,
603
- isPlugin: true,
604
- actionNames: pluginActions.map(
605
- (a) => typeof a === "string" ? a : a.name
606
- )
607
- });
600
+ const productionActions = pluginActions.map(normalizeActionEntry).filter((a) => !a.devOnly);
601
+ const devOnlyCount = pluginActions.length - productionActions.length;
602
+ if (productionActions.length > 0) {
603
+ actions.push({
604
+ serverModule: "",
605
+ packageName,
606
+ isPlugin: true,
607
+ actionNames: productionActions.map((a) => a.name)
608
+ });
609
+ }
608
610
  getLogger().info(
609
- `[Build] Plugin actions from ${packageName}: ${pluginActions.length}`
611
+ `[Build] Plugin actions from ${packageName}: ${productionActions.length}` + (devOnlyCount > 0 ? ` (excluded ${devOnlyCount} devOnly)` : "")
610
612
  );
611
613
  }
612
614
  }
@@ -1254,7 +1256,13 @@ async function buildVersion(options) {
1254
1256
  clientInits
1255
1257
  };
1256
1258
  const pluginRoutes = await scanPluginRoutes(options.projectRoot, routes);
1257
- const allRoutes = [...routes, ...pluginRoutes];
1259
+ const excludedDevOnly = [...routes, ...pluginRoutes].filter((route) => route.devOnly);
1260
+ if (excludedDevOnly.length > 0) {
1261
+ logger.info(
1262
+ `[Build] Excluding ${excludedDevOnly.length} devOnly route(s) from production: ` + excludedDevOnly.map((r) => r.rawRoute).join(", ")
1263
+ );
1264
+ }
1265
+ const allRoutes = [...routes, ...pluginRoutes].filter((route) => !route.devOnly);
1258
1266
  const routeEntries = allRoutes.map((route) => {
1259
1267
  let serverModule = "";
1260
1268
  if (route.compPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/production-build",
3
- "version": "0.24.2",
3
+ "version": "0.24.4",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,22 +20,22 @@
20
20
  "test:watch": "vitest"
21
21
  },
22
22
  "dependencies": {
23
- "@jay-framework/compiler-jay-html": "^0.24.2",
24
- "@jay-framework/compiler-jay-stack": "^0.24.2",
25
- "@jay-framework/compiler-shared": "^0.24.2",
26
- "@jay-framework/fullstack-component": "^0.24.2",
27
- "@jay-framework/logger": "^0.24.2",
28
- "@jay-framework/production-server": "^0.24.2",
29
- "@jay-framework/ssr-runtime": "^0.24.2",
30
- "@jay-framework/stack-route-scanner": "^0.24.2",
31
- "@jay-framework/stack-server-build": "^0.24.2",
32
- "@jay-framework/stack-server-runtime": "^0.24.2",
33
- "@jay-framework/view-state-merge": "^0.24.2",
34
- "@jay-framework/vite-plugin": "^0.24.2",
23
+ "@jay-framework/compiler-jay-html": "^0.24.4",
24
+ "@jay-framework/compiler-jay-stack": "^0.24.4",
25
+ "@jay-framework/compiler-shared": "^0.24.4",
26
+ "@jay-framework/fullstack-component": "^0.24.4",
27
+ "@jay-framework/logger": "^0.24.4",
28
+ "@jay-framework/production-server": "^0.24.4",
29
+ "@jay-framework/ssr-runtime": "^0.24.4",
30
+ "@jay-framework/stack-route-scanner": "^0.24.4",
31
+ "@jay-framework/stack-server-build": "^0.24.4",
32
+ "@jay-framework/stack-server-runtime": "^0.24.4",
33
+ "@jay-framework/view-state-merge": "^0.24.4",
34
+ "@jay-framework/vite-plugin": "^0.24.4",
35
35
  "vite": "^5.0.11"
36
36
  },
37
37
  "devDependencies": {
38
- "@jay-framework/dev-environment": "^0.24.2",
38
+ "@jay-framework/dev-environment": "^0.24.4",
39
39
  "@types/node": "^22.15.21",
40
40
  "rimraf": "^5.0.5",
41
41
  "tsup": "^8.0.1",