@brainfish-ai/devdoc 0.1.50 → 0.1.52
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/cli/commands/deploy.js +83 -3
- package/dist/cli/commands/domain.js +27 -109
- package/package.json +1 -1
- package/renderer/app/api/collections/route.js +34 -10
- package/renderer/app/api/deploy/route.js +10 -3
- package/renderer/app/api/domains/add/route.js +71 -107
- package/renderer/app/api/domains/remove/route.js +21 -13
- package/renderer/app/api/domains/status/route.js +17 -19
- package/renderer/app/api/domains/verify/route.js +65 -141
- package/renderer/app/api/upload/spec/route.js +101 -0
- package/renderer/lib/docs/config/domain-schema.js +0 -38
- package/renderer/lib/docs/config/index.js +1 -1
- package/renderer/lib/storage/blob.js +8 -12
|
@@ -143,41 +143,3 @@ export const domainConfigSchema = z.object({
|
|
|
143
143
|
normalized = normalized.split(':')[0];
|
|
144
144
|
return normalized;
|
|
145
145
|
}
|
|
146
|
-
/**
|
|
147
|
-
* Get DNS instructions for a custom domain
|
|
148
|
-
*
|
|
149
|
-
* NOTE: When Vercel integration is enabled (VERCEL_API_TOKEN + VERCEL_PROJECT_ID),
|
|
150
|
-
* the actual DNS instructions come from Vercel's API response.
|
|
151
|
-
* This function is used as a fallback for legacy/local development mode.
|
|
152
|
-
*
|
|
153
|
-
* For Vercel-hosted projects:
|
|
154
|
-
* - Subdomains: CNAME to cname.vercel-dns.com
|
|
155
|
-
* - Apex domains: A record to 76.76.21.21
|
|
156
|
-
*
|
|
157
|
-
* @param customDomain - The custom domain (e.g., "docs.example.com")
|
|
158
|
-
* @returns DNS instructions for CNAME and TXT records
|
|
159
|
-
*/ export function getDnsInstructions(customDomain) {
|
|
160
|
-
const parts = customDomain.split('.');
|
|
161
|
-
const subdomain = parts.length > 2 ? parts[0] : '@';
|
|
162
|
-
const isApexDomain = parts.length <= 2;
|
|
163
|
-
return {
|
|
164
|
-
cname: {
|
|
165
|
-
name: subdomain === '@' ? customDomain : subdomain,
|
|
166
|
-
// Use Vercel's actual DNS target
|
|
167
|
-
value: isApexDomain ? '76.76.21.21' : 'cname.vercel-dns.com'
|
|
168
|
-
},
|
|
169
|
-
txt: {
|
|
170
|
-
name: `_devdoc-verify.${customDomain}`,
|
|
171
|
-
value: ''
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Get human-readable DNS type based on domain
|
|
177
|
-
*
|
|
178
|
-
* @param customDomain - The custom domain
|
|
179
|
-
* @returns 'A' for apex domains, 'CNAME' for subdomains
|
|
180
|
-
*/ export function getDnsRecordType(customDomain) {
|
|
181
|
-
const parts = customDomain.split('.');
|
|
182
|
-
return parts.length <= 2 ? 'A' : 'CNAME';
|
|
183
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Configuration Module Exports
|
|
3
3
|
*/ export { docsConfigSchema, parseDocsConfig, safeParseDocsConfig, getDefaultDocsConfig } from './schema';
|
|
4
|
-
export { domainConfigSchema, parseDomainConfig, safeParseDomainConfig, isValidDomain, normalizeDomain
|
|
4
|
+
export { domainConfigSchema, parseDomainConfig, safeParseDomainConfig, isValidDomain, normalizeDomain } from './domain-schema';
|
|
5
5
|
export { loadDocsConfig, safeLoadDocsConfig, clearConfigCache, hasDocsConfig, getContentDir, resolvePagePath, loadPageContent, listMdxFiles } from './loader';
|
|
6
6
|
export { isDevMode, isProductionMode, shouldShowItem } from './environment';
|
|
@@ -30,18 +30,16 @@ function _getFileBlobPath(slug, filePath) {
|
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Store project content in Vercel Blob (or local filesystem in dev)
|
|
33
|
-
*/ export async function storeProjectContent(slug, name, docsJson, files, themeJson,
|
|
33
|
+
*/ export async function storeProjectContent(slug, name, docsJson, files, themeJson, openApiSpecUrls, graphqlSchemaUrls) {
|
|
34
34
|
const now = new Date().toISOString();
|
|
35
35
|
const content = {
|
|
36
36
|
slug,
|
|
37
37
|
name,
|
|
38
38
|
docsJson: JSON.stringify(docsJson),
|
|
39
39
|
themeJson: themeJson ? JSON.stringify(themeJson) : undefined,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
])) : undefined,
|
|
44
|
-
graphqlSchemas,
|
|
40
|
+
// Only store URLs - specs/schemas are in blob storage
|
|
41
|
+
openApiSpecUrls,
|
|
42
|
+
graphqlSchemaUrls,
|
|
45
43
|
files,
|
|
46
44
|
createdAt: now,
|
|
47
45
|
updatedAt: now
|
|
@@ -93,7 +91,7 @@ function _getFileBlobPath(slug, filePath) {
|
|
|
93
91
|
}
|
|
94
92
|
/**
|
|
95
93
|
* Update existing project content
|
|
96
|
-
*/ export async function updateProjectContent(slug, docsJson, files, themeJson,
|
|
94
|
+
*/ export async function updateProjectContent(slug, docsJson, files, themeJson, openApiSpecUrls, graphqlSchemaUrls) {
|
|
97
95
|
// Get existing content to preserve createdAt
|
|
98
96
|
const existing = await getProjectContent(slug);
|
|
99
97
|
const now = new Date().toISOString();
|
|
@@ -102,11 +100,9 @@ function _getFileBlobPath(slug, filePath) {
|
|
|
102
100
|
name: existing?.name || slug,
|
|
103
101
|
docsJson: JSON.stringify(docsJson),
|
|
104
102
|
themeJson: themeJson ? JSON.stringify(themeJson) : undefined,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
])) : undefined,
|
|
109
|
-
graphqlSchemas,
|
|
103
|
+
// Only store URLs - specs/schemas are in blob storage
|
|
104
|
+
openApiSpecUrls,
|
|
105
|
+
graphqlSchemaUrls,
|
|
110
106
|
files,
|
|
111
107
|
createdAt: existing?.createdAt || now,
|
|
112
108
|
updatedAt: now
|