@sntlr/registry-shell 1.0.0 → 1.1.0

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 (36) hide show
  1. package/README.md +2 -5
  2. package/dist/adapter/custom.d.ts +1 -1
  3. package/dist/adapter/default.d.ts +3 -3
  4. package/dist/adapter/default.js +3 -3
  5. package/dist/cli/init.js +0 -3
  6. package/dist/cli/init.js.map +1 -1
  7. package/dist/cli/shared.js +0 -5
  8. package/dist/cli/shared.js.map +1 -1
  9. package/dist/config-loader.d.ts +0 -2
  10. package/dist/config-loader.js +0 -1
  11. package/dist/define-config.d.ts +0 -6
  12. package/package.json +1 -1
  13. package/src/adapter/custom.ts +1 -1
  14. package/src/adapter/default.ts +3 -3
  15. package/src/cli/init.ts +0 -3
  16. package/src/cli/shared.ts +0 -4
  17. package/src/config-loader.ts +0 -3
  18. package/src/define-config.ts +0 -7
  19. package/src/next-app/app/globals.css +329 -329
  20. package/src/next-app/app/page.tsx +1 -1
  21. package/src/next-app/components/component-icon.tsx +140 -140
  22. package/src/next-app/components/heading-anchor.tsx +52 -52
  23. package/src/next-app/{fallback → components}/homepage.tsx +2 -3
  24. package/src/next-app/components/navigation-progress.tsx +62 -62
  25. package/src/next-app/components/resizable-preview.tsx +101 -101
  26. package/src/next-app/components/sidebar-provider.tsx +75 -75
  27. package/src/next-app/hooks/use-controls.ts +72 -72
  28. package/src/next-app/lib/i18n.tsx +630 -630
  29. package/src/next-app/lib/registry-adapter.ts +6 -32
  30. package/src/next-app/lib/utils.ts +6 -6
  31. package/src/next-app/next-env.d.ts +6 -6
  32. package/src/next-app/next.config.ts +0 -5
  33. package/src/next-app/postcss.config.mjs +7 -7
  34. package/src/next-app/user-aliases.d.ts +0 -7
  35. package/src/next-app/app/_user-global.css +0 -6
  36. package/src/next-app/app/_user-sources.css +0 -9
@@ -54,7 +54,7 @@ export interface PreviewLoader {
54
54
  load(name: string): ComponentType | null
55
55
  }
56
56
 
57
- /** Props the shell passes to an optional custom `HomePage` component. */
57
+ /** Props the shell passes to the built-in homepage component. */
58
58
  export interface HomePageProps {
59
59
  /** Slug of the first doc (lowest `order`), so the homepage can link to it. */
60
60
  firstDocSlug?: string
@@ -97,34 +97,6 @@ export interface BrandingConfig {
97
97
  faviconIco?: string
98
98
  }
99
99
 
100
- /**
101
- * Client-safe slice of a registry — bundles everything the shell renders in
102
- * the browser (without pulling in the server-only adapter that uses `fs`).
103
- * Wire this in `ui-registry/registry.client.ts`.
104
- *
105
- * A registry package typically exposes this via a `client.ts` module that
106
- * re-exports `branding`, `previewLoader`, a default `HomePage`, and optional
107
- * `extraTranslations`. See `sntlr-registry/client.ts` for a reference.
108
- */
109
- export interface RegistryClient {
110
- branding: BrandingConfig
111
- previewLoader: PreviewLoader
112
- /**
113
- * Optional custom homepage component. When set, the shell's `/` route
114
- * renders this instead of the built-in Getting Started / generic index.
115
- * When `undefined`/`null`, the shell uses `GenericIndexPage` (a plain
116
- * component/block listing).
117
- */
118
- HomePage?: ComponentType<HomePageProps> | null
119
- /**
120
- * Locale → key → value dictionaries merged into the shell's i18n table.
121
- * Use this to ship marketing/homepage copy; the shell owns the generic UI
122
- * keys (sidebar, header, search, a11y, etc.). Invariant: if `HomePage` is
123
- * set, this must include every key the homepage references.
124
- */
125
- extraTranslations?: Record<string, Record<string, string>>
126
- }
127
-
128
100
  /**
129
101
  * The complete server-side contract the shell consumes. A registry package
130
102
  * implements this (typically in `adapter.ts`) and the shell imports the
@@ -192,8 +164,10 @@ export interface RegistryAdapter {
192
164
  previewLoader: PreviewLoader
193
165
  branding: BrandingConfig
194
166
 
195
- /** See `RegistryClient.HomePage`. */
196
- homePage?: ComponentType<HomePageProps> | null
197
- /** See `RegistryClient.extraTranslations`. */
167
+ /**
168
+ * Locale key → value dictionaries merged into the shell's built-in
169
+ * i18n table. Use this to supply extra translations the registry's
170
+ * custom content references (chrome copy, doc-local keys, etc.).
171
+ */
198
172
  extraTranslations?: Record<string, Record<string, string>>
199
173
  }
@@ -1,6 +1,6 @@
1
- import { clsx, type ClassValue } from "clsx"
2
- import { twMerge } from "tailwind-merge"
3
-
4
- export function cn(...inputs: ClassValue[]) {
5
- return twMerge(clsx(inputs))
6
- }
1
+ import { clsx, type ClassValue } from "clsx"
2
+ import { twMerge } from "tailwind-merge"
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
@@ -1,6 +1,6 @@
1
- /// <reference types="next" />
2
- /// <reference types="next/image-types/global" />
3
- /// <reference path="./.next/types/routes.d.ts" />
4
-
5
- // NOTE: This file should not be edited
6
- // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+ /// <reference path="./.next/types/routes.d.ts" />
4
+
5
+ // NOTE: This file should not be edited
6
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -44,9 +44,6 @@ function resolveUserModule(relativePath: string, fallback: string): string {
44
44
  }
45
45
 
46
46
  const USER_PREVIEWS = resolveUserModule("components/previews", "fallback/previews.ts")
47
- const USER_HOMEPAGE = process.env.USER_HOMEPAGE_PATH
48
- ? resolveUserModule(process.env.USER_HOMEPAGE_PATH, "fallback/homepage.tsx")
49
- : toPosix(path.join(HERE, "fallback/homepage.tsx"))
50
47
 
51
48
  // The CLI's `build` / `start` commands set USER_DIST_DIR to
52
49
  // `<user-project>/.next` so Next writes its output (and reads it back on
@@ -79,7 +76,6 @@ const nextConfig: NextConfig = {
79
76
  : toPosix(findCommonRoot(HERE, USER_ROOT ?? process.cwd())),
80
77
  resolveAlias: {
81
78
  "@user/previews": USER_PREVIEWS,
82
- "@user/homepage": USER_HOMEPAGE,
83
79
  },
84
80
  },
85
81
 
@@ -88,7 +84,6 @@ const nextConfig: NextConfig = {
88
84
  config.resolve.alias = {
89
85
  ...(config.resolve.alias ?? {}),
90
86
  "@user/previews": USER_PREVIEWS,
91
- "@user/homepage": USER_HOMEPAGE,
92
87
  // Shell's internal alias — its own files.
93
88
  "@shell": toPosix(HERE),
94
89
  // shadcn convention: user files use `@/` for their own project root.
@@ -1,7 +1,7 @@
1
- const config = {
2
- plugins: {
3
- "@tailwindcss/postcss": {},
4
- },
5
- }
6
-
7
- export default config
1
+ const config = {
2
+ plugins: {
3
+ "@tailwindcss/postcss": {},
4
+ },
5
+ }
6
+
7
+ export default config
@@ -8,10 +8,3 @@ declare module "@user/previews" {
8
8
  import type { PreviewLoader } from "@shell/lib/registry-adapter"
9
9
  export const previewLoader: PreviewLoader
10
10
  }
11
-
12
- declare module "@user/homepage" {
13
- import type { ComponentType } from "react"
14
- import type { HomePageProps } from "@shell/lib/registry-adapter"
15
- const HomePage: ComponentType<HomePageProps>
16
- export default HomePage
17
- }
@@ -1,6 +0,0 @@
1
- /* Auto-generated by @sntlr/registry-shell. Do not edit.
2
- *
3
- * This file is rewritten by the CLI on every `registry-shell dev/build` boot.
4
- * When a registry sets `paths.globalCss` in its config, the generated file
5
- * `@import`s that user CSS. Without a config (shell-only mode), it stays a
6
- * no-op so the `@import "./_user-global.css"` in globals.css never 404s. */
@@ -1,9 +0,0 @@
1
- /* Auto-generated by @sntlr/registry-shell. Do not edit. */
2
- @source "./";
3
- @source "../components";
4
- @source "../lib";
5
- @source "../hooks";
6
- @source "../fallback";
7
- @source "../../../../sntlr-registry/components/ui";
8
- @source "../../../../sntlr-registry/registry/new-york/blocks";
9
- @source "../../../../sntlr-registry/components/previews";