Commit 02c3d41
authored
refactor(docs): consume @uxfront/layer-docs package instead of local shared layer (#327)
* refactor(docs): consume @uxfront/docs-theme package instead of local shared layer
Re-point apps/docs from the local `apps/shared` Nuxt layer onto the
published `@uxfront/docs-theme@0.1.0` package. Branding stays entirely in
the app's own config: header/footer links move into app.config.ts, the
teal palette remains in main.css. Drop the 13 shell components that the
theme layer now provides, register `nuxt-og-image` locally (the theme
does not ship it), and add a `header.links` CustomAppConfig type.
apps/shared is retained (still extended by apps/app), so the layer is
reduced to brand-only overrides rather than removed.
Workaround for a packaging bug in @uxfront/docs-theme@0.1.0: its `files`
array omits `i18n/`, but `app/composables/useDocusI18n.ts` statically
imports `../../i18n/locales/en.json`, breaking the build. Kept local
`useDocusI18n.ts` + `AppHeader.vue` (explicit relative import) and a
`useDocusI18nOverride` module (auto-import consumers) as a shim until the
package ships 0.1.1 with i18n included.
Build parity verified: `nuxt generate` prerenders 638 routes (== baseline),
identical HTML route set, teal palette compiled.
* fix(docs): restore Tailwind entry so brand @theme compiles to :root vars
The re-point removed the `@import` that made `apps/docs/.../main.css` a
Tailwind entry. A `@theme` block only compiles into real `:root` custom
properties when it lives in a Tailwind-processed file; without the import
the `@theme static { --color-teal … }` block was emitted verbatim and
browsers discard the unknown at-rule. Result: `--color-teal`/`--ui-primary`
resolved to nothing and every `*-primary` utility fell back to
black/transparent site-wide (P1, all routes).
Re-add `@import "tailwindcss";` plus consumer-scoped `@source` lines (the
theme package's own `@source` paths are package-relative and never see the
consumer's content/app.config).
Verified on the emitted entry CSS: literal `@theme` count 0 (was 1),
`--color-teal:#318fa0` compiled under `:host,:root`,
`:root{--ui-primary:var(--color-teal)}`, `.text-primary` → teal.
* test(docs): guard brand @theme is a Tailwind entry (regression for #327)
Adds a source-invariant vitest for apps/docs/app/assets/css/main.css: the
brand palette file must import tailwindcss (before its @theme block) so the
teal @theme compiles into real :root custom properties. Without it the block
ships verbatim and browsers discard it, dropping --color-teal/--ui-primary and
every *-primary utility site-wide (the P1 regressed by the @uxfront/docs-theme
re-point, fixed in 56b8d7d).
Fails on the pre-fix file, passes on the fix. Also wires apps/docs into
`turbo run test` via a `test` script + vitest config.
* fix(docs): type theme header/footer app config surface
The consumed @uxfront/docs-theme@0.1.0 reads appConfig.header.*,
footer.credits and footer.links in its layer components but declares
none of them, so the re-point onto the published package regressed
`nuxt typecheck` (green on main only via the locally-typed apps/shared
layer). Declare the brand config surface with optional shapes so the
keys are not forced onto AppConfigInput (which extends CustomAppConfig)
— a non-optional key would break the package's own defineAppConfig.
Clears the footer.* and AppConfigInput errors and removes the
AppConfigInput regression introduced by the prior non-optional
declaration. header.links remains unresolvable consumer-side: the theme
seeds `header` into inlineConfig, so the resolved AppConfig returns
{ title, logo } and the generated MergedAppConfig ignores this
augmentation for that key. Tracked for the theme 0.1.1 typing fix.
* fix(docs): consume @uxfront/docs-theme@0.1.1 and drop redundant config shim
0.1.1 ships the previously-missing `i18n/` and `server/` directories and
types the theme's `footer` / app-config surface, so the local
`app/types/app-config.ts` augmentation that patched those errors is no
longer needed — removed it. Verified against a clean typecheck: with the
shim gone, `footer.*` and the AppConfigInput error stay resolved.
Build parity holds: `nuxt generate` prerenders all 659 routes; the brand
palette is app-local (main.css) and unaffected by the bump.
One typecheck error remains and is not fixable in this app:
AppHeaderCTA.vue reads `appConfig.header.links`, but the theme's config
module seeds a partial `header` into inlineConfig, so defu's *type* drops
the array-valued `links` during the deep object merge (footer survives
only because it is taken wholesale, not seeded). Needs a theme-side fix.
* refactor(docs): re-point docs layer to renamed @uxfront/layer-docs
The theme package was renamed @uxfront/docs-theme → @uxfront/layer-docs
out-of-band. Propagate the rename across the docs app: dependency in
package.json (pinned ^0.1.0, the only published version under the new name),
the nuxt.config `extends` entry, and the layer-name references in config,
CSS, and test comments. layer-docs@0.1.0 already carries the header.links
typecheck fix, so nuxt typecheck is green and generate parity holds (659
routes).1 parent ebcc20f commit 02c3d41
25 files changed
Lines changed: 403 additions & 426 deletions
File tree
- .github/workflows
- apps/docs
- app
- assets/css
- components
- app
- docs
- modules
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
25 | 42 | | |
26 | 43 | | |
27 | 44 | | |
| |||
39 | 56 | | |
40 | 57 | | |
41 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
42 | 74 | | |
43 | 75 | | |
44 | 76 | | |
| |||
83 | 115 | | |
84 | 116 | | |
85 | 117 | | |
86 | | - | |
| 118 | + | |
87 | 119 | | |
88 | 120 | | |
89 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
2 | 28 | | |
3 | 29 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
7 | 33 | | |
8 | 34 | | |
9 | 35 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments