Skip to content

Commit

Permalink
📕 docs(none): add new CLI commands (#2484)
Browse files Browse the repository at this point in the history
## Type of change

**PATCH: backwards compatible change**
  • Loading branch information
kellymears committed Oct 24, 2023
1 parent af83b4f commit 94508c5
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 31 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion sources/@repo/docs/content/extensions/bud-stylelint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ yarn add @roots/bud-stylelint --dev

<Methods />

## Example bud config
## Example bud.js config

<Usage />

Expand Down
10 changes: 10 additions & 0 deletions sources/@repo/docs/content/learn/cli/config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: bud config
description: The `bud config` command
sidebar_label: bud config
---

import CodeBlock from '@theme/CodeBlock'
import Output from '!!raw-loader!@site/generated/cli/config.help.md'

<CodeBlock title="$ bud config --help">{Output}</CodeBlock>
14 changes: 14 additions & 0 deletions sources/@repo/docs/content/learn/cli/env.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: bud env
description: The `bud env` command
sidebar_label: bud env
---

import CodeBlock from '@theme/CodeBlock'
import Output from '!!raw-loader!@site/generated/cli/env.help.md'

The `bud env` command is used to view your project's environment variables, as processed by bud.js.

Useful for debugging and verifying that certain environment variables are available to your project.

<CodeBlock title="$ bud env --help">{Output}</CodeBlock>
17 changes: 3 additions & 14 deletions sources/@repo/docs/content/learn/cli/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,10 @@ sidebar_label: CLI
import CodeBlock from '@theme/CodeBlock'
import Help from '!!raw-loader!@site/generated/cli/help.md'

The `bud` command is your primary means of interfacing with the **bud.js** framework.
The `bud` command is designed to be your primary means of interfacing with **bud.js**.

To explore what all is available to you, use `bud help`. You can also learn about any subcommand using the `--help` flag.
To explore what all is available to you, run `bud help`. You can also learn about any subcommand using the `--help` flag.

Extensions may register additional commands which are not reflected here.
Extensions may register additional commands which are not reflected in this generated .

<CodeBlock title="$ bud help">{Help}</CodeBlock>

## TypeScript binary

When using a configuring authored in TypeScript, you will need to either:

- use the `ts-bud` command in place of `bud`
- use [`ts-node`](https://www.npmjs.com/package/ts-node) to execute the `bud` CLI bin

## Bun binary

If you use the [bun runtime](https://bun.sh/) you can execute `bud` with it and have it used in place of `node` globally by using the `bund` command
4 changes: 4 additions & 0 deletions sources/@repo/docs/content/learn/cli/repl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ sidebar_label: bud repl
import CodeBlock from '@theme/CodeBlock'
import Output from '!!raw-loader!@site/generated/cli/repl.help.md'

The `bud repl` command starts a REPL session with bud.js bootstrapped and your configuration loaded.

This is useful for debugging your setup, or for exploring the bud.js API.

<CodeBlock title="$ bud repl --help">{Output}</CodeBlock>
4 changes: 2 additions & 2 deletions sources/@repo/docs/content/learn/config/files/bud.config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ entry: ['app', ['app.js', 'app.css']]
</TabItem>
</Tabs>

## Importing bud directly
## Importing bud.js directly

As mentioned above, you can also elect to import bud directly and use it in your configuration.
As mentioned above, you can also elect to import bud.js directly and use it in your configuration.

```ts title=bud.config.ts
import {bud} from '@roots/bud'
Expand Down
2 changes: 1 addition & 1 deletion sources/@repo/docs/content/learn/config/files/tsconfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ There are base configs provided by **@roots/bud** for you to extend:

### bud.useCompilerOptions

If you enable `bud.useCompilerOptions` in your `tsconfig.json` file then **@roots/bud** will apply certain options from `compilerOptions` to the bud config.
If you enable `bud.useCompilerOptions` in your `tsconfig.json` file then **@roots/bud** will apply certain options from `compilerOptions` to the bud.js config.

- `compilerOptions.baseUrl` will set the `@src` path.
- `compilerOptions.outDir` will set the `@dist` path.
Expand Down
2 changes: 1 addition & 1 deletion sources/@repo/docs/content/reference/bud.mode/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Specify if a build is being run in a `production` or `development` context.

**bud.mode** will always be either `production` or `development`.

When running bud [using the cli](/learn/cli/):
When running bud.js [using the cli](/learn/cli/):

- [bud build production](/learn/cli/build) will always run in `production`.
- [bud build development](/learn/cli/build) will always run in `development`.
2 changes: 2 additions & 0 deletions sources/@repo/docs/sidebars/learn.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ module.exports = {
type: `category`,
},
`cli/clean`,
`cli/config`,
`cli/doctor`,
`cli/env`,
`cli/repl`,
`cli/upgrade`,
],
Expand Down
24 changes: 13 additions & 11 deletions sources/@repo/markdown-kit/cli-examples/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ import stripAnsi from 'strip-ansi'

const main = async () => {
await Promise.all([
generateMarkdown([`--help`]),
generateMarkdown([`build`, `--help`]),
generateMarkdown([`build`, `production`, `--help`]),
generateMarkdown([`build`, `development`, `--help`]),
generateMarkdown([`clean`, `--help`]),
generateMarkdown([`dev`, `--help`]),
generateMarkdown([`doctor`, `--help`]),
generateMarkdown([`repl`, `--help`]),
generateMarkdown([`upgrade`, `--help`]),
generateMarkdown([`view`, `--help`]),
])
[`--help`],
[`build`, `--help`],
[`build`, `production`, `--help`],
[`build`, `development`, `--help`],
[`clean`, `--help`],
[`config`, `--help`],
[`dev`, `--help`],
[`doctor`, `--help`],
[`env`, `--help`],
[`repl`, `--help`],
[`upgrade`, `--help`],
[`view`, `--help`],
].map(generateMarkdown))
}

/**
Expand Down
3 changes: 2 additions & 1 deletion sources/@roots/browserslist-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"devDependencies": {
"@roots/bud-support": "workspace:*",
"@skypack/package-check": "0.2.2",
"browserslist": "4.22.1"
"browserslist": "4.22.1",
"caniuse-lite": "latest"
},
"volta": {
"extends": "../../../package.json"
Expand Down
1 change: 1 addition & 0 deletions sources/@roots/bud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
"@roots/bud-minify": "workspace:*",
"@roots/bud-server": "workspace:*",
"@roots/bud-support": "workspace:*",
"caniuse-lite": "latest",
"tslib": "2.6.2"
},
"volta": {
Expand Down
2 changes: 2 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8378,6 +8378,7 @@ __metadata:
"@roots/bud-support": "workspace:*"
"@skypack/package-check": 0.2.2
browserslist: 4.22.1
caniuse-lite: latest
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -9124,6 +9125,7 @@ __metadata:
"@roots/bud-support": "workspace:*"
"@skypack/package-check": 0.2.2
"@types/node": 18.18.4
caniuse-lite: latest
tslib: 2.6.2
bin:
bud: ./bin/bud.mjs
Expand Down

0 comments on commit 94508c5

Please sign in to comment.