@mintlify/previewing 3.0.3 → 3.1.1
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/README.md +8 -69
- package/dist/constants.d.ts +9 -0
- package/dist/downloadImage.d.ts +4 -0
- package/dist/index.d.ts +3 -0
- package/dist/local-preview/helper-commands/installDepsCommand.d.ts +2 -0
- package/dist/local-preview/index.d.ts +3 -0
- package/dist/local-preview/listener/categorize.d.ts +8 -0
- package/dist/local-preview/listener/categorize.js +3 -2
- package/dist/local-preview/listener/categorize.js.map +1 -1
- package/dist/local-preview/listener/generate.d.ts +12 -0
- package/dist/local-preview/listener/index.d.ts +2 -0
- package/dist/local-preview/listener/update.d.ts +2 -0
- package/dist/local-preview/listener/utils/createPage.d.ts +11 -0
- package/dist/local-preview/listener/utils/getOpenApiContext.d.ts +21 -0
- package/dist/local-preview/listener/utils/mintConfigFile.d.ts +2 -0
- package/dist/local-preview/listener/utils/toTitleCase.d.ts +1 -0
- package/dist/local-preview/listener/utils/types.d.ts +2 -0
- package/dist/local-preview/listener/utils.d.ts +13 -0
- package/dist/local-preview/listener/utils.js +0 -15
- package/dist/local-preview/listener/utils.js.map +1 -1
- package/dist/util.d.ts +28 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,78 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="https://mintlify.com">
|
|
3
|
-
<img
|
|
4
|
-
src="https://res.cloudinary.com/mintlify/image/upload/v1665385627/logo-rounded_zuk7q1.svg"
|
|
5
|
-
alt="Mintlify Logo"
|
|
6
|
-
height="64"
|
|
7
|
-
/>
|
|
8
|
-
</a>
|
|
9
|
-
<br />
|
|
10
|
-
<p>
|
|
11
|
-
<h3>
|
|
12
|
-
<b>
|
|
13
|
-
Mintlify CLI
|
|
14
|
-
</b>
|
|
15
|
-
</h3>
|
|
16
|
-
</p>
|
|
17
|
-
<p>
|
|
18
|
-
The Mintlify CLI is the easiest way to build Mintlify apps from the command line.
|
|
19
|
-
</p>
|
|
20
|
-
<p>
|
|
1
|
+
# @mintlify/previewing
|
|
21
2
|
|
|
22
|
-
|
|
3
|
+
Preview Mintlify docs locally.
|
|
23
4
|
|
|
24
|
-
|
|
25
|
-
<p>
|
|
26
|
-
<sub>
|
|
27
|
-
Built with ❤︎ by
|
|
28
|
-
<a href="https://mintlify.com">
|
|
29
|
-
Mintlify
|
|
30
|
-
</a>
|
|
31
|
-
</sub>
|
|
32
|
-
</p>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
### 🚀 Installation
|
|
36
|
-
|
|
37
|
-
Download the Mintlify CLI using the following command
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
npm i -g mintlify
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### 👩💻 Development
|
|
44
|
-
|
|
45
|
-
Run the following command at the root of your Mintlify application to preview changes locally.
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
mintlify dev
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Note - `mintlify dev` requires `yarn` and it's recommended you install it as a global installation. If you don't have yarn installed already run `npm install --global yarn` in your terminal.
|
|
52
|
-
|
|
53
|
-
### Custom Ports
|
|
54
|
-
|
|
55
|
-
Mintlify uses port 3000 by default. You can use the `--port` flag to customize the port Mintlify runs on. For example, use this command to run in port 3333:
|
|
5
|
+
## 🚀 Installation
|
|
56
6
|
|
|
57
7
|
```
|
|
58
|
-
|
|
8
|
+
npm install @mintlify/previewing
|
|
59
9
|
```
|
|
60
10
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
Error: listen EADDRINUSE: address already in use :::3000
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
#### Troubleshooting
|
|
68
|
-
|
|
69
|
-
Steps you can take if the dev CLI is not working (After each step try to run `mintlify dev` again):
|
|
11
|
+
## Community
|
|
70
12
|
|
|
71
|
-
|
|
72
|
-
- Make sure you are using Node v18 or higher.
|
|
73
|
-
- Run `mintlify install` to re-install dependencies.
|
|
74
|
-
- Navigate to the `.mintlify` folder in your home directory and delete its contents.
|
|
13
|
+
Join our Discord community if you have questions or just want to chat:
|
|
75
14
|
|
|
76
|
-
|
|
15
|
+
[](https://discord.gg/ACREKdwjG5)
|
|
77
16
|
|
|
78
|
-
|
|
17
|
+
_Built with 💚 by the Mintlify community._
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const TARGET_MINT_VERSION = "v0.0.9";
|
|
2
|
+
export declare const INSTALL_PATH: string;
|
|
3
|
+
export declare const HOME_DIR: string;
|
|
4
|
+
export declare const DOT_MINTLIFY: string;
|
|
5
|
+
export declare const VERSION_PATH: string;
|
|
6
|
+
export declare const CLIENT_PATH: string;
|
|
7
|
+
export declare const MINT_PATH: string;
|
|
8
|
+
export declare const CMD_EXEC_PATH: string;
|
|
9
|
+
export declare const SUPPORTED_MEDIA_EXTENSIONS: string[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function isValidImageSrc(src: string): boolean;
|
|
2
|
+
export declare function removeMetadataFromImageSrc(src: string): string;
|
|
3
|
+
export declare function cleanImageSrc(src: string, origin: string): string;
|
|
4
|
+
export default function downloadImage(imageSrc: string, writePath: string, overwrite?: boolean): Promise<void>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PotentialFileCategory } from "./utils/types.js";
|
|
2
|
+
export declare const categorizeFiles: (contentDirectoryPath: string) => Promise<{
|
|
3
|
+
contentFilenames: string[];
|
|
4
|
+
staticFilenames: string[];
|
|
5
|
+
openApiFiles: OpenApiFile[];
|
|
6
|
+
snippets: string[];
|
|
7
|
+
}>;
|
|
8
|
+
export declare const getCategory: (filePath: string) => PotentialFileCategory;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// TODO - put in prebuild package
|
|
2
2
|
import path from "path";
|
|
3
|
-
import {
|
|
3
|
+
import { getFileList } from "@mintlify/prebuild";
|
|
4
|
+
import { getFileExtension, openApiCheck } from "./utils.js";
|
|
4
5
|
export const categorizeFiles = async (contentDirectoryPath) => {
|
|
5
|
-
const allFilesInCmdExecutionPath =
|
|
6
|
+
const allFilesInCmdExecutionPath = getFileList(contentDirectoryPath);
|
|
6
7
|
const contentFilenames = [];
|
|
7
8
|
const staticFilenames = [];
|
|
8
9
|
const promises = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categorize.js","sourceRoot":"","sources":["../../../src/local-preview/listener/categorize.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"categorize.js","sourceRoot":"","sources":["../../../src/local-preview/listener/categorize.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG5D,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,oBAA4B,EAAE,EAAE;IACpE,MAAM,0BAA0B,GAC9B,WAAW,CAAC,oBAAoB,CAAC,CAAC;IACpC,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,MAAM,eAAe,GAAa,EAAE,CAAC;IACrC,MAAM,QAAQ,GAAoB,EAAE,CAAC;IACrC,MAAM,YAAY,GAAkB,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,0BAA0B,CAAC,OAAO,CAAC,CAAC,QAAgB,EAAE,EAAE;QACtD,QAAQ,CAAC,IAAI,CACX,CAAC,KAAK,IAAI,EAAE;YACV,MAAM,SAAS,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAC7C,IAAI,SAAS,GAAG,KAAK,CAAC;YACtB,IAAI,SAAS,IAAI,CAAC,SAAS,KAAK,KAAK,IAAI,SAAS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,CAAC,0CAA0C,CAAC,CAAC;AAC9D,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type DecoratedMintNavigation = DecoratedMintNavigationEntry[];
|
|
2
|
+
type DecoratedMintNavigationEntry = {
|
|
3
|
+
group: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
pages: DecoratedMintNavigationEntryChild[];
|
|
6
|
+
};
|
|
7
|
+
type DecoratedMintNavigationEntryChild = DecoratedMintNavigationEntry | PageMetadata;
|
|
8
|
+
type PageMetadata = Record<PageMetadataKeys, string>;
|
|
9
|
+
declare const pageMetadataKeys: readonly ["title", "description", "sidebarTitle", "href", "api", "openapi", "contentType", "auth", "version", "mode", "hideFooterPagination", "authors", "lastUpdatedDate", "createdDate", "size"];
|
|
10
|
+
type PageMetadataKeys = typeof pageMetadataKeys[number];
|
|
11
|
+
export declare const generateNav: () => Promise<DecoratedMintNavigation>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const createPage: (pagePath: string, pageContent: string, contentDirectoryPath: string, openApiFiles: OpenApiFile[]) => Promise<{
|
|
2
|
+
pageMetadata: {
|
|
3
|
+
href: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
pageContent: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const slugToTitle: (slug: string) => string;
|
|
11
|
+
export default createPage;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const extractMethodAndEndpoint: (api: string) => {
|
|
2
|
+
method?: string;
|
|
3
|
+
endpoint: string;
|
|
4
|
+
filename?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const getOpenApiOperationMethodAndEndpoint: (openApi: any, openApiMetaField: string) => {
|
|
7
|
+
operation?: undefined;
|
|
8
|
+
method?: undefined;
|
|
9
|
+
endpoint?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
operation: any;
|
|
12
|
+
method: string;
|
|
13
|
+
endpoint: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const getOpenApiTitleAndDescription: (openApi: any, openApiMetaField: any) => {
|
|
16
|
+
title?: undefined;
|
|
17
|
+
description?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
title: any;
|
|
20
|
+
description: any;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toTitleCase(text: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const getFileExtension: (filename: string) => string;
|
|
2
|
+
export type OpenApiCheckResult = {
|
|
3
|
+
spec: any;
|
|
4
|
+
isOpenApi: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const openApiCheck: (path: string) => Promise<OpenApiCheckResult>;
|
|
7
|
+
export declare const filterOutNullInGroup: (group: MintNavigation) => {
|
|
8
|
+
pages: MintNavigationEntry[];
|
|
9
|
+
group: string;
|
|
10
|
+
version?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const isFileSizeValid: (path: string, maxFileSizeInMb: number) => Promise<boolean>;
|
|
13
|
+
export declare function isError(obj: unknown): boolean;
|
|
@@ -42,21 +42,6 @@ const filterOutNullInPages = (pages) => {
|
|
|
42
42
|
});
|
|
43
43
|
return newPages;
|
|
44
44
|
};
|
|
45
|
-
export const getFileList = async (dirName, og = dirName) => {
|
|
46
|
-
let files = [];
|
|
47
|
-
const items = await readdir(dirName, { withFileTypes: true });
|
|
48
|
-
for (const item of items) {
|
|
49
|
-
if (item.isDirectory()) {
|
|
50
|
-
files = [...files, ...(await getFileList(`${dirName}/${item.name}`, og))];
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
const path = `${dirName}/${item.name}`;
|
|
54
|
-
const name = path.replace(og, "");
|
|
55
|
-
files.push(name);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return files;
|
|
59
|
-
};
|
|
60
45
|
export const isFileSizeValid = async (path, maxFileSizeInMb) => {
|
|
61
46
|
const maxFileSizeBytes = maxFileSizeInMb * 1000000;
|
|
62
47
|
const stats = await stat(path);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/local-preview/listener/utils.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC;AAE3C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;AAEpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAgB,EAAE,EAAE;IACnD,OAAO,CACL,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;QAClE,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC;AAOF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,IAAY,EACiB,EAAE;IAC/B,IAAI,IAAI,CAAC;IACT,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI;QACF,IAAI,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1C,SAAS,GAAG,IAAI,CAAC;KAClB;IAAC,MAAM;QACN,oBAAoB;KACrB;IACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC5D,MAAM,QAAQ,GAAG,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG;QACf,GAAG,KAAK;QACR,KAAK,EAAE,QAAQ;KAChB,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,KAAqC,EAAE,EAAE;IACrE,MAAM,QAAQ,GAA0B,EAAE,CAA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AAC"}
|
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Ora as OraType } from "ora";
|
|
2
|
+
export declare const MintConfig: (name: string, color: string, ctaName: string, ctaUrl: string, filename: string) => {
|
|
3
|
+
name: string;
|
|
4
|
+
logo: string;
|
|
5
|
+
favicon: string;
|
|
6
|
+
colors: {
|
|
7
|
+
primary: string;
|
|
8
|
+
};
|
|
9
|
+
topbarLinks: any[];
|
|
10
|
+
topbarCtaButton: {
|
|
11
|
+
name: string;
|
|
12
|
+
url: string;
|
|
13
|
+
};
|
|
14
|
+
anchors: any[];
|
|
15
|
+
navigation: {
|
|
16
|
+
group: string;
|
|
17
|
+
pages: string[];
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
export declare const Page: (title: string, description?: string, markdown?: string) => string;
|
|
21
|
+
export declare function getOrigin(url: string): string;
|
|
22
|
+
export declare function objToReadableString(objs: MintNavigationEntry[]): string;
|
|
23
|
+
export declare const toFilename: (title: string) => string;
|
|
24
|
+
export declare const addMdx: (fileName: string) => string;
|
|
25
|
+
export declare const buildLogger: (startText?: string) => OraType;
|
|
26
|
+
export declare const getFileExtension: (filename: string) => string;
|
|
27
|
+
export declare const fileBelongsInPagesFolder: (filename: string) => boolean;
|
|
28
|
+
export declare const ensureYarn: (logger: OraType) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/previewing",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Preview Mintlify docs locally",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
41
|
+
"@mintlify/prebuild": "^1.0.0",
|
|
41
42
|
"@mintlify/validation": "^0.1.9",
|
|
42
43
|
"@octokit/rest": "^19.0.5",
|
|
43
44
|
"axios": "^1.2.2",
|