doccupine 0.0.147 → 0.0.148

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.
@@ -3,10 +3,30 @@ export const nextConfigTemplate = (analyticsConfig = null) => {
3
3
  if (!hasPostHog) {
4
4
  return `import type { NextConfig } from "next";
5
5
 
6
+ // Dev-only allowlist for reaching the dev server through a non-localhost
7
+ // hostname (a LAN IP, a Tailscale/VPN name, ...). Next blocks its dev
8
+ // resources - including the HMR socket Turbopack needs before it hydrates
9
+ // the page - for hosts it does not know, which leaves the site rendered but
10
+ // inert. Comma-separated hostnames, set via ALLOWED_DEV_ORIGINS in .env;
11
+ // production builds ignore it.
12
+ const allowedDevOrigins = (process.env.ALLOWED_DEV_ORIGINS ?? "")
13
+ .split(",")
14
+ .map((origin) => origin.trim())
15
+ .filter(Boolean);
16
+
6
17
  const nextConfig: NextConfig = {
18
+ ...(allowedDevOrigins.length > 0 ? { allowedDevOrigins } : {}),
7
19
  compiler: {
8
20
  styledComponents: true,
9
21
  },
22
+ // Type-checking runs through TypeScript 6's compiler API (the \`typescript\`
23
+ // dependency is aliased to @typescript/typescript6, whose only binary is
24
+ // \`tsc6\`). Next 16.3 defaults experimental.useTypeScriptCli to true, and
25
+ // that path requires a \`tsc\` bin, so builds fail with a "typescript is not
26
+ // installed" prompt unless the CLI path stays off.
27
+ experimental: {
28
+ useTypeScriptCli: false,
29
+ },
10
30
  // Trace the runtime-loaded corpus and precomputed embeddings index into the
11
31
  // serverless functions (dynamic fs reads are invisible to automatic tracing).
12
32
  outputFileTracingIncludes: {
@@ -42,10 +62,30 @@ export default nextConfig;
42
62
  const assetsHost = host.replace(".i.", "-assets.i.");
43
63
  return `import type { NextConfig } from "next";
44
64
 
65
+ // Dev-only allowlist for reaching the dev server through a non-localhost
66
+ // hostname (a LAN IP, a Tailscale/VPN name, ...). Next blocks its dev
67
+ // resources - including the HMR socket Turbopack needs before it hydrates
68
+ // the page - for hosts it does not know, which leaves the site rendered but
69
+ // inert. Comma-separated hostnames, set via ALLOWED_DEV_ORIGINS in .env;
70
+ // production builds ignore it.
71
+ const allowedDevOrigins = (process.env.ALLOWED_DEV_ORIGINS ?? "")
72
+ .split(",")
73
+ .map((origin) => origin.trim())
74
+ .filter(Boolean);
75
+
45
76
  const nextConfig: NextConfig = {
77
+ ...(allowedDevOrigins.length > 0 ? { allowedDevOrigins } : {}),
46
78
  compiler: {
47
79
  styledComponents: true,
48
80
  },
81
+ // Type-checking runs through TypeScript 6's compiler API (the \`typescript\`
82
+ // dependency is aliased to @typescript/typescript6, whose only binary is
83
+ // \`tsc6\`). Next 16.3 defaults experimental.useTypeScriptCli to true, and
84
+ // that path requires a \`tsc\` bin, so builds fail with a "typescript is not
85
+ // installed" prompt unless the CLI path stays off.
86
+ experimental: {
87
+ useTypeScriptCli: false,
88
+ },
49
89
  // Trace the runtime-loaded corpus and precomputed embeddings index into the
50
90
  // serverless functions (dynamic fs reads are invisible to automatic tracing).
51
91
  outputFileTracingIncludes: {
@@ -19,14 +19,14 @@ export const packageJsonTemplate = JSON.stringify({
19
19
  "@mdx-js/react": "^3.1.1",
20
20
  "@modelcontextprotocol/sdk": "^1.30.0",
21
21
  "beautiful-mermaid": "^1.1.3",
22
- "cherry-styled-components": "^0.2.12",
22
+ "cherry-styled-components": "^0.2.14",
23
23
  langchain: "^1.5.4",
24
24
  "lucide-react": "^1.28.0",
25
25
  minisearch: "^7.2.0",
26
- next: "16.2.12",
26
+ next: "16.3.0",
27
27
  "next-mdx-remote": "^6.0.0",
28
- "posthog-js": "^1.409.5",
29
- "posthog-node": "^5.47.3",
28
+ "posthog-js": "^1.410.7",
29
+ "posthog-node": "^5.47.8",
30
30
  react: "19.2.8",
31
31
  "react-dom": "19.2.8",
32
32
  "rehype-highlight": "^7.0.2",
@@ -38,22 +38,22 @@ export const packageJsonTemplate = JSON.stringify({
38
38
  zod: "^4.4.3",
39
39
  },
40
40
  devDependencies: {
41
- "@next/env": "16.2.12",
42
- "@next/eslint-plugin-next": "16.2.12",
41
+ "@next/env": "16.3.0",
42
+ "@next/eslint-plugin-next": "16.3.0",
43
43
  "@types/node": "^26",
44
44
  "@types/react": "^19",
45
45
  "@types/react-dom": "^19",
46
- "@typescript-eslint/eslint-plugin": "^8.65.0",
47
- "@typescript-eslint/parser": "^8.65.0",
46
+ "@typescript-eslint/eslint-plugin": "^8.66.0",
47
+ "@typescript-eslint/parser": "^8.66.0",
48
48
  "@typescript/native-preview": "^7.0.0-dev.20260707.2",
49
49
  eslint: "^10",
50
50
  "eslint-plugin-import": "^2.32.0",
51
51
  "eslint-plugin-jsx-a11y": "^6.10.2",
52
52
  "eslint-plugin-react": "^7.37.5",
53
53
  "eslint-plugin-react-hooks": "^7.1.1",
54
- globals: "^17.8.0",
54
+ globals: "^17.9.0",
55
55
  prettier: "^3.9.6",
56
- tsx: "^4.23.1",
56
+ tsx: "^4.23.5",
57
57
  typescript: "npm:@typescript/typescript6@^6.0.2",
58
58
  },
59
59
  }, null, 2) + "\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doccupine",
3
- "version": "0.0.147",
3
+ "version": "0.0.148",
4
4
  "description": "Free and open-source documentation platform. Write MDX, get a production-ready site with AI chat, built-in components, and an MCP server - in one command.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -10,7 +10,7 @@
10
10
  "engines": {
11
11
  "node": ">=22.12.0"
12
12
  },
13
- "packageManager": "pnpm@11.18.0",
13
+ "packageManager": "pnpm@11.20.0",
14
14
  "scripts": {
15
15
  "clean": "node scripts/clean.mjs",
16
16
  "build": "pnpm clean && tsc",
@@ -48,7 +48,7 @@
48
48
  "commander": "^15.0.0",
49
49
  "fs-extra": "^11.4.0",
50
50
  "gray-matter": "^4.0.3",
51
- "next": "^16.2.12",
51
+ "next": "^16.3.0",
52
52
  "prompts": "^2.4.2",
53
53
  "react": "^19.2.8",
54
54
  "react-dom": "^19.2.8"
@@ -1 +0,0 @@
1
- export declare const chatStylesTemplate = "import styled, { css, keyframes } from \"styled-components\";\nimport { Button } from \"cherry-styled-components\";\nimport Link from \"next/link\";\nimport { mq, Theme } from \"@/app/theme\";\nimport {\n styledAnchor,\n styledTable,\n stylesLists,\n StyledSmallButton,\n interactiveStyles,\n thinScrollbar,\n} from \"@/components/layout/SharedStyled\";\n\nconst styledText = css<{ theme: Theme }>`\n font-size: ${({ theme }) => theme.fontSizes.text.xs};\n line-height: ${({ theme }) => theme.lineHeights.text.xs};\n\n ${mq(\"lg\")} {\n font-size: ${({ theme }) => theme.fontSizes.small.lg};\n line-height: ${({ theme }) => theme.lineHeights.small.lg};\n }\n`;\n\nexport const StyledChatSurface = styled.div<{ $isVisible: boolean }>`\n position: fixed;\n inset: 0;\n z-index: 1000;\n pointer-events: none;\n\n & > * {\n pointer-events: auto;\n }\n\n ${({ $isVisible }) =>\n !$isVisible &&\n css`\n visibility: hidden;\n\n & > * {\n pointer-events: none;\n }\n `}\n`;\n\nexport const StyledChat = styled.div<{ theme: Theme; $isVisible: boolean }>`\n margin: 0;\n position: fixed;\n top: 0;\n right: 0;\n width: 100%;\n height: calc(100dvh - 90px);\n overflow-y: scroll;\n overflow-x: hidden;\n z-index: 1000;\n padding: 0 20px;\n /* See StyledChatForm: visibility snaps open and is delayed on close, so the\n panel is focusable as soon as it opens. */\n transition:\n transform 0.3s ease,\n opacity 0.3s ease,\n visibility 0s linear 0s;\n transform: translateX(0);\n background: ${({ theme }) => theme.colors.light};\n -webkit-overflow-scrolling: touch;\n opacity: 1;\n visibility: visible;\n\n &::-webkit-scrollbar {\n display: none;\n }\n\n ${({ $isVisible }) =>\n !$isVisible &&\n css`\n transform: translateX(100%);\n opacity: 0;\n visibility: hidden;\n transition-delay: 0s, 0s, 0.3s;\n `}\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n\n ${mq(\"lg\")} {\n width: 420px;\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n }\n`;\n\nconst loadingAnimation = keyframes`\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n`;\n\nconst rotateGradient = keyframes`\n 0% {\n --gradient-angle: 0deg;\n }\n 100% {\n --gradient-angle: 360deg;\n }\n`;\n\nconst pulseGlow = keyframes`\n 0%, 100% {\n opacity: 0.5;\n filter: blur(16px);\n }\n 50% {\n opacity: 1;\n filter: blur(22px);\n }\n`;\n\nconst sparkleFloat = keyframes`\n 0%, 100% {\n opacity: 0;\n transform: translateY(0) scale(0);\n }\n 50% {\n opacity: 0.9;\n transform: translateY(-20px) scale(1);\n }\n`;\n\nconst shimmer = keyframes`\n 0% {\n background-position: 0% center;\n }\n 50% {\n background-position: 100% center;\n }\n 100% {\n background-position: 0% center;\n }\n`;\n\nexport const StyledRainbowInputWrapper = styled.div<{\n theme: Theme;\n $isActive: boolean;\n}>`\n @property --gradient-angle {\n syntax: \"<angle>\";\n initial-value: 0deg;\n inherits: false;\n }\n\n position: relative;\n flex: 1;\n\n &::before {\n content: \"\";\n position: absolute;\n inset: -2px;\n border-radius: 14px;\n background: conic-gradient(\n from var(--gradient-angle),\n #cc5555,\n #d9a745,\n #3ab0cc,\n #cc7fc2,\n #4380cc,\n #4c1fa3,\n #cc5555\n );\n opacity: 0;\n transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);\n animation: ${rotateGradient} 3s linear infinite;\n z-index: 0;\n }\n\n &::after {\n content: \"\";\n position: absolute;\n inset: -10px;\n border-radius: 20px;\n background: conic-gradient(\n from var(--gradient-angle),\n #ff6b6b66,\n #feca5766,\n #48dbfb66,\n #ff9ff366,\n #54a0ff66,\n #5f27cd66,\n #ff6b6b66\n );\n opacity: 0;\n transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);\n animation:\n ${rotateGradient} 3s linear infinite,\n ${pulseGlow} 2s ease-in-out infinite;\n z-index: -1;\n pointer-events: none;\n }\n\n &:hover::before,\n &:focus-within::before {\n opacity: 1;\n }\n\n &:hover::after,\n &:focus-within::after {\n opacity: 1;\n }\n\n ${({ $isActive }) =>\n $isActive &&\n css`\n &::before {\n opacity: 1;\n }\n &::after {\n opacity: 1;\n }\n `}\n`;\n\nexport const StyledSparkleContainer = styled.div<{ $isActive: boolean }>`\n position: absolute;\n inset: -30px;\n pointer-events: none;\n overflow: hidden;\n border-radius: 30px;\n z-index: -2;\n opacity: 0;\n transition: opacity 0.4s ease;\n\n ${({ $isActive }) =>\n $isActive &&\n css`\n opacity: 1;\n `}\n`;\n\nexport const StyledSparkle = styled.div<{\n $color: string;\n $left: number;\n $top: number;\n $delay: number;\n}>`\n position: absolute;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: ${({ $color }) => $color};\n box-shadow: 0 0 6px ${({ $color }) => $color};\n left: ${({ $left }) => $left}%;\n top: ${({ $top }) => $top}%;\n animation: ${sparkleFloat} 2s ease-in-out infinite;\n animation-delay: ${({ $delay }) => $delay}s;\n`;\n\nexport const StyledRainbowInput = styled.input<{ theme: Theme }>`\n position: relative;\n z-index: 1;\n width: 100%;\n background: ${({ theme }) => theme.colors.light};\n border: 1px solid ${({ theme }) => theme.colors.grayLight};\n border-radius: 12px;\n padding: 12px 18px;\n font-size: ${({ theme }) => theme.fontSizes.text.lg};\n font-family: inherit;\n color: ${({ theme }) => theme.colors.dark};\n outline: none;\n transition:\n border-color 0.3s ease,\n box-shadow 0.3s ease;\n\n ${mq(\"lg\")} {\n font-size: ${({ theme }) => theme.fontSizes.small.lg};\n }\n\n &::placeholder {\n color: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.dark} 40%, transparent)`};\n transition: color 0.3s ease;\n }\n\n &:focus::placeholder {\n color: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.dark} 60%, transparent)`};\n }\n\n &:focus {\n border-color: transparent;\n }\n`;\n\nexport const StyledRainbowButton = styled(Button)<{\n theme: Theme;\n $hasContent: boolean;\n}>`\n padding-top: 10px;\n padding-bottom: 10px;\n position: relative;\n overflow: hidden;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;\n color: ${({ theme }) => theme.colors.surface};\n\n &::before {\n content: \"\";\n position: absolute;\n inset: 0;\n background: linear-gradient(\n 135deg,\n #ff6b6b,\n #feca57,\n #48dbfb,\n #ff9ff3,\n #54a0ff\n );\n background-size: 300% 300%;\n opacity: 0;\n transition: opacity 0.3s ease;\n z-index: 0;\n animation: ${shimmer} 3s linear infinite;\n width: 200%;\n }\n\n ${({ $hasContent }) =>\n $hasContent &&\n css`\n &::before {\n opacity: 1;\n }\n `}\n\n &:hover::before {\n opacity: 1;\n }\n\n &:hover {\n transform: scale(1.05);\n }\n\n &:active {\n transform: scale(0.95);\n }\n\n & svg {\n position: relative;\n z-index: 1;\n transition: transform 0.3s ease;\n }\n\n &:disabled,\n &:disabled:hover {\n background: ${({ theme }) => theme.colors.primaryDark};\n transform: none;\n box-shadow: none;\n\n &::before {\n opacity: 0;\n }\n }\n`;\n\nexport const StyledChatForm = styled.form<{\n theme: Theme;\n $isVisible: boolean;\n}>`\n display: flex;\n gap: 10px;\n justify-content: center;\n align-items: center;\n background: ${({ theme }) => theme.colors.light};\n padding: 20px;\n position: fixed;\n bottom: 0;\n right: 0;\n z-index: 1000;\n width: 100%;\n border-top: solid 1px ${({ theme }) => theme.colors.grayLight};\n /* visibility is animatable, so transitioning \"all\" keeps this hidden for the\n whole slide-in - long enough for the focus() that follows opening to be a\n silent no-op. Snap it on open (transition-delay below) and delay it on\n close so the slide-out stays visible while it animates. */\n transition:\n transform 0.3s ease,\n opacity 0.3s ease,\n visibility 0s linear 0.3s;\n transform: translateX(100%);\n opacity: 0;\n visibility: hidden;\n\n ${mq(\"lg\")} {\n width: 420px;\n border-left: solid 1px ${({ theme }) => theme.colors.grayLight};\n }\n\n ${({ $isVisible }) =>\n $isVisible &&\n css`\n opacity: 1;\n transform: translateX(0);\n visibility: visible;\n transition-delay: 0s;\n `}\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n\n & .loading {\n animation: ${loadingAnimation} 1s linear infinite;\n }\n`;\n\nexport const StyledGlowSmallButton = styled(StyledSmallButton)<{\n theme: Theme;\n $hasContent: boolean;\n}>`\n @property --gradient-angle {\n syntax: \"<angle>\";\n initial-value: 0deg;\n inherits: false;\n }\n\n position: relative;\n isolation: isolate;\n margin-right: 0;\n background: ${({ theme }) => theme.colors.light};\n padding: 0;\n\n &::before {\n content: \"\";\n inset: -2px;\n border-radius: 8px;\n background: conic-gradient(\n from var(--gradient-angle),\n #cc5555,\n #d9a745,\n #3ab0cc,\n #cc7fc2,\n #4380cc,\n #4c1fa3,\n #cc5555\n );\n opacity: 0;\n transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);\n animation: ${rotateGradient} 3s linear infinite;\n z-index: -1;\n position: absolute;\n top: -2px;\n left: -2px;\n width: calc(100% + 4px);\n height: calc(100% + 4px);\n }\n\n &::after {\n content: \"\";\n position: absolute;\n inset: -8px;\n border-radius: 14px;\n background: conic-gradient(\n from var(--gradient-angle),\n #ff6b6b66,\n #feca5766,\n #48dbfb66,\n #ff9ff366,\n #54a0ff66,\n #5f27cd66,\n #ff6b6b66\n );\n opacity: 0;\n transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);\n animation:\n ${rotateGradient} 3s linear infinite,\n ${pulseGlow} 2s ease-in-out infinite;\n z-index: -2;\n pointer-events: none;\n }\n\n &:hover::before,\n &:hover::after {\n opacity: 1;\n }\n\n & span {\n padding: 6px 8px;\n display: flex;\n background: ${({ theme }) => theme.colors.light};\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n gap: 6px;\n }\n\n ${({ $hasContent }) =>\n $hasContent &&\n css`\n &::before {\n opacity: 1;\n }\n &::after {\n opacity: 1;\n }\n `}\n`;\n\nexport const StyledError = styled.div`\n margin: 20px 0;\n width: 100%;\n`;\n\nconst loadingDotAnimation = keyframes`\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n`;\n\nexport const StyledLoading = styled.div<{ theme: Theme }>`\n overflow-x: auto;\n ${thinScrollbar};\n margin: 20px 0;\n width: 100%;\n font-weight: 600;\n ${styledText};\n color: ${({ theme }) => theme.colors.dark};\n\n & span {\n &:nth-child(1) {\n animation: ${loadingDotAnimation} 1s ease infinite;\n }\n &:nth-child(2) {\n animation: ${loadingDotAnimation} 1s ease infinite;\n animation-delay: 0.2s;\n }\n &:nth-child(3) {\n animation: ${loadingDotAnimation} 1s ease infinite;\n animation-delay: 0.4s;\n }\n }\n`;\n\nexport const StyledAnswer = styled.div<{ theme: Theme; $isAnswer: boolean }>`\n overflow-x: auto;\n ${thinScrollbar};\n background: ${({ theme }) => theme.colors.primary};\n color: ${({ theme }) => theme.colors.surface};\n padding: 9px 14px;\n border-radius: 16px 16px 4px 16px;\n margin: 20px 0 20px auto;\n width: fit-content;\n max-width: min(560px, 88%);\n font-weight: 500;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n ${styledText};\n\n & p {\n ${styledText};\n }\n\n ${({ $isAnswer }) =>\n $isAnswer &&\n css`\n background: transparent;\n color: ${({ theme }) => theme.colors.dark};\n padding: 0;\n width: 100%;\n max-width: 100%;\n margin: 20px 0;\n border-radius: 0;\n font-weight: inherit;\n white-space: normal;\n `}\n\n & code:not([class]) {\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.primaryLight} 20%, transparent)`};\n color: ${({ theme }) => theme.colors.dark};\n padding: 2px 4px;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n white-space: pre;\n }\n\n ${styledAnchor};\n ${stylesLists};\n ${styledTable};\n\n & pre,\n & .hljs {\n margin: 10px 0;\n }\n\n & .code-wrapper pre {\n margin: 0;\n ${styledText};\n }\n\n & > *:first-child {\n margin-top: 0;\n }\n\n & > *:last-child {\n margin-bottom: 0;\n\n & > *:last-child {\n margin-bottom: 0;\n }\n }\n\n & ul,\n & ol {\n & li {\n ${styledText};\n }\n }\n\n & img,\n & video,\n & iframe {\n max-width: 100%;\n border-radius: ${({ theme }) => theme.spacing.radius.lg};\n margin: 10px 0;\n display: block;\n }\n\n & h1,\n & h2,\n & h3,\n & h4,\n & h5,\n & h6 {\n margin: 10px 0;\n padding: 0;\n }\n`;\n\nexport const StyledSources = styled.div`\n display: flex;\n gap: 16px;\n flex-wrap: wrap;\n margin: -5px 0 20px;\n`;\n\nexport const StyledSourceLink = styled(Link)<{ theme: Theme }>`\n position: relative;\n text-decoration: none;\n font-size: ${({ theme }) => theme.fontSizes.small.lg};\n line-height: 1;\n color: ${({ theme }) => theme.colors.primary};\n display: flex;\n gap: 6px;\n transition: all 0.3s ease;\n font-weight: 600;\n white-space: nowrap;\n min-width: fit-content;\n background: ${({ theme }) =>\n `color-mix(in srgb, ${theme.colors.primaryLight} 10%, transparent)`};\n padding: 6px 8px;\n border-radius: ${({ theme }) => theme.spacing.radius.xs};\n ${interactiveStyles};\n\n & * {\n margin: auto 0;\n }\n\n &:hover {\n color: ${({ theme }) => theme.colors.accent};\n }\n`;\n\nexport const StyledChatTitle = styled.div<{ theme: Theme }>`\n display: flex;\n flex-wrap: nowrap;\n justify-content: space-between;\n position: sticky;\n margin: 0 -20px;\n padding: 16px 20px;\n height: 62px;\n top: 0;\n background: ${({ theme }) => theme.colors.light};\n border-bottom: solid 1px ${({ theme }) => theme.colors.grayLight};\n z-index: 1000;\n`;\n\nexport const StyledChatTitleIconWrapper = styled.span<{ theme: Theme }>`\n display: flex;\n align-items: center;\n gap: 12px;\n color: ${({ theme }) => theme.colors.dark};\n`;\n";