zudoku 0.0.0-eff6f9b → 0.0.0-f5761c9

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 (88) hide show
  1. package/dist/config/config.d.ts +2 -1
  2. package/dist/config/validators/InputSidebarSchema.d.ts +1 -0
  3. package/dist/index.d.ts +1 -1
  4. package/dist/lib/oas/graphql/index.d.ts +2 -1
  5. package/dist/lib/oas/graphql/index.js +11 -9
  6. package/dist/lib/oas/graphql/index.js.map +1 -1
  7. package/dist/lib/plugins/markdown/MdxPage.js +2 -2
  8. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  9. package/dist/lib/plugins/openapi/index.js +2 -1
  10. package/dist/lib/plugins/openapi/index.js.map +1 -1
  11. package/dist/lib/plugins/openapi/playground/createUrl.js +3 -1
  12. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
  13. package/dist/vite/config.d.ts +1 -1
  14. package/dist/vite/config.js +7 -3
  15. package/dist/vite/config.js.map +1 -1
  16. package/dist/vite/dev-server.js +1 -1
  17. package/dist/vite/dev-server.js.map +1 -1
  18. package/dist/vite/plugin-api.js +4 -7
  19. package/dist/vite/plugin-api.js.map +1 -1
  20. package/dist/vite/plugin-config-reload.js +9 -4
  21. package/dist/vite/plugin-config-reload.js.map +1 -1
  22. package/lib/{AuthenticationPlugin-gtf8JS3V.js → AuthenticationPlugin-Bx9FK124.js} +2 -2
  23. package/lib/{AuthenticationPlugin-gtf8JS3V.js.map → AuthenticationPlugin-Bx9FK124.js.map} +1 -1
  24. package/lib/{CategoryHeading-XnFqN2lJ.js → CategoryHeading-EN3W3xEN.js} +2 -2
  25. package/lib/{CategoryHeading-XnFqN2lJ.js.map → CategoryHeading-EN3W3xEN.js.map} +1 -1
  26. package/lib/{DeveloperHint-FBb2uXJe.js → DeveloperHint-CZ4VwuKw.js} +2 -2
  27. package/lib/{DeveloperHint-FBb2uXJe.js.map → DeveloperHint-CZ4VwuKw.js.map} +1 -1
  28. package/lib/{ErrorPage-knunPbKI.js → ErrorPage-C5Pnyfbg.js} +3 -3
  29. package/lib/{ErrorPage-knunPbKI.js.map → ErrorPage-C5Pnyfbg.js.map} +1 -1
  30. package/lib/{Input-B1kkVL1R.js → Input-DulGxZh-.js} +4 -4
  31. package/lib/{Input-B1kkVL1R.js.map → Input-DulGxZh-.js.map} +1 -1
  32. package/lib/{Markdown-B4aR03g6.js → Markdown-BUUIyZbc.js} +788 -792
  33. package/lib/Markdown-BUUIyZbc.js.map +1 -0
  34. package/lib/{MdxPage-BcftTg5g.js → MdxPage-COBmXj_4.js} +23 -23
  35. package/lib/MdxPage-COBmXj_4.js.map +1 -0
  36. package/lib/{OperationList-Da36LrGl.js → OperationList-BwJXexkA.js} +8 -8
  37. package/lib/{OperationList-Da36LrGl.js.map → OperationList-BwJXexkA.js.map} +1 -1
  38. package/lib/{Route-CWj1ECzh.js → Route-CX_-Q1HO.js} +2 -2
  39. package/lib/{Route-CWj1ECzh.js.map → Route-CX_-Q1HO.js.map} +1 -1
  40. package/lib/{SidebarBadge-DdvT2qep.js → SidebarBadge-gvlvsv3E.js} +3 -3
  41. package/lib/{SidebarBadge-DdvT2qep.js.map → SidebarBadge-gvlvsv3E.js.map} +1 -1
  42. package/lib/{SlotletProvider-DJMaOUDs.js → SlotletProvider-CULK8zmk.js} +4 -4
  43. package/lib/{SlotletProvider-DJMaOUDs.js.map → SlotletProvider-CULK8zmk.js.map} +1 -1
  44. package/lib/{ZudokuContext-em1gHkIY.js → ZudokuContext-cr-pTRY1.js} +4 -4
  45. package/lib/{ZudokuContext-em1gHkIY.js.map → ZudokuContext-cr-pTRY1.js.map} +1 -1
  46. package/lib/assets/{worker-TYRbYl6N.js → worker-DgVH8VJc.js} +3411 -1341
  47. package/lib/assets/worker-DgVH8VJc.js.map +1 -0
  48. package/lib/{index-BoXX7LeD.js → index-BfA1oLPP.js} +3 -3
  49. package/lib/{index-BoXX7LeD.js.map → index-BfA1oLPP.js.map} +1 -1
  50. package/lib/index-Bn6Lc9tq.js +9 -0
  51. package/lib/index-Bn6Lc9tq.js.map +1 -0
  52. package/lib/{index-DIkaYL-l.js → index-BuA1OA5H.js} +422 -418
  53. package/lib/index-BuA1OA5H.js.map +1 -0
  54. package/lib/index-LNp6rxyU.js +2094 -0
  55. package/lib/index-LNp6rxyU.js.map +1 -0
  56. package/lib/{index-B_9xr661.js → index-Q0TPJvr8.js} +3 -3
  57. package/lib/{index-B_9xr661.js.map → index-Q0TPJvr8.js.map} +1 -1
  58. package/lib/joinPath-B7kNnUX4.js +8 -0
  59. package/lib/joinPath-B7kNnUX4.js.map +1 -0
  60. package/lib/{utils-DtEHoAvg.js → utils-ByIc_KIM.js} +100 -103
  61. package/lib/utils-ByIc_KIM.js.map +1 -0
  62. package/lib/zudoku.auth-clerk.js +1 -1
  63. package/lib/zudoku.auth-openid.js +4 -4
  64. package/lib/zudoku.components.js +41 -40
  65. package/lib/zudoku.components.js.map +1 -1
  66. package/lib/zudoku.openapi-worker.js +282 -283
  67. package/lib/zudoku.openapi-worker.js.map +1 -1
  68. package/lib/zudoku.plugin-api-keys.js +6 -6
  69. package/lib/zudoku.plugin-custom-page.js +1 -1
  70. package/lib/zudoku.plugin-markdown.js +1 -1
  71. package/lib/zudoku.plugin-openapi.js +7 -6
  72. package/lib/zudoku.plugin-openapi.js.map +1 -1
  73. package/package.json +3 -3
  74. package/src/lib/oas/graphql/index.ts +20 -12
  75. package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
  76. package/src/lib/plugins/openapi/index.tsx +2 -1
  77. package/src/lib/plugins/openapi/playground/createUrl.ts +6 -1
  78. package/dist/lib/util/slugify.d.ts +0 -2
  79. package/dist/lib/util/slugify.js +0 -3
  80. package/dist/lib/util/slugify.js.map +0 -1
  81. package/lib/Markdown-B4aR03g6.js.map +0 -1
  82. package/lib/MdxPage-BcftTg5g.js.map +0 -1
  83. package/lib/assets/worker-TYRbYl6N.js.map +0 -1
  84. package/lib/index-DIkaYL-l.js.map +0 -1
  85. package/lib/slugify-DbLhpSPt.js +0 -28
  86. package/lib/slugify-DbLhpSPt.js.map +0 -1
  87. package/lib/utils-DtEHoAvg.js.map +0 -1
  88. package/src/lib/util/slugify.ts +0 -3
@@ -1,13 +1,13 @@
1
1
  import { j as e } from "./jsx-runtime-B6kdoens.js";
2
- import { S as x, R as f } from "./SlotletProvider-DJMaOUDs.js";
3
- import { u as g, a as d, I as j, S as v, b as w, c as b, d as k, e as K, f as m } from "./Input-B1kkVL1R.js";
2
+ import { S as x, R as f } from "./SlotletProvider-CULK8zmk.js";
3
+ import { u as g, a as d, I as j, S as v, b as w, c as b, d as k, e as K, f as m } from "./Input-DulGxZh-.js";
4
4
  import { a as N, L as u, O as I } from "./index-BG0g4WW0.js";
5
- import { u as h, a as E, b as S } from "./ZudokuContext-em1gHkIY.js";
6
- import { B as l, m as A } from "./index-BoXX7LeD.js";
7
- import { D as C } from "./DeveloperHint-FBb2uXJe.js";
5
+ import { u as h, a as E, b as S } from "./ZudokuContext-cr-pTRY1.js";
6
+ import { B as l, m as A } from "./index-BfA1oLPP.js";
7
+ import { D as C } from "./DeveloperHint-CZ4VwuKw.js";
8
8
  import { RotateCwIcon as P, TrashIcon as D, EyeOffIcon as R, EyeIcon as q, CheckIcon as O, CopyIcon as z } from "lucide-react";
9
9
  import { useState as p } from "react";
10
- import { a as T } from "./Markdown-B4aR03g6.js";
10
+ import { a as T } from "./Markdown-BUUIyZbc.js";
11
11
  function c(t, s) {
12
12
  if (t)
13
13
  return;
@@ -1,5 +1,5 @@
1
1
  import { j as m } from "./jsx-runtime-B6kdoens.js";
2
- import { P as o } from "./Markdown-B4aR03g6.js";
2
+ import { P as o } from "./Markdown-BUUIyZbc.js";
3
3
  const l = (s) => ({
4
4
  getRoutes: () => s.map(({ path: e, element: t }) => ({
5
5
  path: e,
@@ -6,7 +6,7 @@ const x = (t, e, n) => Object.entries(t).flatMap(([a, p]) => {
6
6
  return s ? {
7
7
  path: s,
8
8
  lazy: async () => {
9
- const { MdxPage: i } = await import("./MdxPage-BcftTg5g.js"), { default: m, ...l } = await p();
9
+ const { MdxPage: i } = await import("./MdxPage-COBmXj_4.js"), { default: m, ...l } = await p();
10
10
  return {
11
11
  element: /* @__PURE__ */ u.jsx(
12
12
  i,
@@ -1,15 +1,16 @@
1
1
  import "./jsx-runtime-B6kdoens.js";
2
- import { o as s } from "./index-DIkaYL-l.js";
2
+ import { o as u } from "./index-BuA1OA5H.js";
3
3
  import "./urql-YhcsXYy8.js";
4
- import "./ZudokuContext-em1gHkIY.js";
4
+ import "./ZudokuContext-cr-pTRY1.js";
5
5
  import "lucide-react";
6
6
  import "zudoku/openapi-worker";
7
- import "./index-BoXX7LeD.js";
8
- import "./ErrorPage-knunPbKI.js";
9
- import "./Markdown-B4aR03g6.js";
7
+ import "./index-BfA1oLPP.js";
8
+ import "./ErrorPage-C5Pnyfbg.js";
9
+ import "./Markdown-BUUIyZbc.js";
10
+ import "./joinPath-B7kNnUX4.js";
10
11
  import "./router-D2p7Olpn.js";
11
12
  import "./index-BG0g4WW0.js";
12
13
  export {
13
- s as openApiPlugin
14
+ u as openApiPlugin
14
15
  };
15
16
  //# sourceMappingURL=zudoku.plugin-openapi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.0.0-eff6f9b",
3
+ "version": "0.0.0-f5761c9",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -102,6 +102,7 @@
102
102
  "@radix-ui/react-select": "2.1.1",
103
103
  "@radix-ui/react-visually-hidden": "1.1.0",
104
104
  "@sentry/node": "8.11.0",
105
+ "@sindresorhus/slugify": "2.2.1",
105
106
  "@stefanprobst/rehype-extract-toc": "2.2.0",
106
107
  "@tailwindcss/typography": "0.5.13",
107
108
  "@tanstack/react-query": "5.50.1",
@@ -111,7 +112,7 @@
111
112
  "chokidar": "^3.6.0",
112
113
  "class-variance-authority": "0.7.0",
113
114
  "dotenv": "16.4.5",
114
- "express": "4.19.2",
115
+ "express": "4.20.0",
115
116
  "glob": "^11.0.0",
116
117
  "graphql": "16.9.0",
117
118
  "graphql-type-json": "0.3.2",
@@ -147,7 +148,6 @@
147
148
  "rollup": "^4.21.2",
148
149
  "semver": "7.6.2",
149
150
  "sitemap": "^8.0.0",
150
- "slugify": "1.6.6",
151
151
  "strip-ansi": "7.1.0",
152
152
  "tailwind-merge": "2.5.2",
153
153
  "tailwindcss": "3.4.4",
@@ -1,10 +1,13 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import SchemaBuilder from "@pothos/core";
3
+ import {
4
+ slugifyWithCounter,
5
+ type CountableSlugify,
6
+ } from "@sindresorhus/slugify";
3
7
  import { GraphQLJSON, GraphQLJSONObject } from "graphql-type-json";
4
8
  import { createYoga, type YogaServerOptions } from "graphql-yoga";
5
9
  import { LRUCache } from "lru-cache";
6
10
  import hashit from "object-hash";
7
- import slugify from "../../util/slugify.js";
8
11
  import {
9
12
  HttpMethods,
10
13
  validate,
@@ -35,7 +38,12 @@ type OperationLike = {
35
38
  path: string;
36
39
  method: string;
37
40
  };
38
- export const slugifyOperation = (operation: OperationLike, tag?: string) => {
41
+
42
+ export const createOperationSlug = (
43
+ slugify: CountableSlugify,
44
+ operation: OperationLike,
45
+ tag?: string,
46
+ ) => {
39
47
  const summary =
40
48
  (operation.summary ?? "") +
41
49
  (operation.operationId
@@ -46,7 +54,6 @@ export const slugifyOperation = (operation: OperationLike, tag?: string) => {
46
54
  return slugify(
47
55
  (tag ? tag + "-" : "") +
48
56
  (summary || `${operation.method}-${operation.path}`),
49
- { lower: true, trim: true },
50
57
  );
51
58
  };
52
59
 
@@ -88,6 +95,8 @@ const getAllTags = (schema: OpenAPIDocument): TagObject[] => {
88
95
  };
89
96
 
90
97
  const getAllOperations = (paths?: PathsObject, tag?: string) => {
98
+ const slugify = slugifyWithCounter();
99
+
91
100
  return Object.entries(paths ?? {}).flatMap(([path, value]) =>
92
101
  HttpMethods.flatMap((method) => {
93
102
  if (!value?.[method]) return [];
@@ -109,21 +118,20 @@ const getAllOperations = (paths?: PathsObject, tag?: string) => {
109
118
  ...operationParameters,
110
119
  ];
111
120
 
121
+ const slugData = {
122
+ summary: operation.summary,
123
+ operationId: operation.operationId,
124
+ path,
125
+ method,
126
+ };
127
+
112
128
  return {
113
129
  ...operation,
114
130
  method,
115
131
  path,
116
132
  parameters,
117
133
  tags: operation.tags ?? [],
118
- slug: slugifyOperation(
119
- {
120
- summary: operation.summary,
121
- operationId: operation.operationId,
122
- path,
123
- method,
124
- },
125
- tag,
126
- ),
134
+ slug: createOperationSlug(slugify, slugData, tag),
127
135
  };
128
136
  }),
129
137
  );
@@ -1,4 +1,5 @@
1
1
  import { useMDXComponents } from "@mdx-js/react";
2
+ import slugify from "@sindresorhus/slugify";
2
3
  import { Helmet } from "@zudoku/react-helmet-async";
3
4
  import { type PropsWithChildren } from "react";
4
5
  import { Link } from "react-router-dom";
@@ -11,7 +12,6 @@ import {
11
12
  } from "../../components/navigation/utils.js";
12
13
  import type { MdxComponentsType } from "../../util/MdxComponents.js";
13
14
  import { cn } from "../../util/cn.js";
14
- import slugify from "../../util/slugify.js";
15
15
  import { Toc } from "./Toc.js";
16
16
  import { MarkdownPluginDefaultOptions, MDXImport } from "./index.js";
17
17
 
@@ -71,7 +71,7 @@ export const MdxPage = ({
71
71
  <header>
72
72
  {category && <CategoryHeading>{category}</CategoryHeading>}
73
73
  {title && (
74
- <Heading level={1} id={slugify(title, { lower: true })}>
74
+ <Heading level={1} id={slugify(title)}>
75
75
  {title}
76
76
  </Heading>
77
77
  )}
@@ -16,6 +16,7 @@ import { ErrorPage } from "../../components/ErrorPage.js";
16
16
  import { ColorMap } from "../../components/navigation/SidebarBadge.js";
17
17
  import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
18
18
  import { Button } from "../../ui/Button.js";
19
+ import { joinPath } from "../../util/joinPath.js";
19
20
  import { OasPluginConfig } from "./interfaces.js";
20
21
  import type { PlaygroundContentProps } from "./playground/Playground.js";
21
22
  import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
@@ -72,7 +73,7 @@ export type OpenApiPluginOptions = OasPluginConfig & InternalOasPluginConfig;
72
73
  export const openApiPlugin = (
73
74
  config: OpenApiPluginOptions,
74
75
  ): DevPortalPlugin => {
75
- const basePath = "/reference";
76
+ const basePath = joinPath(config.navigationId ?? "/reference");
76
77
 
77
78
  const client = config.server
78
79
  ? new UrqlClient({
@@ -8,7 +8,12 @@ export const createUrl = (host: string, path: string, data: PlaygroundForm) => {
8
8
  return value ?? match;
9
9
  });
10
10
 
11
- const url = new URL(filledPath, host);
11
+ // Ensure host ends with a slash and path doesn't start with one,
12
+ // so they form a correct URL, without overriding the host's path.
13
+ const url = new URL(
14
+ filledPath.replace(/^\//, ""),
15
+ host.endsWith("/") ? host : `${host}/`,
16
+ );
12
17
 
13
18
  data.queryParams
14
19
  .filter((param) => param.active)
@@ -1,2 +0,0 @@
1
- import slugify from "slugify";
2
- export default slugify;
@@ -1,3 +0,0 @@
1
- import slugify from "slugify";
2
- export default slugify;
3
- //# sourceMappingURL=slugify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slugify.js","sourceRoot":"","sources":["../../../src/lib/util/slugify.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,eAAe,OAAO,CAAC"}