Skip to content

Commit

Permalink
chore: doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Dec 9, 2024
1 parent 2fee6e6 commit 48d20a1
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 165 deletions.
29 changes: 11 additions & 18 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,32 @@
// import fs from 'node:fs'
import { defineConfig } from 'vitepress'
// import { config } from '../../src/config'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'tlsx Docs',
description: 'A better developer environment.',
title: 'bunfig',
description: 'A smart config leader for Bun projects.',
cleanUrls: true,

themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Examples', link: '/markdown-examples' },
{ text: 'Docs', link: '/intro' },
{ text: 'Changelog', link: 'https://github.com/stacksjs/bunfig/releases' },
],

sidebar: [
{
text: 'Examples',
text: 'Get Started',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' },
{ text: 'Introduction', link: '/intro' },
{ text: 'Install', link: '/install' },
],
},
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/stacksjs/stacks' },
{ icon: 'github', link: 'https://github.com/stacksjs/bunfig' },
{ icon: 'bluesky', link: 'https://bsky.app/profile/chrisbreuer.dev' },
{ icon: 'twitter', link: 'https://twitter.com/stacksjs' },
],
},
// vite: {
// server: {
// https: {
// cert: fs.readFileSync(config.certPath),
// key: fs.readFileSync(config.keyPath),
// },
// },
// },
})
49 changes: 0 additions & 49 deletions docs/api-examples.md

This file was deleted.

31 changes: 18 additions & 13 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: "tlsx"
text: "HTTPS for your dev environment"
tagline: Automatically ensure your local development environment uses HTTPS
text: "HTTPS for localhost"
tagline: "Certificates for your local machine in a zero-config & zero-setup way."
actions:
- theme: brand
text: Markdown Examples
link: /markdown-examples
text: Documentation
link: /intro
- theme: alt
text: API Examples
link: /api-examples
text: View on GitHub
link: https://github.com/stacksjs/tlsx

features:
- title: Feature A
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature B
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature C
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: SSL Support
icon: 🛡️
details: HTTPS by default
- title: Auto-Renew
icon: 🔄
details: Automatically renews expired certificates
- title: Zero-Config
icon: 🚀
details: Yet, highly configurable
- title: Library or CLI
icon: 💻
details: Use as a library or as a CLI
---
75 changes: 75 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
## Install

```bash
bun install -d @stacksjs/tlsx

# or, invoke immediately
bunx @stacksjs/tlsx
npx @stacksjs/tlsx
```

Please note, we are looking to publish this package to npm under the name `tlsx`. _Hoping npm will release the name for us._

<!-- _Alternatively, you can install:_
```bash
brew install tlsx # wip
pkgx install tlsx # wip
``` -->

## Usage

There are two ways of using this reverse proxy: _as a library or as a CLI._

### Library

Given the npm package is installed:

```ts
import type { AddCertOptions, CAOptions, CertificateOptions, TlsConfig, TlsOptions } from '@stacksjs/tlsx'
import { addCertToSystemTrustStoreAndSaveCerts, config, forge, generateCert, pki, storeCertificate, tls } from '@stacksjs/tlsx'

// ...
```

### CLI

```bash
# more docs incoming
tlsx --help
tlsx version
```

## Configuration

The Reverse Proxy can be configured using a `tls.config.ts` _(or `tls.config.js`)_ file and it will be automatically loaded when running the `tlsx` command.

```ts
// tlsx.config.{ts,js}
import type { TlsConfig } from '@stacksjs/tlsx'

export default {
domain: 'stacks.localhost',
hostCertCN: 'stacks.localhost',
caCertPath: path.join(os.homedir(), '.stacks', 'ssl', `tlsx.localhost.ca.crt`),
certPath: path.join(os.homedir(), '.stacks', 'ssl', `tlsx.localhost.crt`),
keyPath: path.join(os.homedir(), '.stacks', 'ssl', `tlsx.localhost.crt.key`),
altNameIPs: ['127.0.0.1'],
altNameURIs: ['localhost'],
organizationName: 'stacksjs.org',
countryName: 'US',
stateName: 'California',
localityName: 'Playa Vista',
commonName: 'stacks.localhost',
validityDays: 180,
verbose: false,
} satisfies TlsConfig
```

_Then run:_

```bash
tlsx
```

To learn more, head over to the [documentation](https://tlsx.sh/).
51 changes: 51 additions & 0 deletions docs/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Introduction

`tlsx` is a

## Features

- SSL Support _(HTTPS by default)_
- Automatically Renews Expired Certificates
- Configurable

## Changelog

Please see our [releases](https://github.com/stacksjs/tlsx/releases) page for more information on what has changed recently.

## Contributing

Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.

## Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)

For casual chit-chat with others using this package:

[Join the Stacks Discord Server](https://discord.gg/stacksjs)

## Postcardware

Two things are true: Stacks OSS will always stay open-source, and we do love to receive postcards from wherever Stacks is used! 🌍 _We also publish them on our website._

Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎

## Sponsors

We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.

- [JetBrains](https://www.jetbrains.com/)
- [The Solana Foundation](https://solana.com/)

## Credits

- [Chris Breuer](https://github.com/chrisbbreuer)
- [All Contributors](https://github.com/stacksjs/tlsx/contributors)

## License

The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/tlsx/tree/main/LICENSE.md) for more information.

Made with 💙
85 changes: 0 additions & 85 deletions docs/markdown-examples.md

This file was deleted.

0 comments on commit 48d20a1

Please sign in to comment.