From 10e7ab0a8e6eed61822dd201d79c3d6ccb2193b3 Mon Sep 17 00:00:00 2001 From: Caio Pizzol Date: Mon, 4 May 2026 21:23:14 -0300 Subject: [PATCH] fix(types): drain shims for layout-engine and useUiFontFamily (SD-2893) Two cheap-win follow-ups to the D1 relocation. Shim count: 6 to 4. useUiFontFamily: the bare @superdoc/composables/useUiFontFamily.js specifier only appeared inside a JSDoc @example block. The example was also misleading; this composable is not exported from any public entry, so a consumer cannot use the shown import. Removing the example clears the shim without changing public API. @superdoc/layout-engine: relocate via the same D1 pattern as contracts and layout-bridge. layout-engine only imports from @superdoc/contracts (already relocated), so a full src/**/* glob is safe and does not pull additional internal packages into the declaration graph. Remaining shims: @superdoc/common, common/components/BasicUpload.vue, common/list-marker-utils, style-engine/ooxml. Each needs more evaluation than a cheap-win slice. --- .../superdoc/scripts/audit-declarations.cjs | 1 + packages/superdoc/scripts/ensure-types.cjs | 2 ++ .../superdoc/src/composables/useUiFontFamily.js | 17 ----------------- packages/superdoc/tsconfig.json | 1 + packages/superdoc/vite.config.js | 1 + 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/packages/superdoc/scripts/audit-declarations.cjs b/packages/superdoc/scripts/audit-declarations.cjs index 592a314614..93980302f1 100644 --- a/packages/superdoc/scripts/audit-declarations.cjs +++ b/packages/superdoc/scripts/audit-declarations.cjs @@ -69,6 +69,7 @@ const RELOCATION_GUARD_PACKAGES = [ '@superdoc/contracts', '@superdoc/dom-contract', '@superdoc/layout-bridge', + '@superdoc/layout-engine', '@superdoc/painter-dom', '@superdoc/pm-adapter', ]; diff --git a/packages/superdoc/scripts/ensure-types.cjs b/packages/superdoc/scripts/ensure-types.cjs index 1f5ede147d..7b0e79c828 100644 --- a/packages/superdoc/scripts/ensure-types.cjs +++ b/packages/superdoc/scripts/ensure-types.cjs @@ -219,6 +219,7 @@ const RELOCATION_RULES = [ { pkg: '@superdoc/contracts', distEntry: 'layout-engine/contracts/src/index.d.ts', matchSubpaths: true }, { pkg: '@superdoc/dom-contract', distEntry: 'layout-engine/dom-contract/src/index.d.ts', matchSubpaths: true }, { pkg: '@superdoc/layout-bridge', distEntry: 'layout-engine/layout-bridge/src/index.d.ts', matchSubpaths: true }, + { pkg: '@superdoc/layout-engine', distEntry: 'layout-engine/layout-engine/src/index.d.ts', matchSubpaths: true }, { pkg: '@superdoc/painter-dom', distEntry: 'layout-engine/painters/dom/src/index.d.ts', matchSubpaths: true }, { pkg: '@superdoc/pm-adapter/converter-context.js', @@ -241,6 +242,7 @@ const RELOCATION_GUARD_PACKAGES = [ '@superdoc/contracts', '@superdoc/dom-contract', '@superdoc/layout-bridge', + '@superdoc/layout-engine', '@superdoc/painter-dom', '@superdoc/pm-adapter', ]; diff --git a/packages/superdoc/src/composables/useUiFontFamily.js b/packages/superdoc/src/composables/useUiFontFamily.js index 824a2a95c4..76f75cdbad 100644 --- a/packages/superdoc/src/composables/useUiFontFamily.js +++ b/packages/superdoc/src/composables/useUiFontFamily.js @@ -21,23 +21,6 @@ export const DEFAULT_UI_FONT_FAMILY = 'Arial, Helvetica, sans-serif'; * * @returns {{ uiFontFamily: import('vue').ComputedRef }} An object containing: * - uiFontFamily: A computed reference to the UI font-family string - * - * @example - * // In a Vue component - * import { useUiFontFamily } from '@superdoc/composables/useUiFontFamily.js'; - * - * export default { - * setup() { - * const { uiFontFamily } = useUiFontFamily(); - * - * // Use in template or computed styles - * return { uiFontFamily }; - * } - * } - * - * @example - * // In a template - * */ export function useUiFontFamily() { const instance = getCurrentInstance(); diff --git a/packages/superdoc/tsconfig.json b/packages/superdoc/tsconfig.json index 28953bb9a9..00ea821601 100644 --- a/packages/superdoc/tsconfig.json +++ b/packages/superdoc/tsconfig.json @@ -29,6 +29,7 @@ "../layout-engine/contracts/src", "../layout-engine/dom-contract/src", "../layout-engine/layout-bridge/src", + "../layout-engine/layout-engine/src", "../layout-engine/painters/dom/src", "../layout-engine/pm-adapter/src/converter-context.ts", "../layout-engine/pm-adapter/src/sections/types.ts" diff --git a/packages/superdoc/vite.config.js b/packages/superdoc/vite.config.js index 74e572d256..f45fe8f863 100644 --- a/packages/superdoc/vite.config.js +++ b/packages/superdoc/vite.config.js @@ -132,6 +132,7 @@ export default defineConfig(({ mode, command }) => { '../layout-engine/contracts/src/**/*', '../layout-engine/dom-contract/src/**/*', '../layout-engine/layout-bridge/src/**/*', + '../layout-engine/layout-engine/src/**/*', '../layout-engine/painters/dom/src/**/*', // SD-2893: pm-adapter is included file-by-file (not via `src/**/*`) // because the full barrel pulls in @superdoc/style-engine and other