Skip to content

Commit

Permalink
chore: update docs with bun example
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Apr 1, 2024
1 parent ab842e4 commit cd280a3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 29 deletions.
10 changes: 9 additions & 1 deletion docs/guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ yarn add @kubb/cli

## Usage

```sh
::: code-group

```shell [bun <img src="/feature/bun.svg"/>]
kubb --bun --config kubb.config.js
bkubb --config kubb.config.js
```
```sh [node]
kubb --config kubb.config.js
```
:::

```mdx
kubb/2.0.0
Expand Down Expand Up @@ -73,6 +80,7 @@ Options:
-l, --log-level <type> Info, silent or debug
-w, --watch Watch mode based on the input file
-h, --help Display this message
-b, --bun Run Kubb with Bun
```

Path of the input file(overrides the one in `kubb.config.js`)
Expand Down
10 changes: 9 additions & 1 deletion docs/plugins/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ yarn add @kubb/cli

## Usage

```sh
::: code-group

```shell [bun <img src="/feature/bun.svg"/>]
kubb --bun --config kubb.config.js
bkubb --config kubb.config.js
```
```sh [node]
kubb --config kubb.config.js
```
:::

```mdx
kubb/1.2.1
Expand Down Expand Up @@ -73,6 +80,7 @@ Options:
-l, --log-level <type> Info, silent or debug
-w, --watch Watch mode based on the input file
-h, --help Display this message
-b, --bun Run Kubb with Bun
```

Path of the input file(overrides the one in `kubb.config.js`)
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build": "tsup",
"clean": "npx rimraf ./dist",
"generate": "kubb generate",
"generate:bun": "bun ./node_modules/@kubb/cli/bin/kubb.js generate --config .kubbrc.js",
"generate:bun": "kubb generate --bun",
"generate:js": "kubb generate --config .kubbrc.js",
"generate:json": "kubb generate --config kubb.json",
"generate:ts": "kubb generate --config configs/kubb.config.ts",
Expand Down
15 changes: 0 additions & 15 deletions packages/cli/bin/bkubb.cjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
#!/usr/bin/env bun
try {
const cachedSourceMaps = new Map()

// @ts-ignore
if (!process.isBun) {
require('source-map-support').install({
retrieveSourceMap(source) {
if (cachedSourceMaps.has(source)) {
return cachedSourceMaps.get(source)
}
return null
},
})
}
} catch (err) {}

import('../dist/index.js').then(({ run }) => {
process.title = 'Kubb'
Expand Down
19 changes: 8 additions & 11 deletions packages/cli/bin/kubb.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@
try {
const cachedSourceMaps = new Map()

// @ts-ignore
if (!process.isBun) {
require('source-map-support').install({
retrieveSourceMap(source) {
if (cachedSourceMaps.has(source)) {
return cachedSourceMaps.get(source)
}
return null
},
})
}
require('source-map-support').install({
retrieveSourceMap(source) {
if (cachedSourceMaps.has(source)) {
return cachedSourceMaps.get(source)
}
return null
},
})
} catch (err) {}

import('../dist/index.js').then(({ run }) => {
Expand Down

0 comments on commit cd280a3

Please sign in to comment.