@stacksjs/stx 0.2.180 → 0.2.182

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.
@@ -1,6 +1,7 @@
1
1
  import path from "node:path";
2
2
  import { getPublicEnvDefine } from "./public-env.js";
3
3
  import { SERVER_ONLY_COMPOSABLES } from "./unresolved-identifiers.js";
4
+ import { getSharedTranspiler } from "./utils.js";
4
5
  const _cache = new Map, RUNTIME_OWNED = new Set, SERVER_ONLY = new Set(SERVER_ONLY_COMPOSABLES);
5
6
  export function clearFrameworkComposableCache() {
6
7
  _cache.clear();
@@ -47,7 +48,7 @@ export async function getFrameworkComposableScript(source, composablesDir) {
47
48
  const dir = composablesDir ?? path.join(import.meta.dir, "composables"), key = `${dir}\x00${names.join(",")}`, cached = _cache.get(key);
48
49
  if (cached !== void 0)
49
50
  return cached || null;
50
- const transpiler = new Bun.Transpiler({ loader: "ts", target: "browser", define: getPublicEnvDefine() }), wanted = new Set(names), chunks = [], emitted = new Set;
51
+ const transpiler = getSharedTranspiler({ loader: "ts", target: "browser", define: getPublicEnvDefine() }), wanted = new Set(names), chunks = [], emitted = new Set;
51
52
  let files = [];
52
53
  try {
53
54
  const glob = new Bun.Glob("*.{ts,js}");
package/dist/process.js CHANGED
@@ -41,7 +41,7 @@ import { processDynamicComponents } from "./dynamic-components.js";
41
41
  import { dedupeScopedStyles, processScopedStyles } from "./style-scoping.js";
42
42
  import { injectColorModeBootScript, normalizeCriticalHeadOrder } from "./color-mode-boot.js";
43
43
  import { injectBuildId } from "./build-id.js";
44
- import { applyHtmlAttrs, ensureDocumentShell, hasDocumentShell, injectCloakStyle, injectConfigHeadTags, mergeHtmlAttrs, startsDocument } from "./document-shell.js";
44
+ import { applyHtmlAttrs, ensureDocumentShell, hasDocumentShell, injectCloakStyle, injectConfigHeadTags, mergeHtmlAttrs, metaDedupKey, startsDocument } from "./document-shell.js";
45
45
  import { hasSignalsSyntax, convertSignalDirectivesToAttributes, convertSignalLoopsToAttributes, preEvalLiteralReactiveIfs, processSignals } from "./signal-processing.js";
46
46
  import { processComponents } from "./component-renderer.js";
47
47
  import { processInlineAssets } from "./inline-assets.js";
@@ -275,10 +275,13 @@ export async function processDirectives(template, context, filePath, options, de
275
275
  pageHeadTitle = rawTitleMatch[1].trim();
276
276
  pageHeadRaw = pageHeadRaw.replace(rawTitleMatch[0], "").trim();
277
277
  }
278
- const sectionTitle = context.__sections?.title, pageTitle = runtimeHead.title || pageHeadTitle || sectionTitle, titleIsHtml = !runtimeHead.title && (!!pageHeadTitle || !!sectionTitle), headConfig = {
278
+ const sectionTitle = context.__sections?.title, pageTitle = runtimeHead.title || pageHeadTitle || sectionTitle, titleIsHtml = !runtimeHead.title && (!!pageHeadTitle || !!sectionTitle), runtimeMeta = runtimeHead.meta || [], overriddenMetaKeys = new Set(runtimeMeta.map((m) => metaDedupKey(m)).filter(Boolean)), headConfig = {
279
279
  ...baseHeadConfig,
280
280
  ...pageTitle && { title: pageTitle },
281
- meta: [...baseHeadConfig.meta || [], ...runtimeHead.meta || []],
281
+ meta: [
282
+ ...(baseHeadConfig.meta || []).filter((m) => !overriddenMetaKeys.has(metaDedupKey(m))),
283
+ ...runtimeMeta
284
+ ],
282
285
  link: [...baseHeadConfig.link || [], ...runtimeHead.link || []],
283
286
  script: [...baseHeadConfig.script || [], ...runtimeHead.script || []],
284
287
  headRaw: [baseHeadConfig.headRaw, pageHeadRaw].filter(Boolean).join(`