@jay-framework/dev-server 0.24.7 → 0.25.1

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 +2 -16
  2. package/package.json +15 -15
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import { createRequire as createRequire$1 } from "node:module";
13
13
  import * as fs from "node:fs";
14
14
  import fs__default$1 from "node:fs";
15
15
  import { scanRoutes, createRoute, routeToExpressRoute } from "@jay-framework/stack-route-scanner";
16
- import { makePassthroughInstanceComponent, actionRegistry, scanPlugins, serializeHeadTags, mergeHeadTags, discoverPluginsWithInit, sortPluginsByDependencies, executePluginServerInits, runInitCallbacks, runShutdownCallbacks, clearLifecycleCallbacks, clearServiceRegistry, clearClientInitData, runLoadParams, DevSlowlyChangingPhase, preparePluginClientInits, registerService, getServiceRegistry, parseCookies, renderFastChangingData, getClientInitData, slowRenderInstances, normalizeInstancePropNames } from "@jay-framework/stack-server-runtime";
16
+ import { makePassthroughInstanceComponent, actionRegistry, scanPlugins, serializeHeadTags, mergeHeadTags, serializeScripts, discoverPluginsWithInit, sortPluginsByDependencies, executePluginServerInits, runInitCallbacks, runShutdownCallbacks, clearLifecycleCallbacks, clearServiceRegistry, clearClientInitData, runLoadParams, DevSlowlyChangingPhase, preparePluginClientInits, registerService, getServiceRegistry, parseCookies, renderFastChangingData, getClientInitData, slowRenderInstances, normalizeInstancePropNames } from "@jay-framework/stack-server-runtime";
17
17
  import * as fs$1 from "node:fs/promises";
18
18
  import fs__default from "node:fs/promises";
19
19
  import jsBeautify from "js-beautify";
@@ -2307,8 +2307,7 @@ async function generateSSRPageHtml(vite, jayHtmlContent, jayHtmlFilename, jayHtm
2307
2307
  const tagSources = [];
2308
2308
  if (headTags && headTags.length > 0) tagSources.push(headTags);
2309
2309
  const headMetaTags = headMetaToHeadTags(cached.headMeta, viewState);
2310
- if (headMetaTags.length > 0) tagSources.push(headMetaTags);
2311
- const mergedTags = mergeHeadTags(tagSources);
2310
+ const mergedTags = mergeHeadTags(tagSources, headMetaTags);
2312
2311
  const hasCustomTitle = mergedTags.some((t) => t.tag.toLowerCase() === "title");
2313
2312
  const titleTag = hasCustomTitle ? "" : " <title>Vite + TS</title>\n";
2314
2313
  const headTagsHtml = mergedTags.length > 0 ? serializeHeadTags(mergedTags) : "";
@@ -2403,19 +2402,6 @@ ${headExtras ? headExtras + "\n" : ""} <style>
2403
2402
  </body>
2404
2403
  </html>`;
2405
2404
  }
2406
- function serializeScripts(scripts, position) {
2407
- if (!scripts) return "";
2408
- const filtered = scripts.filter((s2) => s2.position === position);
2409
- if (filtered.length === 0) return "";
2410
- return filtered.map((s2) => {
2411
- const attrs = Object.entries(s2.attributes).map(([k, v]) => v === "" ? k : `${k}="${v}"`).join(" ");
2412
- const attrStr = attrs ? " " + attrs : "";
2413
- if (s2.src) {
2414
- return ` <script src="${s2.src}"${attrStr}><\/script>`;
2415
- }
2416
- return ` <script${attrStr}>${s2.inline}<\/script>`;
2417
- }).join("\n");
2418
- }
2419
2405
  function rebaseRelativeImports(code, fromDir, toDir) {
2420
2406
  return code.replace(/from "(\.\.\/[^"]+)"/g, (_match, relPath) => {
2421
2407
  const absolutePath = path__default.resolve(fromDir, relPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/dev-server",
3
- "version": "0.24.7",
3
+ "version": "0.25.1",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -23,24 +23,24 @@
23
23
  "test:watch": "vitest"
24
24
  },
25
25
  "dependencies": {
26
- "@jay-framework/compiler-jay-stack": "^0.24.7",
27
- "@jay-framework/compiler-shared": "^0.24.7",
28
- "@jay-framework/component": "^0.24.7",
29
- "@jay-framework/fullstack-component": "^0.24.7",
30
- "@jay-framework/logger": "^0.24.7",
31
- "@jay-framework/runtime": "^0.24.7",
32
- "@jay-framework/stack-client-runtime": "^0.24.7",
33
- "@jay-framework/stack-route-scanner": "^0.24.7",
34
- "@jay-framework/stack-server-build": "^0.24.7",
35
- "@jay-framework/stack-server-runtime": "^0.24.7",
36
- "@jay-framework/view-state-merge": "^0.24.7",
26
+ "@jay-framework/compiler-jay-stack": "^0.25.1",
27
+ "@jay-framework/compiler-shared": "^0.25.1",
28
+ "@jay-framework/component": "^0.25.1",
29
+ "@jay-framework/fullstack-component": "^0.25.1",
30
+ "@jay-framework/logger": "^0.25.1",
31
+ "@jay-framework/runtime": "^0.25.1",
32
+ "@jay-framework/stack-client-runtime": "^0.25.1",
33
+ "@jay-framework/stack-route-scanner": "^0.25.1",
34
+ "@jay-framework/stack-server-build": "^0.25.1",
35
+ "@jay-framework/stack-server-runtime": "^0.25.1",
36
+ "@jay-framework/view-state-merge": "^0.25.1",
37
37
  "busboy": "^1.6.0",
38
38
  "vite": "^5.0.11"
39
39
  },
40
40
  "devDependencies": {
41
- "@jay-framework/dev-environment": "^0.24.7",
42
- "@jay-framework/jay-cli": "^0.24.7",
43
- "@jay-framework/stack-client-runtime": "^0.24.7",
41
+ "@jay-framework/dev-environment": "^0.25.1",
42
+ "@jay-framework/jay-cli": "^0.25.1",
43
+ "@jay-framework/stack-client-runtime": "^0.25.1",
44
44
  "@playwright/test": "^1.58.2",
45
45
  "@types/busboy": "^1.5.4",
46
46
  "@types/express": "^5.0.2",