-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Separate publish docs from overview
- Loading branch information
1 parent
c2c6697
commit f87d53a
Showing
4 changed files
with
67 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,10 @@ | |
{ | ||
"label": "Build", | ||
"to": "build" | ||
}, | ||
{ | ||
"label": "Publish", | ||
"to": "publish" | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
id: publish | ||
title: Publish | ||
--- | ||
|
||
## Usage | ||
|
||
You have two options for using TanStack Config to publish: | ||
|
||
- [CLI Usage](#cli-usage) | ||
- [Programmatic Usage](#programmatic-usage) | ||
|
||
### CLI Usage | ||
|
||
To run the publish script for your package, run the following command: | ||
|
||
```bash | ||
pnpm run tanstack-config publish | ||
``` | ||
|
||
### Programmatic Usage | ||
|
||
To use the TanStack Config programmatically, you can import the `publish` function: | ||
|
||
```ts | ||
import { publish } from '@tanstack/config'; | ||
|
||
publish({ | ||
branchConfigs: configOpts.branchConfigs, | ||
packages: configOpts.packages, | ||
rootDir: configOpts.rootDir, | ||
branch: process.env.BRANCH, | ||
tag: process.env.TAG, | ||
ghToken: process.env.GH_TOKEN, | ||
}) | ||
.then(() => { | ||
console.log('Successfully published packages!'); | ||
}) | ||
.catch(console.error) | ||
``` | ||
|
||
> The programmatic usage is only available for ESM packages. To support this, you have to have: | ||
> | ||
> ```json | ||
> { | ||
> "type": "module" | ||
> } | ||
> ``` | ||
> | ||
> in your `package.json` file and use `import` instead of `require`. |