jamdesk 1.0.6 → 1.0.8
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/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/deps.js +2 -2
- package/dist/lib/deps.js.map +1 -1
- package/package.json +1 -1
- package/vendored/app/[[...slug]]/page.tsx +1 -1
- package/vendored/app/layout.tsx +6 -6
- package/vendored/components/navigation/Header.tsx +1 -1
- package/vendored/components/navigation/Sidebar.tsx +1 -1
- package/vendored/lib/build/error-parser.ts +14 -0
- package/vendored/lib/docs-types.ts +22 -7
- package/vendored/lib/preprocess-mdx.ts +56 -80
- package/vendored/lib/revalidation-helpers.ts +3 -2
- package/vendored/lib/revalidation-trigger.ts +1 -1
- package/vendored/next.config.js +12 -0
package/dist/index.js
CHANGED
|
@@ -13,7 +13,13 @@ import { isUserError } from './lib/errors.js';
|
|
|
13
13
|
import { output } from './lib/output.js';
|
|
14
14
|
const require = createRequire(import.meta.url);
|
|
15
15
|
const pkg = require('../package.json');
|
|
16
|
-
|
|
16
|
+
// Detect local dev: published package doesn't include src/
|
|
17
|
+
import { existsSync } from 'fs';
|
|
18
|
+
import { fileURLToPath } from 'url';
|
|
19
|
+
import { dirname, resolve } from 'path';
|
|
20
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
+
const isLocal = existsSync(resolve(dirname(__filename), '..', 'src'));
|
|
22
|
+
const VERSION = isLocal ? `${pkg.version} (local)` : pkg.version;
|
|
17
23
|
const program = new Command();
|
|
18
24
|
program
|
|
19
25
|
.name('jamdesk')
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,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AC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,IAAI,CAAC;IACH,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IACD,iCAAiC;IACjC,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC/D,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC;IACD,6BAA6B;IAC7B,MAAM,KAAK,CAAC;AACd,CAAC"}
|
package/dist/lib/deps.js
CHANGED
|
@@ -68,8 +68,8 @@ const REQUIRED_DEPS = {
|
|
|
68
68
|
'unist-util-visit': '^5.0.0',
|
|
69
69
|
'hast': '^1.0.0',
|
|
70
70
|
// CSS
|
|
71
|
-
'tailwindcss': '^4.
|
|
72
|
-
'@tailwindcss/postcss': '^4.
|
|
71
|
+
'tailwindcss': '^4.2.0',
|
|
72
|
+
'@tailwindcss/postcss': '^4.2.0',
|
|
73
73
|
'@tailwindcss/typography': '^0.5.10',
|
|
74
74
|
'postcss': '^8.4.32',
|
|
75
75
|
'autoprefixer': '^10.4.24',
|
package/dist/lib/deps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deps.js","sourceRoot":"","sources":["../../src/lib/deps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EA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C,gCAAgC,CAAC,CAAC;QAC5C,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamdesk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "CLI for Jamdesk — build, preview, and deploy documentation sites from MDX. Dev server with hot reload, 50+ components, OpenAPI support, AI search, and Mintlify migration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jamdesk",
|
|
@@ -446,7 +446,7 @@ export default async function DocPage({ params }: PageProps) {
|
|
|
446
446
|
|
|
447
447
|
// Preprocess MDX content to strip snippet imports
|
|
448
448
|
// (snippets are injected globally via AllComponents)
|
|
449
|
-
const content = preprocessMdx(rawContent);
|
|
449
|
+
const content = preprocessMdx(rawContent, { assetVersion: config.assetVersion });
|
|
450
450
|
|
|
451
451
|
// Extract and compile inline component exports from MDX
|
|
452
452
|
// Only pass MDXComponents (server-compatible) to inline extraction
|
package/vendored/app/layout.tsx
CHANGED
|
@@ -13,7 +13,7 @@ import { getTheme, type ThemeName } from '@/themes';
|
|
|
13
13
|
import { generateFontImports, generateFontVariables, isPreloadedFont, getPrimaryFontFamily } from '@/lib/fonts';
|
|
14
14
|
import fs from 'fs';
|
|
15
15
|
import path from 'path';
|
|
16
|
-
import type { DocsConfig } from '@/lib/docs-types';
|
|
16
|
+
import type { DocsConfig, Favicon, FontConfig } from '@/lib/docs-types';
|
|
17
17
|
import { ASSET_PREFIX, transformConfigImagePath } from '@/lib/docs-types';
|
|
18
18
|
import { LinkPrefixProvider } from '@/lib/link-prefix-context';
|
|
19
19
|
|
|
@@ -37,13 +37,13 @@ const DEFAULT_FAVICON = `${ASSET_PREFIX}/branding/favicon.svg`;
|
|
|
37
37
|
* Get favicon path from config, applying asset prefix for /images/ paths.
|
|
38
38
|
* Supports both string format and object format (light/dark variants).
|
|
39
39
|
*/
|
|
40
|
-
function getFaviconPath(favicon:
|
|
40
|
+
function getFaviconPath(favicon: Favicon | undefined, assetVersion?: string): string {
|
|
41
41
|
if (!favicon) return DEFAULT_FAVICON;
|
|
42
42
|
if (typeof favicon === 'string') {
|
|
43
|
-
return transformConfigImagePath(favicon) || DEFAULT_FAVICON;
|
|
43
|
+
return transformConfigImagePath(favicon, assetVersion) || DEFAULT_FAVICON;
|
|
44
44
|
}
|
|
45
45
|
// Object format: return light variant (dark mode handled client-side)
|
|
46
|
-
return transformConfigImagePath(favicon.light) || DEFAULT_FAVICON;
|
|
46
|
+
return transformConfigImagePath(favicon.light, assetVersion) || DEFAULT_FAVICON;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export async function generateMetadata(): Promise<Metadata> {
|
|
@@ -73,7 +73,7 @@ export async function generateMetadata(): Promise<Metadata> {
|
|
|
73
73
|
config = getDocsConfig();
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
const faviconPath = getFaviconPath(config.favicon);
|
|
76
|
+
const faviconPath = getFaviconPath(config.favicon, config.assetVersion);
|
|
77
77
|
return {
|
|
78
78
|
title: `${config.name} Documentation`,
|
|
79
79
|
description: config.description || `Documentation for ${config.name}`,
|
|
@@ -151,7 +151,7 @@ function generatePrimaryColorVariables(
|
|
|
151
151
|
// Supports both new font config format and legacy format
|
|
152
152
|
function getFontClassName(
|
|
153
153
|
themeName: ThemeName | undefined,
|
|
154
|
-
customFonts?:
|
|
154
|
+
customFonts?: FontConfig
|
|
155
155
|
): string {
|
|
156
156
|
// Extract primary font family from any format
|
|
157
157
|
const primaryFont = getPrimaryFontFamily(customFonts);
|
|
@@ -225,7 +225,7 @@ export function Header({ config, layout = 'header-logo', tabsPosition: tabsPosit
|
|
|
225
225
|
const isOverflowActive = overflowTabs.some(tab => tab.isActive);
|
|
226
226
|
|
|
227
227
|
// Normalize logo config
|
|
228
|
-
const logoConfig = normalizeLogo(config.logo);
|
|
228
|
+
const logoConfig = normalizeLogo(config.logo, config.assetVersion);
|
|
229
229
|
// When hostAtDocs is true, default logo link goes to /docs/, otherwise /
|
|
230
230
|
const logoHref = logoConfig?.href || (linkPrefix ? `${linkPrefix}/` : '/');
|
|
231
231
|
|
|
@@ -138,7 +138,7 @@ export function Sidebar({ config, layout = 'header-logo', tabsPosition: tabsPosi
|
|
|
138
138
|
const showSearchInSidebar = layout === 'sidebar-logo';
|
|
139
139
|
|
|
140
140
|
// Logo configuration
|
|
141
|
-
const logoConfig = normalizeLogo(config.logo);
|
|
141
|
+
const logoConfig = normalizeLogo(config.logo, config.assetVersion);
|
|
142
142
|
const logoHref = logoConfig?.href || '/';
|
|
143
143
|
const logoSrc = logoConfig ? (isDark && logoConfig.dark ? logoConfig.dark : logoConfig.light) : null;
|
|
144
144
|
const showLogoImage = logoSrc && !logoError;
|
|
@@ -665,6 +665,20 @@ export function parseErrorDetails(
|
|
|
665
665
|
};
|
|
666
666
|
}
|
|
667
667
|
|
|
668
|
+
// Cache refresh / revalidation failure (infrastructure issue, not user error)
|
|
669
|
+
if (phase === 'vercel_purge' || lowerOutput.includes('revalidation failed')) {
|
|
670
|
+
return {
|
|
671
|
+
type: 'temporary',
|
|
672
|
+
message: 'Cache refresh failed',
|
|
673
|
+
details:
|
|
674
|
+
'Your documentation was built and uploaded successfully, but we couldn\'t refresh the cache. ' +
|
|
675
|
+
'This is a temporary server issue — your content was not affected.',
|
|
676
|
+
suggestion:
|
|
677
|
+
'Click "Try Again" to rebuild. This usually resolves on its own.\n\n' +
|
|
678
|
+
'If the problem persists after retrying, please contact support.',
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
|
|
668
682
|
// Default error - still include file location if we found one
|
|
669
683
|
let details = message || 'An error occurred during the build process.';
|
|
670
684
|
if (errorSource.file) {
|
|
@@ -786,6 +786,9 @@ export interface DocsConfig {
|
|
|
786
786
|
// Runtime: Set by ISR middleware based on project config
|
|
787
787
|
// When true, all navigation links should be prefixed with /docs
|
|
788
788
|
hostAtDocs?: boolean;
|
|
789
|
+
|
|
790
|
+
// Injected at build time for cache busting image URLs
|
|
791
|
+
assetVersion?: string;
|
|
789
792
|
}
|
|
790
793
|
|
|
791
794
|
// =============================================================================
|
|
@@ -825,15 +828,28 @@ export function normalizeNavPage(page: NavigationPage): {
|
|
|
825
828
|
};
|
|
826
829
|
}
|
|
827
830
|
|
|
831
|
+
/**
|
|
832
|
+
* Append a cache-busting version query parameter to a URL.
|
|
833
|
+
* Handles URLs that may already have query params.
|
|
834
|
+
*/
|
|
835
|
+
export function appendAssetVersion(url: string, assetVersion?: string): string {
|
|
836
|
+
if (!assetVersion) return url;
|
|
837
|
+
const separator = url.includes('?') ? '&' : '?';
|
|
838
|
+
return `${url}${separator}v=${assetVersion}`;
|
|
839
|
+
}
|
|
840
|
+
|
|
828
841
|
/**
|
|
829
842
|
* Transform an image path from /images/... to /_jd/images/...
|
|
830
843
|
*
|
|
831
844
|
* Used for config-defined images (favicon, logo) that need the asset prefix.
|
|
832
845
|
*/
|
|
833
|
-
export function transformConfigImagePath(
|
|
846
|
+
export function transformConfigImagePath(
|
|
847
|
+
path: string | undefined,
|
|
848
|
+
assetVersion?: string,
|
|
849
|
+
): string | undefined {
|
|
834
850
|
if (!path) return path;
|
|
835
851
|
if (path.startsWith('/images/')) {
|
|
836
|
-
return ASSET_PREFIX + path;
|
|
852
|
+
return appendAssetVersion(ASSET_PREFIX + path, assetVersion);
|
|
837
853
|
}
|
|
838
854
|
return path;
|
|
839
855
|
}
|
|
@@ -842,19 +858,18 @@ export function transformConfigImagePath(path: string | undefined): string | und
|
|
|
842
858
|
* Normalize logo config to consistent object format.
|
|
843
859
|
* Also transforms /images/... paths to /_jd/images/...
|
|
844
860
|
*/
|
|
845
|
-
export function normalizeLogo(logo: Logo | undefined): LogoConfig | null {
|
|
861
|
+
export function normalizeLogo(logo: Logo | undefined, assetVersion?: string): LogoConfig | null {
|
|
846
862
|
if (!logo) return null;
|
|
847
863
|
if (typeof logo === 'string') {
|
|
848
|
-
return { light: transformConfigImagePath(logo)! };
|
|
864
|
+
return { light: transformConfigImagePath(logo, assetVersion)! };
|
|
849
865
|
}
|
|
850
866
|
return {
|
|
851
867
|
...logo,
|
|
852
|
-
light: transformConfigImagePath(logo.light)!,
|
|
853
|
-
dark: transformConfigImagePath(logo.dark),
|
|
868
|
+
light: transformConfigImagePath(logo.light, assetVersion)!,
|
|
869
|
+
dark: transformConfigImagePath(logo.dark, assetVersion),
|
|
854
870
|
};
|
|
855
871
|
}
|
|
856
872
|
|
|
857
|
-
|
|
858
873
|
/**
|
|
859
874
|
* Normalize icon config to get the icon name string
|
|
860
875
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* are injected globally via MDXComponents.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ASSET_PREFIX } from './docs-types';
|
|
9
|
+
import { ASSET_PREFIX, appendAssetVersion } from './docs-types';
|
|
10
10
|
import { checkForDeprecatedComponents } from './deprecated-components';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -645,60 +645,61 @@ export function unindentJsxAfterListItems(content: string): string {
|
|
|
645
645
|
const IMAGE_PATH_PROPS = ['src', 'img', 'icon'] as const;
|
|
646
646
|
|
|
647
647
|
/**
|
|
648
|
-
*
|
|
649
|
-
*
|
|
650
|
-
* Converts:
|
|
651
|
-
* -  → <img src="url" alt="alt" width="100" height="20" />
|
|
652
|
-
* -  → <img src="url" alt="alt" width="250" />
|
|
653
|
-
* -  → <img src="url" alt="alt" height="250" />
|
|
648
|
+
* Apply a transform function to text outside fenced code blocks.
|
|
654
649
|
*
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
* @param content - Raw MDX content
|
|
659
|
-
* @returns Content with dimension images converted to img tags
|
|
650
|
+
* Splits content into code-block and non-code-block segments,
|
|
651
|
+
* applies the transform only to non-code-block text, and preserves
|
|
652
|
+
* code blocks verbatim.
|
|
660
653
|
*/
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
654
|
+
function transformOutsideCodeBlocks(
|
|
655
|
+
content: string,
|
|
656
|
+
transform: (text: string) => string,
|
|
657
|
+
): string {
|
|
664
658
|
const parts: string[] = [];
|
|
665
659
|
let lastIndex = 0;
|
|
666
660
|
let insideCodeBlock = false;
|
|
667
661
|
const lines = content.split('\n');
|
|
668
662
|
|
|
669
663
|
for (let i = 0; i < lines.length; i++) {
|
|
670
|
-
|
|
671
|
-
if (line.trim().startsWith('```')) {
|
|
664
|
+
if (lines[i].trim().startsWith('```')) {
|
|
672
665
|
if (!insideCodeBlock) {
|
|
673
|
-
|
|
674
|
-
const beforeCode = lines.slice(lastIndex, i).join('\n');
|
|
675
|
-
parts.push(transformImageDimensionsInText(beforeCode));
|
|
666
|
+
parts.push(transform(lines.slice(lastIndex, i).join('\n')));
|
|
676
667
|
lastIndex = i;
|
|
677
668
|
}
|
|
678
669
|
insideCodeBlock = !insideCodeBlock;
|
|
679
670
|
if (!insideCodeBlock) {
|
|
680
|
-
// End of code block - preserve it as-is
|
|
681
671
|
parts.push(lines.slice(lastIndex, i + 1).join('\n'));
|
|
682
672
|
lastIndex = i + 1;
|
|
683
673
|
}
|
|
684
674
|
}
|
|
685
675
|
}
|
|
686
676
|
|
|
687
|
-
// Handle remaining content after last code block
|
|
688
677
|
if (lastIndex < lines.length) {
|
|
689
678
|
const remaining = lines.slice(lastIndex).join('\n');
|
|
690
|
-
|
|
691
|
-
// Unclosed code block - preserve as-is
|
|
692
|
-
parts.push(remaining);
|
|
693
|
-
} else {
|
|
694
|
-
// Regular content - transform it
|
|
695
|
-
parts.push(transformImageDimensionsInText(remaining));
|
|
696
|
-
}
|
|
679
|
+
parts.push(insideCodeBlock ? remaining : transform(remaining));
|
|
697
680
|
}
|
|
698
681
|
|
|
699
682
|
return parts.join('\n');
|
|
700
683
|
}
|
|
701
684
|
|
|
685
|
+
/**
|
|
686
|
+
* Transform Markdown image syntax with dimension suffixes to HTML img tags.
|
|
687
|
+
*
|
|
688
|
+
* Converts:
|
|
689
|
+
* -  → <img src="url" alt="alt" width="100" height="20" />
|
|
690
|
+
* -  → <img src="url" alt="alt" width="250" />
|
|
691
|
+
* -  → <img src="url" alt="alt" height="250" />
|
|
692
|
+
*
|
|
693
|
+
* The dimension syntax requires a space before the equals sign.
|
|
694
|
+
* This is compatible with Markdown editors like Mou and Marked 2.
|
|
695
|
+
*
|
|
696
|
+
* @param content - Raw MDX content
|
|
697
|
+
* @returns Content with dimension images converted to img tags
|
|
698
|
+
*/
|
|
699
|
+
export function transformImageDimensions(content: string): string {
|
|
700
|
+
return transformOutsideCodeBlocks(content, transformImageDimensionsInText);
|
|
701
|
+
}
|
|
702
|
+
|
|
702
703
|
/**
|
|
703
704
|
* Transform Markdown image paths to use the Jamdesk asset prefix.
|
|
704
705
|
*
|
|
@@ -712,51 +713,24 @@ export function transformImageDimensions(content: string): string {
|
|
|
712
713
|
* @param content - Raw MDX content
|
|
713
714
|
* @returns Content with Markdown image URLs normalized under ASSET_PREFIX
|
|
714
715
|
*/
|
|
715
|
-
function transformMarkdownImagePaths(content: string): string {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
for (let i = 0; i < lines.length; i++) {
|
|
722
|
-
const line = lines[i];
|
|
723
|
-
if (line.trim().startsWith('```')) {
|
|
724
|
-
if (!insideCodeBlock) {
|
|
725
|
-
const beforeCode = lines.slice(lastIndex, i).join('\n');
|
|
726
|
-
parts.push(transformMarkdownImagePathsInText(beforeCode));
|
|
727
|
-
lastIndex = i;
|
|
728
|
-
}
|
|
729
|
-
insideCodeBlock = !insideCodeBlock;
|
|
730
|
-
if (!insideCodeBlock) {
|
|
731
|
-
parts.push(lines.slice(lastIndex, i + 1).join('\n'));
|
|
732
|
-
lastIndex = i + 1;
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
if (lastIndex < lines.length) {
|
|
738
|
-
const remaining = lines.slice(lastIndex).join('\n');
|
|
739
|
-
if (insideCodeBlock) {
|
|
740
|
-
parts.push(remaining);
|
|
741
|
-
} else {
|
|
742
|
-
parts.push(transformMarkdownImagePathsInText(remaining));
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
return parts.join('\n');
|
|
716
|
+
function transformMarkdownImagePaths(content: string, assetVersion?: string): string {
|
|
717
|
+
return transformOutsideCodeBlocks(
|
|
718
|
+
content,
|
|
719
|
+
(text) => transformMarkdownImagePathsInText(text, assetVersion),
|
|
720
|
+
);
|
|
747
721
|
}
|
|
748
722
|
|
|
749
|
-
function transformMarkdownImagePathsInText(text: string): string {
|
|
723
|
+
function transformMarkdownImagePathsInText(text: string, assetVersion?: string): string {
|
|
750
724
|
const pattern = /!\[([^\]]*)\]\(([^)\s]+)(\s+["'][^"']*["'])?\)/g;
|
|
751
725
|
|
|
752
726
|
return text.replace(pattern, (match, alt, url, title) => {
|
|
753
|
-
const normalized = normalizeMarkdownImageUrl(url as string);
|
|
727
|
+
const normalized = normalizeMarkdownImageUrl(url as string, assetVersion);
|
|
754
728
|
if (!normalized) return match;
|
|
755
729
|
return ``;
|
|
756
730
|
});
|
|
757
731
|
}
|
|
758
732
|
|
|
759
|
-
function normalizeMarkdownImageUrl(url: string): string | null {
|
|
733
|
+
function normalizeMarkdownImageUrl(url: string, assetVersion?: string): string | null {
|
|
760
734
|
if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith('data:')) {
|
|
761
735
|
return null;
|
|
762
736
|
}
|
|
@@ -766,15 +740,15 @@ function normalizeMarkdownImageUrl(url: string): string | null {
|
|
|
766
740
|
}
|
|
767
741
|
|
|
768
742
|
if (url.startsWith('/images/')) {
|
|
769
|
-
return `${ASSET_PREFIX}${url}
|
|
743
|
+
return appendAssetVersion(`${ASSET_PREFIX}${url}`, assetVersion);
|
|
770
744
|
}
|
|
771
745
|
|
|
772
746
|
if (url.startsWith('./images/')) {
|
|
773
|
-
return `${ASSET_PREFIX}/${url.slice(2)}
|
|
747
|
+
return appendAssetVersion(`${ASSET_PREFIX}/${url.slice(2)}`, assetVersion);
|
|
774
748
|
}
|
|
775
749
|
|
|
776
750
|
if (url.startsWith('images/')) {
|
|
777
|
-
return `${ASSET_PREFIX}/${url}
|
|
751
|
+
return appendAssetVersion(`${ASSET_PREFIX}/${url}`, assetVersion);
|
|
778
752
|
}
|
|
779
753
|
|
|
780
754
|
return null;
|
|
@@ -820,26 +794,27 @@ function transformImageDimensionsInText(text: string): string {
|
|
|
820
794
|
* @param content - Raw MDX content
|
|
821
795
|
* @returns Content with image paths normalized to absolute paths under ASSET_PREFIX
|
|
822
796
|
*/
|
|
823
|
-
export function transformRelativeImagePaths(content: string): string {
|
|
797
|
+
export function transformRelativeImagePaths(content: string, assetVersion?: string): string {
|
|
824
798
|
let result = content;
|
|
825
799
|
|
|
826
800
|
for (const prop of IMAGE_PATH_PROPS) {
|
|
827
|
-
//
|
|
801
|
+
// Shared replacement: rewrites the captured image path under ASSET_PREFIX
|
|
802
|
+
const rewrite = (_match: string, quote: string, imgPath: string): string =>
|
|
803
|
+
`${prop}=${quote}${appendAssetVersion(`${ASSET_PREFIX}/${imgPath}`, assetVersion)}${quote}`;
|
|
804
|
+
|
|
805
|
+
// ./images/... -> /_jd/images/...?v=xxx
|
|
828
806
|
result = result.replace(
|
|
829
|
-
new RegExp(`${prop}=(["'])\\./(images/[^"']+)\\1`, 'g'),
|
|
830
|
-
`${prop}=$1${ASSET_PREFIX}/$2$1`
|
|
807
|
+
new RegExp(`${prop}=(["'])\\./(images/[^"']+)\\1`, 'g'), rewrite,
|
|
831
808
|
);
|
|
832
809
|
|
|
833
|
-
// images/... -> /_jd/images
|
|
810
|
+
// images/... -> /_jd/images/...?v=xxx (skip URLs, data URIs, and paths starting with /)
|
|
834
811
|
result = result.replace(
|
|
835
|
-
new RegExp(`${prop}=(["'])(?!/|https?://|data:)(images/[^"']+)\\1`, 'g'),
|
|
836
|
-
`${prop}=$1${ASSET_PREFIX}/$2$1`
|
|
812
|
+
new RegExp(`${prop}=(["'])(?!/|https?://|data:)(images/[^"']+)\\1`, 'g'), rewrite,
|
|
837
813
|
);
|
|
838
814
|
|
|
839
|
-
// /images/... -> /_jd/images
|
|
815
|
+
// /images/... -> /_jd/images/...?v=xxx
|
|
840
816
|
result = result.replace(
|
|
841
|
-
new RegExp(`${prop}=(["'])/(images/[^"']+)\\1`, 'g'),
|
|
842
|
-
`${prop}=$1${ASSET_PREFIX}/$2$1`
|
|
817
|
+
new RegExp(`${prop}=(["'])/(images/[^"']+)\\1`, 'g'), rewrite,
|
|
843
818
|
);
|
|
844
819
|
}
|
|
845
820
|
|
|
@@ -892,8 +867,9 @@ export function containsView(content: string): boolean {
|
|
|
892
867
|
* @param content - Raw MDX content
|
|
893
868
|
* @returns Preprocessed MDX content
|
|
894
869
|
*/
|
|
895
|
-
export function preprocessMdx(content: string): string {
|
|
870
|
+
export function preprocessMdx(content: string, options?: { assetVersion?: string }): string {
|
|
896
871
|
let processed = content;
|
|
872
|
+
const assetVersion = options?.assetVersion;
|
|
897
873
|
|
|
898
874
|
// Strip snippet imports
|
|
899
875
|
processed = stripSnippetImports(processed);
|
|
@@ -928,10 +904,10 @@ export function preprocessMdx(content: string): string {
|
|
|
928
904
|
processed = transformImageDimensions(processed);
|
|
929
905
|
|
|
930
906
|
// Transform Markdown image URLs so nested pages resolve assets correctly
|
|
931
|
-
processed = transformMarkdownImagePaths(processed);
|
|
907
|
+
processed = transformMarkdownImagePaths(processed, assetVersion);
|
|
932
908
|
|
|
933
909
|
// Transform relative image paths to absolute paths
|
|
934
|
-
processed = transformRelativeImagePaths(processed);
|
|
910
|
+
processed = transformRelativeImagePaths(processed, assetVersion);
|
|
935
911
|
|
|
936
912
|
// Check for deprecated components (defense-in-depth - builds also check earlier)
|
|
937
913
|
const deprecatedErrors = checkForDeprecatedComponents(processed, 'content');
|
|
@@ -22,7 +22,7 @@ import { clearNavigationCache } from './navigation-resolver';
|
|
|
22
22
|
* @returns true if secret is valid
|
|
23
23
|
*/
|
|
24
24
|
export function validateRevalidateSecret(secret: string | null): boolean {
|
|
25
|
-
const expectedSecret = process.env.REVALIDATE_SECRET;
|
|
25
|
+
const expectedSecret = process.env.REVALIDATE_SECRET?.trim();
|
|
26
26
|
|
|
27
27
|
if (!expectedSecret) {
|
|
28
28
|
// No secret configured - reject all requests
|
|
@@ -34,7 +34,8 @@ export function validateRevalidateSecret(secret: string | null): boolean {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// Use constant-time comparison to prevent timing attacks
|
|
37
|
-
|
|
37
|
+
// Trim both sides to prevent trailing whitespace mismatches from env vars
|
|
38
|
+
const secretBuffer = Buffer.from(secret.trim());
|
|
38
39
|
const expectedBuffer = Buffer.from(expectedSecret);
|
|
39
40
|
|
|
40
41
|
// timingSafeEqual requires equal length buffers
|
|
@@ -20,7 +20,7 @@ export async function triggerRevalidation(options: RevalidationOptions): Promise
|
|
|
20
20
|
const { projectSlug, changedPaths, all } = options;
|
|
21
21
|
|
|
22
22
|
const isrAppUrl = process.env.ISR_APP_URL || process.env.VERCEL_DEPLOYMENT_URL || 'https://docs.jamdesk.app';
|
|
23
|
-
const secret = process.env.REVALIDATE_SECRET || '';
|
|
23
|
+
const secret = (process.env.REVALIDATE_SECRET || '').trim();
|
|
24
24
|
|
|
25
25
|
const body: Record<string, unknown> = {
|
|
26
26
|
project: projectSlug,
|
package/vendored/next.config.js
CHANGED
|
@@ -14,6 +14,18 @@
|
|
|
14
14
|
const nextConfig = {
|
|
15
15
|
// Hide dev indicator (floating icon in bottom-left)
|
|
16
16
|
devIndicators: false,
|
|
17
|
+
// Allow /_jd/ image paths with ?v= cache-busting query strings in <Image>
|
|
18
|
+
images: {
|
|
19
|
+
localPatterns: [
|
|
20
|
+
{
|
|
21
|
+
pathname: '/_jd/**',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
pathname: '/**',
|
|
25
|
+
search: '',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
17
29
|
// Keep swagger-parser external (uses Node.js APIs)
|
|
18
30
|
serverExternalPackages: ['@apidevtools/swagger-parser'],
|
|
19
31
|
// Turbopack config - only resolveAlias, NOT root (root causes caching issues)
|