@mintlify/prebuild 1.0.550 → 1.0.552

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.
@@ -6,7 +6,7 @@ export const preparseMdx = async (fileContent, contentDirectoryPath, filePath, s
6
6
  }
7
7
  catch (error) {
8
8
  if (!suppressErrLog) {
9
- console.error(formatError(error, filePath, contentDirectoryPath));
9
+ console.log(formatError(error, filePath, contentDirectoryPath));
10
10
  }
11
11
  return `🚧 A parsing error occured. Please contact the owner of this website.`;
12
12
  }
@@ -1,9 +1,10 @@
1
+ import chalk from 'chalk';
1
2
  import { getLocationErrString } from './getLocationErrString.js';
2
3
  export const formatError = (error, filePath, contentDirectoryPath) => {
3
4
  if (typeof error !== 'object' || error == null) {
4
- return `\n ⚠️ Parsing error: ${filePath} - ${error}`;
5
+ return `\n${chalk.red.bold('parsing error')} ${filePath} - ${error}`;
5
6
  }
6
7
  const location = getLocationErrString(filePath, contentDirectoryPath, error);
7
8
  const errorString = 'reason' in error && error.reason != null ? error.reason : error;
8
- return `\n ⚠️ Parsing error: ${location} - ${errorString}`;
9
+ return `\n${chalk.red.bold('parsing error')} ${location} - ${errorString}`;
9
10
  };
package/dist/generate.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { slugToTitle, optionallyAddLeadingSlash } from '@mintlify/common';
2
2
  import { divisions, } from '@mintlify/validation';
3
+ import chalk from 'chalk';
3
4
  const handleUnknownPage = (page, type) => {
4
- console.log(`⚠️ "${page}" is defined in the ${type}.json navigation but the file does not exist.`);
5
+ console.log(`${chalk.yellow.bold('warning')} - "${page}" is referenced in the ${type}.json navigation but the file does not exist.`);
5
6
  return {
6
7
  title: slugToTitle(page),
7
8
  href: optionallyAddLeadingSlash(page),
@@ -9,7 +9,7 @@ export const prebuild = async (contentDirectoryPath, { localSchema } = {}) => {
9
9
  const docsConfigPath = await getConfigPath(contentDirectoryPath, 'docs');
10
10
  const mintConfigPath = await getConfigPath(contentDirectoryPath, 'mint');
11
11
  if (mintConfigPath == null && docsConfigPath == null) {
12
- throw Error('Must be run in a directory where a mint.json or docs.json file exists.');
12
+ throw Error('must be run in a directory where a docs.json file exists.');
13
13
  }
14
14
  const { contentFilenames, staticFilenames, openApiFiles, asyncApiFiles, snippets, snippetsV2 } = await categorizeFilePaths(contentDirectoryPath);
15
15
  await update({
@@ -2,16 +2,17 @@ import { getConfigPath } from '../../../utils.js';
2
2
  import { DocsConfigUpdater } from '../ConfigUpdater.js';
3
3
  import { generateAsyncApiDivisions } from './generateAsyncApiDivisions.js';
4
4
  import { generateOpenApiDivisions } from './generateOpenApiDivisions.js';
5
+ const NOT_CORRECT_PATH_ERROR = 'must be run in a directory where a docs.json file exists.';
5
6
  export async function updateDocsConfigFile(contentDirectoryPath, openApiFiles, asyncApiFiles, docsConfig, localSchema) {
6
7
  const configPath = await getConfigPath(contentDirectoryPath, 'docs');
7
8
  if (configPath == null && docsConfig == null) {
8
- throw Error('Must be run in a directory where a docs.json file exists.');
9
+ throw Error(NOT_CORRECT_PATH_ERROR);
9
10
  }
10
11
  if (docsConfig == null && configPath) {
11
12
  docsConfig = await DocsConfigUpdater.getConfig(configPath);
12
13
  }
13
14
  if (docsConfig == null) {
14
- throw Error('Must be run in a directory where a docs.json file exists.');
15
+ throw Error(NOT_CORRECT_PATH_ERROR);
15
16
  }
16
17
  const { newDocsConfig: docsConfigWithOpenApiPages, pagesAcc: pagesAccWithOpenApiPages, openApiFiles: newOpenApiFiles, } = await generateOpenApiDivisions(docsConfig, openApiFiles, undefined, localSchema);
17
18
  const { newDocsConfig, pagesAcc: pagesAccWithAsyncApiPages, asyncApiFiles: newAsyncApiFiles, } = await generateAsyncApiDivisions(docsConfigWithOpenApiPages, asyncApiFiles, undefined, localSchema);