@mintlify/cli 3.0.0

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/.eslintcache ADDED
@@ -0,0 +1 @@
1
+ [{"/Users/bshen/mintlify/mint/packages/mintlify-cli/src/index.ts":"1"},{"size":813,"mtime":1676618123558,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","suppressedMessages":"6","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"16pu3nx","/Users/bshen/mintlify/mint/packages/mintlify-cli/src/index.ts",[],["7","8"],{"ruleId":"9","severity":2,"message":"10","line":12,"column":11,"nodeType":"11","messageId":"12","endLine":12,"endColumn":13,"suppressions":"13"},{"ruleId":"9","severity":2,"message":"10","line":20,"column":11,"nodeType":"11","messageId":"12","endLine":20,"endColumn":13,"suppressions":"14"},"@typescript-eslint/no-empty-function","Unexpected empty arrow function.","ArrowFunctionExpression","unexpected",["15"],["16"],{"kind":"17","justification":"18"},{"kind":"17","justification":"18"},"directive",""]
package/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ bin/
package/.eslintrc.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "@mintlify/eslint-config-typescript"
3
+ }
@@ -0,0 +1,17 @@
1
+ # Running CLI Locally
2
+
3
+ Note - contributing 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.
4
+
5
+ Run `npm run local` to build and install the CLI locally.
6
+
7
+ You need to run the command after every change you want to test.
8
+
9
+ ## Updating Version of Mint Client
10
+
11
+ The CLI uses GitHub releases to download specific versions of the client code used in `mintlify dev`. Older CLI versions will continue using the client code they were bundled with. Users need to update to a newer version of the CLI to get the newest client code. CLI contributors bump the client version used by the CLI whenever there are major changes.
12
+
13
+ Here's how to publish new client changes to the CLI:
14
+
15
+ 1. Publish a new GitHub release. You can click the releases menu at the right of the repo page. Make the release title the same as the new release tag. Optionally, you can also use the description to keep track of what changed in that release.
16
+ 2. Set `TARGET_MINT_VERSION` in `src/constants.ts` to to the new release tag.
17
+ 3. Publish a new CLI version to npm.
package/README.md ADDED
@@ -0,0 +1,78 @@
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>
21
+
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)
23
+
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:
56
+
57
+ ```
58
+ mintlify dev --port 3333
59
+ ```
60
+
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):
70
+
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.
75
+
76
+ ### 🏃 Get Started
77
+
78
+ [Create an account](https://mintlify.com/start) to start using Mintlify for your documentation.
package/bin/index.js ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable @typescript-eslint/no-empty-function */
3
+ import yargs from "yargs";
4
+ import { hideBin } from "yargs/helpers";
5
+ import { dev, installDepsCommand } from "@mintlify/previewing";
6
+ yargs(hideBin(process.argv))
7
+ .command("dev", "Runs Mintlify locally (Must run in directory with mint.json)", () => { }, async (argv) => {
8
+ await dev(argv);
9
+ })
10
+ .command("install", "Install dependencies for local Mintlify", () => { }, installDepsCommand)
11
+ // Print the help menu when the user enters an invalid command.
12
+ .strictCommands()
13
+ .demandCommand(1, "Unknown command. See above for the list of supported commands.")
14
+ // Alias option flags --help = -h, --version = -v
15
+ .alias("h", "help")
16
+ .alias("v", "version")
17
+ .parse();
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,yDAAyD;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACzB,OAAO,CACN,KAAK,EACL,8DAA8D,EAC9D,GAAG,EAAE,GAAE,CAAC,EACR,KAAK,EAAE,IAAI,EAAE,EAAE;IACb,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC;AAClB,CAAC,CACF;KACA,OAAO,CACN,SAAS,EACT,yCAAyC,EACzC,GAAG,EAAE,GAAE,CAAC,EACR,kBAAkB,CACnB;IACD,+DAA+D;KAC9D,cAAc,EAAE;KAChB,aAAa,CACZ,CAAC,EACD,gEAAgE,CACjE;IAED,iDAAiD;KAChD,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC;KAClB,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC;KAErB,KAAK,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@mintlify/cli",
3
+ "version": "3.0.0",
4
+ "description": "The Mintlify CLI",
5
+ "engines": {
6
+ "node": ">=18.0.0"
7
+ },
8
+ "author": "Mintlify, Inc.",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/mintlify/mint",
12
+ "directory": "packages/mintlify-cli"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/mintlify/mint/issues"
16
+ },
17
+ "license": "Elastic-2.0",
18
+ "keywords": [
19
+ "mintlify",
20
+ "mint",
21
+ "cli"
22
+ ],
23
+ "type": "module",
24
+ "publishConfig": {
25
+ "access": "public",
26
+ "registry": "https://registry.npmjs.org/"
27
+ },
28
+ "exports": "./bin/index.js",
29
+ "bin": {
30
+ "mintlify": "bin/index.js"
31
+ },
32
+ "scripts": {
33
+ "prepare": "npm run build",
34
+ "build": "tsc",
35
+ "watch": "tsc --watch",
36
+ "lint": "eslint . --cache"
37
+ },
38
+ "dependencies": {
39
+ "@apidevtools/swagger-parser": "^10.1.0",
40
+ "@mintlify/previewing": "3.1.0",
41
+ "@mintlify/validation": "^0.1.9",
42
+ "@octokit/rest": "^19.0.5",
43
+ "axios": "^1.2.2",
44
+ "chalk": "^5.1.0",
45
+ "cheerio": "^0.22.0",
46
+ "chokidar": "^3.5.3",
47
+ "favicons": "^7.0.1",
48
+ "fs-extra": "^11.1.0",
49
+ "gray-matter": "^4.0.3",
50
+ "inquirer": "^9.1.0",
51
+ "is-absolute-url": "^4.0.1",
52
+ "is-internet-available": "^3.1.0",
53
+ "minimist-lite": "^2.2.1",
54
+ "node-html-markdown": "^1.3.0",
55
+ "open": "^8.4.0",
56
+ "openapi-types": "^12.0.2",
57
+ "ora": "^6.1.2",
58
+ "puppeteer": "^19.4.0",
59
+ "remark": "^14.0.2",
60
+ "remark-frontmatter": "^4.0.1",
61
+ "remark-gfm": "^3.0.1",
62
+ "remark-mdx": "^2.2.1",
63
+ "shelljs": "^0.8.5",
64
+ "unist-util-visit": "^4.1.1",
65
+ "yargs": "^17.6.0"
66
+ },
67
+ "devDependencies": {
68
+ "@mintlify/eslint-config": "1.0.3",
69
+ "@mintlify/eslint-config-typescript": "1.0.7",
70
+ "@mintlify/ts-config": "1.0.7",
71
+ "@tsconfig/recommended": "1.x",
72
+ "@types/cheerio": "^0.22.31",
73
+ "@types/fs-extra": "^9.0.13",
74
+ "@types/inquirer": "^9.0.1",
75
+ "@types/node": "^18.7.13",
76
+ "@types/shelljs": "^0.8.11",
77
+ "@types/yargs": "^17.0.13",
78
+ "@typescript-eslint/eslint-plugin": "5.x",
79
+ "@typescript-eslint/parser": "5.x",
80
+ "eslint": "8.x",
81
+ "eslint-config-prettier": "8.x",
82
+ "eslint-plugin-unused-imports": "2.x",
83
+ "prettier": "2.x",
84
+ "typescript": "^4.8.2"
85
+ }
86
+ }
package/src/index.ts ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable @typescript-eslint/no-empty-function */
3
+
4
+ import yargs from "yargs";
5
+ import { hideBin } from "yargs/helpers";
6
+ import { dev, installDepsCommand } from "@mintlify/previewing";
7
+
8
+ yargs(hideBin(process.argv))
9
+ .command(
10
+ "dev",
11
+ "Runs Mintlify locally (Must run in directory with mint.json)",
12
+ () => {},
13
+ async (argv) => {
14
+ await dev(argv);
15
+ }
16
+ )
17
+ .command(
18
+ "install",
19
+ "Install dependencies for local Mintlify",
20
+ () => {},
21
+ installDepsCommand
22
+ )
23
+ // Print the help menu when the user enters an invalid command.
24
+ .strictCommands()
25
+ .demandCommand(
26
+ 1,
27
+ "Unknown command. See above for the list of supported commands."
28
+ )
29
+
30
+ // Alias option flags --help = -h, --version = -v
31
+ .alias("h", "help")
32
+ .alias("v", "version")
33
+
34
+ .parse();
package/tsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ // "extends": "@mintlify/ts-config",
3
+ "compilerOptions": {
4
+ "module": "ES2020",
5
+ "moduleResolution": "node",
6
+ "target": "es2020",
7
+ "lib": ["es2020", "dom", "ES2021.String"],
8
+ "sourceMap": true,
9
+ "outDir": "bin",
10
+ "baseUrl": ".",
11
+ "paths": {
12
+ "*": ["node_modules/*", "src/types/*"]
13
+ },
14
+ "emitDecoratorMetadata": true,
15
+ "experimentalDecorators": true,
16
+ "esModuleInterop": true
17
+ },
18
+ "include": ["src/**/*"]
19
+ }