@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 CHANGED
@@ -1,78 +1,17 @@
1
- <div align="center">
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
- [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen?logo=github)](/) [![Website](https://img.shields.io/website?url=https%3A%2F%2Fmintlify.com&logo=mintlify)](https://mintlify.com) [![Unit Tests](https://github.com/mintlify/mint/actions/workflows/unit-tests.yaml/badge.svg)](https://github.com/mintlify/mint/actions/workflows/unit-tests.yaml) [![Tweet](https://img.shields.io/twitter/url?url=https%3A%2F%2Fmintlify.com%2F)](https://twitter.com/intent/tweet?url=&text=Check%20out%20%40mintlify) [![Chat on Discord](https://img.shields.io/badge/chat-Discord-7289DA?logo=discord)](https://discord.gg/MPNgtSZkgK) [![Discuss on GitHub](https://img.shields.io/badge/discussions-GitHub-333333?logo=github)](https://github.com/mintlify/mint/discussions)
3
+ Preview Mintlify docs locally.
23
4
 
24
- </p>
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
- mintlify dev --port 3333
8
+ npm install @mintlify/previewing
59
9
  ```
60
10
 
61
- You will see an error like this if you try to run Mintlify in a port that's already taken:
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
- - Make sure you are running in a folder with a `mint.json` file.
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
- ### 🏃 Get Started
15
+ [![](https://dcbadge.vercel.app/api/server/ACREKdwjG5)](https://discord.gg/ACREKdwjG5)
77
16
 
78
- [Create an account](https://mintlify.com/start) to start using Mintlify for your documentation.
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>;
@@ -0,0 +1,3 @@
1
+ import dev from "./local-preview/index.js";
2
+ import installDepsCommand from "./local-preview/helper-commands/installDepsCommand.js";
3
+ export { dev, installDepsCommand };
@@ -0,0 +1,2 @@
1
+ declare const installDeps: () => Promise<void>;
2
+ export default installDeps;
@@ -0,0 +1,3 @@
1
+ import { ArgumentsCamelCase } from "yargs";
2
+ declare const dev: (argv: ArgumentsCamelCase) => Promise<void>;
3
+ export default dev;
@@ -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 { getFileExtension, openApiCheck, getFileList } from "./utils.js";
3
+ import { getFileList } from "@mintlify/prebuild";
4
+ import { getFileExtension, openApiCheck } from "./utils.js";
4
5
  export const categorizeFiles = async (contentDirectoryPath) => {
5
- const allFilesInCmdExecutionPath = await getFileList(contentDirectoryPath);
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,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzE,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,oBAA4B,EAAE,EAAE;IACpE,MAAM,0BAA0B,GAAa,MAAM,WAAW,CAC5D,oBAAoB,CACrB,CAAC;IACF,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,MAAM,eAAe,GAAa,EAAE,CAAC;IACrC,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AAM,IAAI,KAAK,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,2 @@
1
+ declare const listener: () => void;
2
+ export default listener;
@@ -0,0 +1,2 @@
1
+ export declare const updateGeneratedNav: () => Promise<void>;
2
+ export declare const updateOpenApiFiles: () => Promise<void>;
@@ -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,2 @@
1
+ export declare const getConfigPath: (contentDirectoryPath: string) => Promise<string | null>;
2
+ export declare const getConfigObj: (contentDirectoryPath: string) => Promise<any>;
@@ -0,0 +1 @@
1
+ export declare function toTitleCase(text: string): string;
@@ -0,0 +1,2 @@
1
+ export type PotentialFileCategory = "page" | "snippet" | "mintConfig" | "potentialYamlOpenApiSpec" | "potentialJsonOpenApiSpec" | "staticFile";
2
+ export type FileCategory = "page" | "snippet" | "mintConfig" | "openApi" | "staticFile";
@@ -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,Q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IACrE,MAAM,QAAQ,GAA0B,EAAE,CAAC;IAC3C,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,OAAO;SACR;QACD,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;YAChC,MAAM,KAAK,GAAG,IAAsB,CAAC;YACrC,MAAM,QAAQ,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAC7C,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACzB;aAAM;YACL,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACrB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAClC,IAAY,EACZ,eAAuB,EACL,EAAE;IACpB,MAAM,gBAAgB,GAAG,eAAe,GAAG,OAAO,CAAC;IACnD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC,IAAI,IAAI,gBAAgB,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,GAAY;IAClC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,gBAAgB,CAAC;AAClE,CAAC"}
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.0.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",