@heyo-sh/create-heyo-docs 3.0.0 → 3.2.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.
package/README.md CHANGED
@@ -29,15 +29,15 @@ The creator works with pnpm, npm, Yarn, and Bun.
29
29
  Passing options makes the creator non-interactive; include a project-directory
30
30
  argument when using them in automation.
31
31
 
32
- | Option | Values |
33
- | ------------------- | ------------------------------- |
34
- | `--template` | `react-router`, `next`, `astro` |
35
- | `--theme` | `grain`, `shade`, `moss` |
36
- | `--deployment` | `cloudflare`, `vercel`, `later` |
37
- | `--package-manager` | `bun`, `pnpm`, `npm`, `yarn` |
38
- | `--no-install` | Skip dependency installation |
39
-
40
- Read the [full documentation](https://docs.heyo.sh) for configuration, content, components, framework integrations, and deployment.
32
+ | Option | Values |
33
+ | ------------------- | -------------------------------- |
34
+ | `--template` | `react-router`, `next`, `astro` |
35
+ | `--theme` | `grain`, `shade`, `moss`, `heyo` |
36
+ | `--deployment` | `cloudflare`, `vercel`, `later` |
37
+ | `--package-manager` | `bun`, `pnpm`, `npm`, `yarn` |
38
+ | `--no-install` | Skip dependency installation |
39
+
40
+ Read the [full documentation](https://heyo.sh) for configuration, content, components, framework integrations, and deployment.
41
41
 
42
42
  ## License
43
43
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAeA,OAAO,KAAK,EAAE,aAAa,EAAY,MAAM,SAAS,CAAC;AAEvD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAChE,mBAAmB,SAAS,CAAC;AAqD7B,wBAAsB,GAAG,CAAC,IAAI,WAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBrE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC9C,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAsDA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAeA,OAAO,KAAK,EAAE,aAAa,EAAY,MAAM,SAAS,CAAC;AAEvD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAChE,mBAAmB,SAAS,CAAC;AAsD7B,wBAAsB,GAAG,CAAC,IAAI,WAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBrE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC9C,OAAO,EAAE,aAAa,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAsDA"}
package/dist/index.js CHANGED
@@ -198,7 +198,7 @@ async function installDependencies(projectPath, packageManager) {
198
198
  }
199
199
 
200
200
  // src/index.ts
201
- var USAGE = "Usage: create-heyo-docs [project-name] [--template react-router|next|astro] [--deployment cloudflare|vercel|later] [--theme grain|shade|moss] [--package-manager bun|pnpm|npm|yarn] [--no-install]";
201
+ var USAGE = "Usage: create-heyo-docs [project-name] [--template react-router|next|astro] [--deployment cloudflare|vercel|later] [--theme grain|shade|moss|heyo] [--package-manager bun|pnpm|npm|yarn] [--no-install]";
202
202
  var TEMPLATE_OPTIONS = [
203
203
  { value: "react-router", label: "React Router" },
204
204
  { value: "next", label: "Next.js" },
@@ -213,6 +213,7 @@ var THEME_OPTIONS = [
213
213
  { value: "grain", label: "Grain" },
214
214
  { value: "shade", label: "Shade" },
215
215
  { value: "moss", label: "Moss" },
216
+ { value: "heyo", label: "Heyo" },
216
217
  {
217
218
  value: "dripper",
218
219
  label: "Dripper — Soon",
@@ -292,7 +293,7 @@ function parseArguments(argv) {
292
293
  } else if (value === "--deployment") {
293
294
  options.deployment = readEnum(argv[++index], ["cloudflare", "vercel", "later"], "deployment");
294
295
  } else if (value === "--theme") {
295
- options.theme = readEnum(argv[++index], ["grain", "shade", "moss"], "theme");
296
+ options.theme = readEnum(argv[++index], ["grain", "shade", "moss", "heyo"], "theme");
296
297
  } else if (value === "--package-manager") {
297
298
  options.packageManager = readEnum(argv[++index], ["bun", "pnpm", "npm", "yarn"], "package manager");
298
299
  } else if (value === "--no-install") {
@@ -324,7 +325,8 @@ async function askQuestions(defaults) {
324
325
  const theme = await selectAvailable("Theme", THEME_OPTIONS, [
325
326
  "grain",
326
327
  "shade",
327
- "moss"
328
+ "moss",
329
+ "heyo"
328
330
  ]);
329
331
  const packageManager = await selectAvailable("Package manager", PACKAGE_MANAGER_OPTIONS, ["bun", "pnpm", "npm", "yarn"], defaults.packageManager);
330
332
  const install = promptValue(await p.confirm({
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export type Template = "react-router" | "next" | "astro";
2
2
  export type Deployment = "cloudflare" | "vercel" | "later";
3
- export type Theme = "grain" | "shade" | "moss";
3
+ export type Theme = "grain" | "shade" | "moss" | "heyo";
4
4
  export type PackageManager = "bun" | "pnpm" | "npm" | "yarn";
5
5
  export interface CreateOptions {
6
6
  projectName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AACzD,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,OAAO,GA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json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyo-sh/create-heyo-docs",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Create a standalone Heyo Docs documentation project.",
5
5
  "homepage": "https://heyo.sh",
6
6
  "repository": {
@@ -27,7 +27,7 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@clack/prompts": "1.8.0"
30
+ "@clack/prompts": "1.8.1"
31
31
  },
32
32
  "scripts": {
33
33
  "dev": "bun run build --watch",
@@ -10,6 +10,7 @@ export const GET: APIRoute = ({ request }) => {
10
10
  "User-agent: *",
11
11
  "Allow: /",
12
12
  "Disallow: /__heyo-docs/",
13
+ "Disallow: /heyo-docs-internal/",
13
14
  "",
14
15
  `Sitemap: ${siteUrl}/sitemap.xml`,
15
16
  "",
@@ -7,6 +7,7 @@ export function GET(request: Request) {
7
7
  "User-agent: *",
8
8
  "Allow: /",
9
9
  "Disallow: /__heyo-docs/",
10
+ "Disallow: /heyo-docs-internal/",
10
11
  "",
11
12
  `Sitemap: ${siteUrl}/sitemap.xml`,
12
13
  "",
@@ -5,10 +5,7 @@ import {
5
5
  findOpenApiEndpoint,
6
6
  } from "@heyo-sh/heyo-docs/model";
7
7
  import { changelogGroupForPage } from "@heyo-sh/heyo-docs/navigation";
8
- import {
9
- openApiEndpointDataPath,
10
- openApiEndpointDetail,
11
- } from "@heyo-sh/heyo-docs/openapi";
8
+ import { openApiEndpointDetail } from "@heyo-sh/heyo-docs/openapi";
12
9
  import { docsSeoMeta } from "@heyo-sh/heyo-docs/seo/react-router";
13
10
  import type { OpenApiEndpoint } from "@heyo-sh/heyo-docs/types";
14
11
  import { useDocsTheme } from "@heyo-sh/heyo-docs/theme/provider";
@@ -16,6 +13,7 @@ import {
16
13
  Link,
17
14
  useLoaderData,
18
15
  useParams,
16
+ type ClientLoaderFunctionArgs,
19
17
  type LoaderFunctionArgs,
20
18
  type MetaFunction,
21
19
  } from "react-router";
@@ -48,33 +46,38 @@ export async function loader({ params }: LoaderFunctionArgs) {
48
46
 
49
47
  if (!endpoint) return {};
50
48
 
51
- // Prerendering serialises this operation-specific data with its static route,
52
- // so the browser's first paint already contains the complete API reference.
53
- if (typeof window === "undefined") {
54
- const serverModel = createDocsModel(config, pages, openApiDocuments);
55
- const currentOpenApiEndpoint = findOpenApiEndpoint(
56
- serverModel.endpoints,
57
- pathname,
58
- );
59
- return {
60
- currentOpenApiEndpoint: currentOpenApiEndpoint
61
- ? openApiEndpointDetail(currentOpenApiEndpoint)
62
- : undefined,
63
- };
64
- }
65
-
66
- // Client transitions wait for the static shard before committing the new
67
- // route. This prevents rendering the compact index and replacing it later.
68
- const response = await fetch(openApiEndpointDataPath(endpoint.slug));
69
- if (!response.ok)
70
- throw new Response("OpenAPI endpoint data could not be loaded", {
71
- status: response.status,
72
- });
49
+ // This loader runs on the server, including during prerendering, so the
50
+ // operation's full data is serialised with the route. First paint and every
51
+ // client transition therefore start from the complete API reference.
52
+ const serverModel = createDocsModel(config, pages, openApiDocuments);
53
+ const currentOpenApiEndpoint = findOpenApiEndpoint(
54
+ serverModel.endpoints,
55
+ pathname,
56
+ );
73
57
  return {
74
- currentOpenApiEndpoint: (await response.json()) as OpenApiEndpoint,
58
+ currentOpenApiEndpoint: currentOpenApiEndpoint
59
+ ? (openApiEndpointDetail(currentOpenApiEndpoint) as OpenApiEndpoint)
60
+ : undefined,
75
61
  };
76
62
  }
77
63
 
64
+ /**
65
+ * Loads the page's MDX chunk before the new route is displayed, so a reader
66
+ * never sees a loading placeholder replace the page they came from.
67
+ */
68
+ export async function clientLoader({
69
+ params,
70
+ serverLoader,
71
+ }: ClientLoaderFunctionArgs) {
72
+ const model = createDocsModel(config, pages, [], openApiEndpoints);
73
+ const page = findDocsPage(model.pages, pathnameFor(params));
74
+ const [data] = await Promise.all([
75
+ serverLoader<Awaited<ReturnType<typeof loader>>>(),
76
+ page?.preload?.(),
77
+ ]);
78
+ return data;
79
+ }
80
+
78
81
  export const meta: MetaFunction = ({ params }) => {
79
82
  const model = createDocsModel(config, pages, [], openApiEndpoints);
80
83
  const pathname = pathnameFor(params);
@@ -1 +1 @@
1
- export { default, loader, meta, ErrorBoundary } from "./docs";
1
+ export { default, clientLoader, loader, meta, ErrorBoundary } from "./docs";
@@ -10,6 +10,7 @@ export function loader({ request }: Route.LoaderArgs) {
10
10
  "User-agent: *",
11
11
  "Allow: /",
12
12
  "Disallow: /__heyo-docs/",
13
+ "Disallow: /heyo-docs-internal/",
13
14
  "",
14
15
  `Sitemap: ${siteUrl}/sitemap.xml`,
15
16
  "",