@mintlify/cli 3.0.0 → 3.0.2
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/CONTRIBUTING.md +5 -3
- package/README.md +6 -73
- package/bin/index.js +2 -1
- package/bin/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +28 -25
package/CONTRIBUTING.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# Running CLI Locally
|
|
2
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
|
|
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 -g yarn` in your terminal.
|
|
4
4
|
|
|
5
|
-
Run `
|
|
5
|
+
Run `yarn` or `yarn install` to install dependencies. Then, run `npm link` once to link to your local version of the CLI in the npm global namespace (`npm list -g`).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Build the CLI using `yarn build` or `yarn watch` to see your local changes reflected. Keep `yarn watch` running in a terminal for changes to be quickly and continuously reflected while developing.
|
|
8
|
+
|
|
9
|
+
To uninstall locally, run `npm uninstall @mintlify/cli -g`.
|
|
8
10
|
|
|
9
11
|
## Updating Version of Mint Client
|
|
10
12
|
|
package/README.md
CHANGED
|
@@ -1,78 +1,11 @@
|
|
|
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/cli
|
|
21
2
|
|
|
22
|
-
|
|
3
|
+
The Mintlify CLI. See [mintlify](../mintlify/README.md) for more documentation.
|
|
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>
|
|
5
|
+
## Community
|
|
34
6
|
|
|
35
|
-
|
|
7
|
+
Join our Discord community if you have questions or just want to chat:
|
|
36
8
|
|
|
37
|
-
|
|
9
|
+
[](https://discord.gg/ACREKdwjG5)
|
|
38
10
|
|
|
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.
|
|
11
|
+
_Built with 💚 by the Mintlify community._
|
package/bin/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import yargs from "yargs";
|
|
4
4
|
import { hideBin } from "yargs/helpers";
|
|
5
5
|
import { dev, installDepsCommand } from "@mintlify/previewing";
|
|
6
|
-
yargs(hideBin(process.argv))
|
|
6
|
+
export const cli = () => yargs(hideBin(process.argv))
|
|
7
7
|
.command("dev", "Runs Mintlify locally (Must run in directory with mint.json)", () => { }, async (argv) => {
|
|
8
8
|
await dev(argv);
|
|
9
9
|
})
|
|
@@ -15,4 +15,5 @@ yargs(hideBin(process.argv))
|
|
|
15
15
|
.alias("h", "help")
|
|
16
16
|
.alias("v", "version")
|
|
17
17
|
.parse();
|
|
18
|
+
cli();
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
package/bin/index.js.map
CHANGED
|
@@ -1 +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"}
|
|
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,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,EAAE,CACtB,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;AAEb,GAAG,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -5,30 +5,33 @@ import yargs from "yargs";
|
|
|
5
5
|
import { hideBin } from "yargs/helpers";
|
|
6
6
|
import { dev, installDepsCommand } from "@mintlify/previewing";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
8
|
+
export const cli = () =>
|
|
9
|
+
yargs(hideBin(process.argv))
|
|
10
|
+
.command(
|
|
11
|
+
"dev",
|
|
12
|
+
"Runs Mintlify locally (Must run in directory with mint.json)",
|
|
13
|
+
() => {},
|
|
14
|
+
async (argv) => {
|
|
15
|
+
await dev(argv);
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
.command(
|
|
19
|
+
"install",
|
|
20
|
+
"Install dependencies for local Mintlify",
|
|
21
|
+
() => {},
|
|
22
|
+
installDepsCommand
|
|
23
|
+
)
|
|
24
|
+
// Print the help menu when the user enters an invalid command.
|
|
25
|
+
.strictCommands()
|
|
26
|
+
.demandCommand(
|
|
27
|
+
1,
|
|
28
|
+
"Unknown command. See above for the list of supported commands."
|
|
29
|
+
)
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// Alias option flags --help = -h, --version = -v
|
|
32
|
+
.alias("h", "help")
|
|
33
|
+
.alias("v", "version")
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
.parse();
|
|
36
|
+
|
|
37
|
+
cli();
|