zudoku 0.1.1-dev.20 → 0.1.1-dev.22

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 (131) hide show
  1. package/dist/cli/common/logger.js +3 -1
  2. package/dist/cli/common/logger.js.map +1 -1
  3. package/dist/cli/common/outdated.js +4 -4
  4. package/dist/cli/common/outdated.js.map +1 -1
  5. package/dist/cli/common/output.js +4 -4
  6. package/dist/cli/common/output.js.map +1 -1
  7. package/dist/cli/common/utils/box.js +2 -2
  8. package/dist/cli/common/utils/box.js.map +1 -1
  9. package/dist/config/config.d.ts +1 -0
  10. package/dist/lib/authentication/clerk.d.ts +2 -1
  11. package/dist/lib/authentication/clerk.js +2 -1
  12. package/dist/lib/authentication/clerk.js.map +1 -1
  13. package/dist/lib/{DevPortal.d.ts → components/DevPortal.d.ts} +5 -5
  14. package/dist/lib/{DevPortal.js → components/DevPortal.js} +7 -7
  15. package/dist/lib/components/DevPortal.js.map +1 -0
  16. package/dist/lib/{Heading.js → components/Heading.js} +2 -2
  17. package/dist/lib/components/Heading.js.map +1 -0
  18. package/dist/lib/components/Link.d.ts +1 -0
  19. package/dist/lib/components/Link.js +2 -0
  20. package/dist/lib/components/Link.js.map +1 -0
  21. package/dist/lib/{Router.d.ts → components/Router.d.ts} +1 -1
  22. package/dist/lib/{Router.js → components/Router.js} +2 -2
  23. package/dist/lib/components/Router.js.map +1 -0
  24. package/dist/lib/components/index.d.ts +3 -0
  25. package/dist/lib/components/index.js +4 -0
  26. package/dist/lib/components/index.js.map +1 -0
  27. package/dist/lib/core/DevPortalContext.d.ts +1 -1
  28. package/dist/lib/core/DevPortalContext.js.map +1 -1
  29. package/dist/lib/plugins/api-key/index.js +1 -1
  30. package/dist/lib/plugins/api-key/index.js.map +1 -1
  31. package/dist/lib/plugins/index.d.ts +4 -0
  32. package/dist/lib/plugins/index.js +6 -0
  33. package/dist/lib/plugins/index.js.map +1 -0
  34. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  35. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  36. package/dist/lib/plugins/markdown/generateRoutes.js +1 -1
  37. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  38. package/dist/lib/plugins/openapi/OperationList.js +2 -2
  39. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  40. package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
  41. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  42. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  43. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  44. package/dist/lib/plugins/openapi/index.js +1 -1
  45. package/dist/lib/plugins/openapi/index.js.map +1 -1
  46. package/dist/lib/plugins/openapi-worker.d.ts +1 -0
  47. package/dist/lib/plugins/openapi-worker.js +2 -0
  48. package/dist/lib/plugins/openapi-worker.js.map +1 -0
  49. package/dist/lib/ui/Button.d.ts +1 -1
  50. package/dist/lib/util/MdxComponents.js +1 -1
  51. package/dist/lib/util/MdxComponents.js.map +1 -1
  52. package/dist/vite/config.js +16 -12
  53. package/dist/vite/config.js.map +1 -1
  54. package/dist/vite/plugin-auth.js +2 -2
  55. package/dist/vite/plugin-auth.js.map +1 -1
  56. package/dist/vite/plugin-component.d.ts +2 -1
  57. package/dist/vite/plugin-component.js +14 -5
  58. package/dist/vite/plugin-component.js.map +1 -1
  59. package/lib/{DevPortal-DqcnbwLT.js → DevPortal-ChiyAyW7.js} +7348 -7347
  60. package/lib/{zudoku.auth.js → zudoku.auth-clerk.js} +6 -8
  61. package/lib/zudoku.components.js +1 -1
  62. package/lib/zudoku.plugins.js +2 -2
  63. package/package.json +11 -11
  64. package/src/lib/authentication/clerk.ts +3 -5
  65. package/src/lib/{DevPortal.tsx → components/DevPortal.tsx} +16 -13
  66. package/src/lib/{Heading.tsx → components/Heading.tsx} +2 -2
  67. package/src/lib/components/Link.tsx +1 -0
  68. package/src/lib/{Router.tsx → components/Router.tsx} +2 -2
  69. package/src/lib/components/index.ts +3 -0
  70. package/src/lib/core/DevPortalContext.ts +4 -1
  71. package/src/lib/plugins/api-key/index.tsx +1 -1
  72. package/src/lib/plugins/index.ts +5 -0
  73. package/src/lib/plugins/markdown/MdxPage.tsx +1 -1
  74. package/src/lib/plugins/markdown/generateRoutes.tsx +1 -1
  75. package/src/lib/plugins/openapi/OperationList.tsx +3 -3
  76. package/src/lib/plugins/openapi/OperationListItem.tsx +1 -1
  77. package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
  78. package/src/lib/plugins/openapi/index.tsx +1 -1
  79. package/src/lib/plugins/openapi-worker.ts +1 -0
  80. package/src/lib/util/MdxComponents.tsx +1 -1
  81. package/dist/lib/DevPortal.js.map +0 -1
  82. package/dist/lib/Heading.js.map +0 -1
  83. package/dist/lib/Router.js.map +0 -1
  84. package/dist/lib/auth.d.ts +0 -1
  85. package/dist/lib/auth.js +0 -2
  86. package/dist/lib/auth.js.map +0 -1
  87. package/dist/lib/components.d.ts +0 -3
  88. package/dist/lib/components.js +0 -4
  89. package/dist/lib/components.js.map +0 -1
  90. package/dist/lib/plugins.d.ts +0 -4
  91. package/dist/lib/plugins.js +0 -6
  92. package/dist/lib/plugins.js.map +0 -1
  93. package/src/cli/build/handler.ts +0 -14
  94. package/src/cli/cli.ts +0 -77
  95. package/src/cli/cmds/build.ts +0 -24
  96. package/src/cli/cmds/dev.ts +0 -29
  97. package/src/cli/common/analytics/lib.ts +0 -89
  98. package/src/cli/common/constants.ts +0 -10
  99. package/src/cli/common/logger.ts +0 -5
  100. package/src/cli/common/machine-id/lib.ts +0 -85
  101. package/src/cli/common/outdated.ts +0 -102
  102. package/src/cli/common/output.ts +0 -86
  103. package/src/cli/common/utils/box.license.txt +0 -202
  104. package/src/cli/common/utils/box.ts +0 -116
  105. package/src/cli/common/utils/ports.ts +0 -21
  106. package/src/cli/common/validators/lib.ts +0 -43
  107. package/src/cli/common/xdg/lib.ts +0 -36
  108. package/src/cli/dev/handler.ts +0 -42
  109. package/src/config/config.ts +0 -56
  110. package/src/index.ts +0 -8
  111. package/src/lib/auth.ts +0 -1
  112. package/src/lib/components.ts +0 -3
  113. package/src/lib/plugins.ts +0 -5
  114. package/src/ts.ts +0 -94
  115. package/src/types.d.ts +0 -24
  116. package/src/vite/build.ts +0 -33
  117. package/src/vite/config.test.ts +0 -10
  118. package/src/vite/config.ts +0 -183
  119. package/src/vite/dev-server.ts +0 -64
  120. package/src/vite/html.ts +0 -37
  121. package/src/vite/plugin-api.ts +0 -57
  122. package/src/vite/plugin-auth.ts +0 -32
  123. package/src/vite/plugin-component.ts +0 -26
  124. package/src/vite/plugin-config.ts +0 -31
  125. package/src/vite/plugin-docs.test.ts +0 -32
  126. package/src/vite/plugin-docs.ts +0 -52
  127. package/src/vite/plugin-html.ts +0 -50
  128. package/src/vite/plugin-mdx.ts +0 -74
  129. package/src/vite/plugin-metadata.ts +0 -30
  130. package/src/vite/plugin.ts +0 -23
  131. /package/dist/lib/{Heading.d.ts → components/Heading.d.ts} +0 -0
@@ -1,12 +1,10 @@
1
- import { Clerk as o } from "@clerk/clerk-js";
2
- const r = ({
3
- clerkPubKey: a
4
- }) => {
5
- const e = new o(a), n = e.load({});
1
+ import { Clerk as t } from "@clerk/clerk-js";
2
+ const r = ({ clerkPubKey: n }) => {
3
+ const e = new t(n), a = e.load({});
6
4
  return {
7
5
  initialize: async (i) => {
8
6
  var s;
9
- await n, e.session ? await i.setUserProfile({
7
+ await a, e.session ? await i.setUserProfile({
10
8
  isLoggedIn: !0,
11
9
  name: e.session.user.fullName ?? void 0,
12
10
  email: ((s = e.session.user.emailAddresses.at(0)) == null ? void 0 : s.emailAddress) ?? void 0
@@ -16,7 +14,7 @@ const r = ({
16
14
  },
17
15
  getToken: async () => {
18
16
  var s;
19
- return await n, await ((s = e.session) == null ? void 0 : s.getToken()) ?? void 0;
17
+ return await a, await ((s = e.session) == null ? void 0 : s.getToken()) ?? void 0;
20
18
  },
21
19
  signOut() {
22
20
  e.signOut();
@@ -27,5 +25,5 @@ const r = ({
27
25
  };
28
26
  };
29
27
  export {
30
- r as clerkAuth
28
+ r as default
31
29
  };
@@ -1,4 +1,4 @@
1
- import { a as n, D as r, L as s } from "./DevPortal-DqcnbwLT.js";
1
+ import { D as n, a as r, L as s } from "./DevPortal-ChiyAyW7.js";
2
2
  export {
3
3
  n as DevPortal,
4
4
  r as DynamicIcon,
@@ -3,12 +3,12 @@ var go = (e) => {
3
3
  };
4
4
  var dr = (e, t, n) => t.has(e) || go("Cannot " + n);
5
5
  var oe = (e, t, n) => (dr(e, t, "read from private field"), n ? n.call(e) : t.get(e)), St = (e, t, n) => t.has(e) ? go("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Ct = (e, t, n, r) => (dr(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), Et = (e, t, n) => (dr(e, t, "access private method"), n);
6
- import { S as gc, s as bc, h as bo, g as vc, n as ml, u as xc, b as kc, c as wc, d as er, e as yl, j as x, f as Sc, i as Cc, k as ht, l as Ai, M as Ec, m as Tc, o as X, A as Oc, p as gl, q as Ac, t as Xr, r as Zr, H as Nc, v as zt, L as vo, N as bl, w as Pc, x as qt, y as Ze, P as Ee, z as be, B as $c, C as jc, E as tr, F as nr, G as Dn, I as Ic, J as Ni, K as Zt, O as Rc, Q as rr, R as Fc, T as Lc, U as _c } from "./DevPortal-DqcnbwLT.js";
6
+ import { S as gc, s as bc, h as bo, g as vc, n as ml, u as xc, b as kc, c as wc, d as er, e as yl, j as x, f as Sc, i as Cc, k as ht, l as Ai, M as Ec, m as Tc, o as X, A as Oc, p as gl, q as Ac, t as Xr, r as Zr, H as Nc, v as zt, L as vo, N as bl, w as Pc, x as qt, y as Ze, P as Ee, z as be, B as $c, C as jc, E as tr, F as nr, G as Dn, I as Ic, J as Ni, K as Zt, O as Rc, Q as rr, R as Fc, T as Lc, U as _c } from "./DevPortal-ChiyAyW7.js";
7
7
  import * as O from "react";
8
8
  import ct, { useRef as vl, useState as gt, useEffect as Pi, useMemo as xl, Fragment as kl, createContext as Mc, useContext as Dc } from "react";
9
9
  import zc from "react-dom";
10
10
  import { g as qc, u as Bc, a as Uc, C as Hc, c as Wc, f as Vc, P as Gc } from "./urql-B7mLfVog.js";
11
- import { createSharedWorkerClient as Jc } from "zudoku/open-api-worker";
11
+ import { createSharedWorkerClient as Jc } from "zudoku/openapi-worker";
12
12
  var it, ot, Ne, Ye, Xe, Tn, ei, hl, Kc = (hl = class extends gc {
13
13
  constructor(n, r) {
14
14
  super();
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.1.1-dev.20",
3
+ "version": "0.1.1-dev.22",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
7
7
  "lib",
8
8
  "cli.js",
9
- "src"
9
+ "src/lib",
10
+ "src/app"
10
11
  ],
11
12
  "module": "./dist/index.js",
12
13
  "types": "./dist/index.d.ts",
@@ -17,12 +18,15 @@
17
18
  ".": {
18
19
  "import": "./dist/index.js"
19
20
  },
20
- "./auth": {
21
- "import": "./lib/zudoku.auth.js"
21
+ "./auth/clerk": {
22
+ "import": "./lib/zudoku.auth-clerk.js"
22
23
  },
23
24
  "./plugins": {
24
25
  "import": "./lib/zudoku.plugins.js"
25
26
  },
27
+ "./openapi-worker": {
28
+ "import": "./lib/zudoku.openapi-worker.js"
29
+ },
26
30
  "./components": {
27
31
  "import": "./lib/zudoku.components.js"
28
32
  },
@@ -40,14 +44,9 @@
40
44
  },
41
45
  "./app/*": {
42
46
  "import": "./src/app/*"
43
- },
44
- "./open-api-worker": {
45
- "import": "./lib/zudoku.openapi-worker.js"
46
47
  }
47
48
  },
48
49
  "dependencies": {
49
- "@cfworker/json-schema": "1.12.8",
50
- "@clerk/clerk-js": "5.2.2",
51
50
  "@graphql-typed-document-node/core": "3.2.0",
52
51
  "@lekoarts/rehype-meta-as-attributes": "3.0.1",
53
52
  "@mdx-js/react": "3.0.1",
@@ -64,7 +63,6 @@
64
63
  "@vitejs/plugin-react": "4.3.1",
65
64
  "@zudoku/httpsnippet": "10.0.9",
66
65
  "autoprefixer": "10.4.19",
67
- "chalk": "5.3.0",
68
66
  "class-variance-authority": "0.7.0",
69
67
  "clsx": "2.1.1",
70
68
  "dotenv": "16.4.5",
@@ -79,6 +77,7 @@
79
77
  "oauth4webapi": "2.10.4",
80
78
  "object-hash": "3.0.0",
81
79
  "openapi-types": "12.1.3",
80
+ "picocolors": "^1.0.1",
82
81
  "postcss": "8.4.39",
83
82
  "posthog-node": "^4.0.1",
84
83
  "prism-react-renderer": "2.3.1",
@@ -92,7 +91,7 @@
92
91
  "remark-directive-rehype": "0.4.2",
93
92
  "remark-frontmatter": "5.0.0",
94
93
  "remark-gfm": "4.0.0",
95
- "remark-mdx-frontmatter": "4.0.0",
94
+ "remark-mdx-frontmatter": "5.0.0",
96
95
  "semver": "7.6.2",
97
96
  "slugify": "1.6.6",
98
97
  "strip-ansi": "7.1.0",
@@ -108,6 +107,7 @@
108
107
  "zustand": "4.5.4"
109
108
  },
110
109
  "devDependencies": {
110
+ "@clerk/clerk-js": "5.2.2",
111
111
  "@types/express": "^4.17.21",
112
112
  "@types/har-format": "^1.2.15",
113
113
  "@types/json-schema": "7.0.15",
@@ -1,11 +1,7 @@
1
1
  import { Clerk } from "@clerk/clerk-js";
2
2
  import { type AuthProvider } from "./authentication.js";
3
3
 
4
- export const clerkAuth = ({
5
- clerkPubKey,
6
- }: {
7
- clerkPubKey: string;
8
- }): AuthProvider => {
4
+ const clerkAuth = ({ clerkPubKey }: { clerkPubKey: string }): AuthProvider => {
9
5
  const clerkApi = new Clerk(clerkPubKey);
10
6
 
11
7
  const clerkIsLoaded = clerkApi.load({});
@@ -43,3 +39,5 @@ export const clerkAuth = ({
43
39
  },
44
40
  };
45
41
  };
42
+
43
+ export default clerkAuth;
@@ -1,24 +1,27 @@
1
1
  import { MDXProvider } from "@mdx-js/react";
2
2
  import { QueryClientProvider } from "@tanstack/react-query";
3
3
  import { memo, Suspense, useEffect, useMemo } from "react";
4
- import { type AuthProvider } from "./authentication/authentication.js";
5
- import {
6
- ComponentsProvider,
7
- DEFAULT_COMPONENTS,
8
- type ComponentsContextType,
9
- } from "./components/context/ComponentsContext.js";
10
- import { DevPortalProvider } from "./components/context/DevPortalProvider.js";
11
- import { ThemeProvider } from "./components/context/ThemeContext.js";
12
- import { ViewportAnchorProvider } from "./components/context/ViewportAnchorContext.js";
4
+ import { type AuthProvider } from "../authentication/authentication.js";
13
5
  import {
14
6
  DevPortalContext,
15
7
  queryClient,
16
8
  type NavigationItem,
17
- } from "./core/DevPortalContext.js";
18
- import { HelmetProvider } from "./core/helmet.js";
19
- import { type DevPortalPlugin } from "./core/plugins.js";
9
+ } from "../core/DevPortalContext.js";
10
+ import { HelmetProvider } from "../core/helmet.js";
11
+ import { type DevPortalPlugin } from "../core/plugins.js";
12
+ import {
13
+ MdxComponents,
14
+ type MdxComponentsType,
15
+ } from "../util/MdxComponents.js";
16
+ import {
17
+ ComponentsProvider,
18
+ DEFAULT_COMPONENTS,
19
+ type ComponentsContextType,
20
+ } from "./context/ComponentsContext.js";
21
+ import { DevPortalProvider } from "./context/DevPortalProvider.js";
22
+ import { ThemeProvider } from "./context/ThemeContext.js";
23
+ import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
20
24
  import { Router } from "./Router.js";
21
- import { MdxComponents, type MdxComponentsType } from "./util/MdxComponents.js";
22
25
 
23
26
  export const DevPortalSystemPaths = {
24
27
  Settings: "/settings",
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from "react";
2
- import { useRegisterAnchorElement } from "./components/context/ViewportAnchorContext.js";
3
- import { cn } from "./util/cn.js";
2
+ import { cn } from "../util/cn.js";
3
+ import { useRegisterAnchorElement } from "./context/ViewportAnchorContext.js";
4
4
 
5
5
  const getComponent = (level: number) => {
6
6
  switch (level) {
@@ -0,0 +1 @@
1
+ export { Link } from "../core/router.js";
@@ -1,7 +1,7 @@
1
1
  import { useMemo } from "react";
2
2
  import { createBrowserRouter, RouterProvider } from "react-router-dom";
3
- import { Layout } from "./components/Layout.js";
4
- import { DevPortalPlugin, isNavigationPlugin } from "./core/plugins.js";
3
+ import { DevPortalPlugin, isNavigationPlugin } from "../core/plugins.js";
4
+ import { Layout } from "./Layout.js";
5
5
 
6
6
  export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
7
7
  const router = useMemo(() => {
@@ -0,0 +1,3 @@
1
+ export { DevPortal } from "./DevPortal.js";
2
+ export { DynamicIcon } from "./DynamicIcon.js";
3
+ export { Link } from "./Link.js";
@@ -1,8 +1,11 @@
1
1
  import { QueryClient } from "@tanstack/react-query";
2
2
  import { type ReactNode } from "react";
3
3
  import { create } from "zustand";
4
- import { type DevPortalPath, type DevPortalProps } from "../DevPortal.js";
5
4
  import { type AuthProvider } from "../authentication/authentication.js";
5
+ import {
6
+ type DevPortalPath,
7
+ type DevPortalProps,
8
+ } from "../components/DevPortal.js";
6
9
  import {
7
10
  isApiKeyPlugin,
8
11
  isNavigationPlugin,
@@ -1,4 +1,4 @@
1
- import { DevPortalSystemPaths } from "../../DevPortal.js";
1
+ import { DevPortalSystemPaths } from "../../components/DevPortal.js";
2
2
  import { DevPortalContext } from "../../core/DevPortalContext.js";
3
3
  import {
4
4
  type ApiIdentityPlugin,
@@ -0,0 +1,5 @@
1
+ // Plugins
2
+ export { apiKeyPlugin } from "./api-key/index.js";
3
+ export { markdownPlugin } from "./markdown/index.js";
4
+ export { openApiPlugin } from "./openapi/index.js";
5
+ export { redirectPlugin } from "./redirect/index.js";
@@ -1,6 +1,6 @@
1
1
  import { useMemo, type PropsWithChildren, type ReactNode } from "react";
2
- import { Heading } from "../../Heading.js";
3
2
  import { CategoryHeading } from "../../components/CategoryHeading.js";
3
+ import { Heading } from "../../components/Heading.js";
4
4
  import { ProseClasses } from "../../components/Markdown.js";
5
5
  import { useTopNavigationItem } from "../../components/context/DevPortalProvider.js";
6
6
  import { isPathItem } from "../../components/navigation/util.js";
@@ -1,4 +1,4 @@
1
- import { Heading } from "../../Heading.js";
1
+ import { Heading } from "../../components/Heading.js";
2
2
  import { useTopNavigationItem } from "../../components/context/DevPortalProvider.js";
3
3
  import { isPathItem } from "../../components/navigation/util.js";
4
4
  import { Navigate, type RouteObject } from "../../core/router.js";
@@ -1,12 +1,12 @@
1
- import { Heading } from "../../Heading.js";
1
+ import { ResultOf } from "@graphql-typed-document-node/core";
2
2
  import { CategoryHeading } from "../../components/CategoryHeading.js";
3
+ import { Heading } from "../../components/Heading.js";
3
4
  import { Markdown, ProseClasses } from "../../components/Markdown.js";
4
5
  import { cn } from "../../util/cn.js";
5
6
  import { OperationListItem } from "./OperationListItem.js";
6
- import { useOasConfig } from "./index.js";
7
7
  import { graphql } from "./graphql/index.js";
8
+ import { useOasConfig } from "./index.js";
8
9
  import { useQuery } from "./util/urql.js";
9
- import { ResultOf } from "@graphql-typed-document-node/core";
10
10
 
11
11
  export const OperationsFragment = graphql(/* GraphQL */ `
12
12
  fragment OperationsFragment on OperationItem {
@@ -1,4 +1,4 @@
1
- import { Heading } from "../../Heading.js";
1
+ import { Heading } from "../../components/Heading.js";
2
2
  import { Markdown, ProseClasses } from "../../components/Markdown.js";
3
3
  import { groupBy } from "../../util/groupBy.js";
4
4
  import { OperationsFragment } from "./OperationList.js";
@@ -1,4 +1,4 @@
1
- import { Heading } from "../../Heading.js";
1
+ import { Heading } from "../../components/Heading.js";
2
2
  import type { ParameterGroup } from "./OperationListItem.js";
3
3
  import {
4
4
  ParameterListItem,
@@ -14,7 +14,7 @@ import {
14
14
  fetchExchange,
15
15
  } from "./util/urql.js";
16
16
 
17
- import { createSharedWorkerClient } from "zudoku/open-api-worker";
17
+ import { createSharedWorkerClient } from "zudoku/openapi-worker";
18
18
  import type { createSharedWorkerClient as createSharedWorkerClientType } from "./worker/createSharedWorkerClient.js";
19
19
 
20
20
  const OasContext = createContext<{ config: OasPluginConfig } | undefined>(
@@ -0,0 +1 @@
1
+ export { createSharedWorkerClient } from "./openapi/worker/createSharedWorkerClient.js";
@@ -2,7 +2,7 @@ import { MDXProvider } from "@mdx-js/react";
2
2
  import type { ComponentProps } from "react";
3
3
 
4
4
  import { Link } from "react-router-dom";
5
- import { Heading } from "../Heading.js";
5
+ import { Heading } from "../components/Heading.js";
6
6
  import { SyntaxHighlight } from "../components/SyntaxHighlight.js";
7
7
  import { Callout } from "../ui/Callout.js";
8
8
  import { cn } from "./cn.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"DevPortal.js","sourceRoot":"","sources":["../../src/lib/DevPortal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GAEnB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EACL,gBAAgB,EAChB,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAA0B,MAAM,yBAAyB,CAAC;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,QAAQ,EAAE,WAAW;CACb,CAAC;AAqBX,MAAM,cAAc,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC/C,MAAM,UAAU,GAAG,OAAO,CACxB,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,kBAAkB,EAAE,GAAG,K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,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAmB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAExE,MAAM,UAAU,MAAM,CAAC,EAAE,OAAO,EAAmC;IACjE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QAC1B,MAAM,MAAM,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAChD,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CACrD,CAAC;QAEF,OAAO,mBAAmB,CAAC;YACzB;gBACE,IAAI,EAAE,GAAG;gBACT,OAAO,EAAE,KAAC,MAAM,KAAG;gBACnB,YAAY,EAAE,CACZ,KAAC,MAAM,cACL,cAAK,SAAS,EAAC,2CAA2C,2CAEpD,GACC,CACV;gBACD,QAAQ,EAAE,MAAM;aACjB;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACd,OAAO,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,GAAI,CAAC;AAC5C,CAAC"}
@@ -1 +0,0 @@
1
- export { clerkAuth } from "./authentication/clerk.js";
package/dist/lib/auth.js DELETED
@@ -1,2 +0,0 @@
1
- export { clerkAuth } from "./authentication/clerk.js";
2
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,3 +0,0 @@
1
- export { DynamicIcon } from "./components/DynamicIcon.js";
2
- export { Link } from "./core/router.js";
3
- export { DevPortal } from "./DevPortal.js";
@@ -1,4 +0,0 @@
1
- export { DynamicIcon } from "./components/DynamicIcon.js";
2
- export { Link } from "./core/router.js";
3
- export { DevPortal } from "./DevPortal.js";
4
- //# sourceMappingURL=components.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/lib/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,4 +0,0 @@
1
- export { apiKeyPlugin } from "./plugins/api-key/index.js";
2
- export { markdownPlugin } from "./plugins/markdown/index.js";
3
- export { openApiPlugin } from "./plugins/openapi/index.js";
4
- export { redirectPlugin } from "./plugins/redirect/index.js";
@@ -1,6 +0,0 @@
1
- // Plugins
2
- export { apiKeyPlugin } from "./plugins/api-key/index.js";
3
- export { markdownPlugin } from "./plugins/markdown/index.js";
4
- export { openApiPlugin } from "./plugins/openapi/index.js";
5
- export { redirectPlugin } from "./plugins/redirect/index.js";
6
- //# sourceMappingURL=plugins.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/lib/plugins.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1,14 +0,0 @@
1
- import { runBuild } from "../../vite/build.js";
2
- import { printDiagnosticsToConsole } from "../common/output.js";
3
-
4
- export interface Arguments {
5
- dir: string;
6
- }
7
-
8
- export async function build(argv: Arguments) {
9
- printDiagnosticsToConsole("Starting build");
10
- printDiagnosticsToConsole("");
11
- printDiagnosticsToConsole("");
12
-
13
- await runBuild({ dir: argv.dir });
14
- }
package/src/cli/cli.ts DELETED
@@ -1,77 +0,0 @@
1
- // import * as dotenv from "dotenv";
2
- // dotenv.config();
3
-
4
- import * as Sentry from "@sentry/node";
5
- import { readFileSync } from "node:fs";
6
- import { fileURLToPath } from "node:url";
7
-
8
- import { gte } from "semver";
9
- import { hideBin } from "yargs/helpers";
10
- import yargs from "yargs/yargs";
11
- import build from "./cmds/build.js";
12
- import dev from "./cmds/dev.js";
13
- import { shutdownAnalytics } from "./common/analytics/lib.js";
14
- import { MAX_WAIT_PENDING_TIME_MS, SENTRY_DSN } from "./common/constants.js";
15
- import { logger } from "./common/logger.js";
16
- import { warnIfOutdatedVersion } from "./common/outdated.js";
17
- import { printCriticalFailureToConsoleAndExit } from "./common/output.js";
18
-
19
- const MIN_NODE_VERSION = "18.0.0";
20
-
21
- if (gte(process.versions.node, MIN_NODE_VERSION)) {
22
- let packageJson;
23
- try {
24
- packageJson = JSON.parse(
25
- readFileSync(
26
- fileURLToPath(new URL("../../package.json", import.meta.url)),
27
- "utf-8",
28
- ),
29
- );
30
- } catch (e) {
31
- logger.error(e);
32
- await printCriticalFailureToConsoleAndExit(
33
- `Unable to load zudoku cli. The package.json is missing or malformed.`,
34
- );
35
- }
36
-
37
- if (SENTRY_DSN) {
38
- Sentry.init({
39
- dsn: SENTRY_DSN,
40
- release: packageJson?.version,
41
- });
42
- }
43
-
44
- const cli = yargs(hideBin(process.argv))
45
- .command(build)
46
- .command(dev)
47
- .demandCommand()
48
- .strictCommands()
49
- .version(packageJson?.version)
50
- .fail(false)
51
- .help();
52
-
53
- try {
54
- await cli.argv;
55
-
56
- // Don't block
57
- void warnIfOutdatedVersion(packageJson?.version);
58
-
59
- void Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
60
- process.exit(0);
61
- });
62
- } catch (err) {
63
- if (err instanceof Error) {
64
- Sentry.captureException(err);
65
- }
66
- await printCriticalFailureToConsoleAndExit(err.message ?? err);
67
- cli.showHelp();
68
- } finally {
69
- await shutdownAnalytics();
70
- }
71
- } else {
72
- await printCriticalFailureToConsoleAndExit(
73
- `The zup CLI requires at least node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of node.js.
74
-
75
- Consider using a Node.js version manager such as https://github.com/nvm-sh/nvm.`,
76
- );
77
- }
@@ -1,24 +0,0 @@
1
- import { Argv } from "yargs";
2
- import { Arguments, build } from "../build/handler.js";
3
- import { captureEvent } from "../common/analytics/lib.js";
4
-
5
- export default {
6
- desc: "Build",
7
- command: "build",
8
- builder: (yargs: Argv): Argv<unknown> => {
9
- return yargs.option("dir", {
10
- type: "string",
11
- describe: "The directory containing your project",
12
- default: ".",
13
- normalize: true,
14
- hidden: true,
15
- });
16
- },
17
- handler: async (argv: unknown) => {
18
- await captureEvent({
19
- argv,
20
- event: "zudoku build",
21
- });
22
- await build(argv as Arguments);
23
- },
24
- };
@@ -1,29 +0,0 @@
1
- import { Argv } from "yargs";
2
- import { captureEvent } from "../common/analytics/lib.js";
3
- import { Arguments, dev } from "../dev/handler.js";
4
-
5
- export default {
6
- desc: "Runs locally",
7
- command: "dev",
8
- builder: (yargs: Argv): Argv<unknown> => {
9
- return yargs
10
- .option("dir", {
11
- type: "string",
12
- describe: "The directory containing your project",
13
- default: ".",
14
- normalize: true,
15
- hidden: true,
16
- })
17
- .option("port", {
18
- type: "number",
19
- describe: "The port to run the local server on",
20
- });
21
- },
22
- handler: async (argv: unknown) => {
23
- await captureEvent({
24
- argv,
25
- event: "zudoku dev",
26
- });
27
- await dev(argv as Arguments);
28
- },
29
- };
@@ -1,89 +0,0 @@
1
- // import { Context } from "@sentry/node/types/integrations/context.js";
2
- import { PostHog } from "posthog-node";
3
- import { POST_HOG_CAPTURE_KEY } from "../constants.js";
4
- import { machineId } from "../machine-id/lib.js";
5
-
6
- interface IdentifyMessageV1 {
7
- distinctId: string;
8
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
- properties?: Record<string | number, any>;
10
- disableGeoip?: boolean;
11
- }
12
-
13
- interface EventMessageV1 extends IdentifyMessageV1 {
14
- event: string;
15
- groups?: Record<string, string | number>;
16
- sendFeatureFlags?: boolean;
17
- timestamp?: Date;
18
- }
19
-
20
- interface ZuploEventMessage extends Omit<EventMessageV1, "distinctId"> {
21
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
- argv: any;
23
- }
24
-
25
- let _postHog: PostHog | undefined;
26
- // let _context: Context | undefined;
27
-
28
- function init(): PostHog | undefined {
29
- if (process.env.ZUPLO_DO_NOT_TRACK || !POST_HOG_CAPTURE_KEY) {
30
- return undefined;
31
- }
32
-
33
- _postHog = new PostHog(POST_HOG_CAPTURE_KEY, {
34
- host: "https://app.posthog.com",
35
- flushAt: 1,
36
- flushInterval: 1,
37
- });
38
-
39
- // // Use the additional information from sentry for the OS, CPU, etc
40
- // // This is a bit of a hack since this is not an official API from sentry
41
- // _context = (
42
- // getDefaultIntegrations({}).filter(
43
- // (integration) => integration.name == "Context",
44
- // ) as Context[]
45
- // )[0];
46
-
47
- return _postHog;
48
- }
49
-
50
- // A convenience wrapper so that callers do not have to inject the distincId for each call to capture
51
- export async function captureEvent({
52
- event,
53
- properties,
54
- groups,
55
- sendFeatureFlags,
56
- timestamp,
57
- disableGeoip,
58
- }: ZuploEventMessage): Promise<void> {
59
- if (_postHog === undefined) {
60
- init();
61
- }
62
-
63
- if (_postHog) {
64
- properties = properties ?? {};
65
- properties.$set_once = properties.$set_once ?? {};
66
-
67
- // Nice to have: set information if this is in CI
68
- if (process.env.CI) {
69
- properties["ci"] = process.env.CI;
70
- }
71
-
72
- // // Nice to have: set information about the machine
73
- // await _context?.addContext(properties);
74
-
75
- _postHog?.capture({
76
- distinctId: machineId(),
77
- event,
78
- properties,
79
- groups,
80
- sendFeatureFlags,
81
- timestamp,
82
- disableGeoip,
83
- });
84
- }
85
- }
86
-
87
- export async function shutdownAnalytics(): Promise<void> {
88
- return _postHog?.shutdown();
89
- }
@@ -1,10 +0,0 @@
1
- // Configuration
2
- export const CLI_XDG_FOLDER_NAME = "zudoku";
3
- export const VERSION_CHECK_FILE = "version.json";
4
-
5
- // Sentry
6
- export const SENTRY_DSN = undefined;
7
- export const MAX_WAIT_PENDING_TIME_MS = 1000;
8
-
9
- // PostHog
10
- export const POST_HOG_CAPTURE_KEY = undefined;
@@ -1,5 +0,0 @@
1
- import { LogLevel, createLogger } from "vite";
2
-
3
- export const logger = createLogger(
4
- (process.env.LOG_LEVEL || "info") as LogLevel,
5
- );