pulumi-package-docs 0.4.0 → 0.5.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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/bin/cli.js +5 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -16,6 +16,7 @@ pulumi-package-docs [options]
16
16
  -d, --dir <path> Pulumi project directory to inspect (default: current directory)
17
17
  -p, --port <port> Port to serve on (default: 3000)
18
18
  --host Expose the server on your network
19
+ --open Open the docs in your default browser once ready
19
20
  -h, --help Show this help message
20
21
  ```
21
22
 
package/bin/cli.js CHANGED
@@ -9,7 +9,7 @@ const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..')
9
9
  const require = createRequire(import.meta.url)
10
10
 
11
11
  function parseArgs(argv) {
12
- const options = { dir: process.cwd(), port: '3000', host: false }
12
+ const options = { dir: process.cwd(), port: '3000', host: false, open: false }
13
13
  for (let i = 0; i < argv.length; i++) {
14
14
  const arg = argv[i]
15
15
  if (arg === '--dir' || arg === '-d') {
@@ -18,6 +18,8 @@ function parseArgs(argv) {
18
18
  options.port = argv[++i]
19
19
  } else if (arg === '--host') {
20
20
  options.host = true
21
+ } else if (arg === '--open') {
22
+ options.open = true
21
23
  } else if (arg === '--help' || arg === '-h') {
22
24
  options.help = true
23
25
  }
@@ -35,6 +37,7 @@ Options:
35
37
  -d, --dir <path> Pulumi project directory to inspect (default: current directory)
36
38
  -p, --port <port> Port to serve on (default: 3000)
37
39
  --host Expose the server on your network
40
+ --open Open the docs in your default browser once ready
38
41
  -h, --help Show this help message
39
42
  `)
40
43
  }
@@ -58,6 +61,7 @@ const viteArgs = [
58
61
  options.port,
59
62
  ]
60
63
  if (options.host) viteArgs.push('--host')
64
+ if (options.open) viteArgs.push('--open')
61
65
 
62
66
  if (!hasProductionBuild) {
63
67
  console.log(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pulumi-package-docs",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Local documentation viewer for the parameterized/local Pulumi providers used by a Pulumi project.",
5
5
  "type": "module",
6
6
  "license": "MIT",