-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: support
VitePress
official docs 🚀
- Loading branch information
Showing
21 changed files
with
1,886 additions
and
185 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
cache/**/* |
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,36 @@ | ||
import { defineConfig } from 'vitepress' | ||
import { remoteDefaultBranch, repositoryFullname } from './constants/repository.mjs' | ||
import { NAVBAR } from './navbar.config.mjs' | ||
import { SIDEBAR } from './sidebar.config.mjs' | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: 'Shell Config', | ||
description: 'CLI Tool for MacOS setup - apps, shell, assets, etc', | ||
base: `/pages/${repositoryFullname}/`, | ||
cleanUrls: true, | ||
ignoreDeadLinks: false, | ||
outDir: '../dist/docs/', | ||
markdown: { | ||
defaultHighlightLang: 'typescript', | ||
breaks: true, | ||
lineNumbers: true, | ||
}, | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: NAVBAR, | ||
sidebar: SIDEBAR, | ||
socialLinks: [ | ||
// | ||
{ icon: 'github', link: `https://github.com/${repositoryFullname}#readme` }, | ||
], | ||
search: { provider: 'local' }, | ||
editLink: { | ||
pattern: `https://github.com/${repositoryFullname}/edit/${remoteDefaultBranch}/docs/:path`, | ||
text: 'Edit this page on GitHub', | ||
}, | ||
lastUpdated: { | ||
formatOptions: { dateStyle: 'medium' }, | ||
}, | ||
}, | ||
}) |
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,26 @@ | ||
import { execSync } from 'node:child_process'; | ||
import { env } from 'node:process'; | ||
|
||
const remoteOrigin = | ||
env.GITHUB_SERVER_URL && env.GITHUB_REPOSITORY | ||
? `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}.git` | ||
: execSync('git remote get-url origin').toString().trim(); | ||
|
||
export const remoteBaseURL = new URL(remoteOrigin).origin; | ||
|
||
export const repositoryLink = remoteOrigin.replace(/\.git$/m, ''); | ||
|
||
export const repositoryFullname = env.GITHUB_REPOSITORY || remoteOrigin.match(/^https:\/\/.*\/(.*\/.*).git$/m)?.[1]; | ||
|
||
// TODO: dynamically get the default branch | ||
export const remoteDefaultBranch = 'master'; | ||
|
||
if (!remoteBaseURL) { | ||
throw new Error('Could not find remote base URL!'); | ||
} else if (!repositoryLink) { | ||
throw new Error('Could not find repository link!'); | ||
} else if (!repositoryFullname) { | ||
throw new Error('Could not find repository fullname!'); | ||
} else if (!remoteDefaultBranch) { | ||
throw new Error('Could not find remote default branch!'); | ||
} |
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,3 @@ | ||
import { DefaultTheme } from 'vitepress'; | ||
|
||
export const NAVBAR: DefaultTheme.NavItem[] = [{ text: 'Home', link: '/' }]; |
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,42 @@ | ||
import { DefaultTheme } from 'vitepress' | ||
|
||
export const SIDEBAR: DefaultTheme.Sidebar = [ | ||
{ | ||
text: 'Commands', | ||
collapsed: false, | ||
base: '/app/commands/', | ||
items: [ | ||
{ | ||
text: 'Install', | ||
link: '/install.md', | ||
}, | ||
{ | ||
text: 'Shell', | ||
link: '/shell.md', | ||
}, | ||
{ | ||
text: 'Assets', | ||
link: '/assets.md', | ||
}, | ||
{ | ||
text: 'Update', | ||
link: '/update.md', | ||
}, | ||
], | ||
}, | ||
{ | ||
text: 'Troubleshooting', | ||
collapsed: false, | ||
base: '/app/troubleshooting/', | ||
items: [ | ||
{ | ||
text: 'Permissions', | ||
link: '/permissions.md', | ||
}, | ||
{ | ||
text: 'Not Found', | ||
link: '/not-found.md', | ||
}, | ||
], | ||
}, | ||
] |
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,38 @@ | ||
<script setup> | ||
const repoUrl = 'https://github.com/Avivbens/shell-config/tree/HEAD' | ||
</script> | ||
|
||
# Assets Command | ||
|
||
The `assets` command is used to configure your MacOS assets, such as `gitconfig` and `npmrc`. | ||
|
||
## Usage | ||
|
||
```bash | ||
shell-config assets | ||
``` | ||
|
||
Select and customize the assets according to your needs, by using the arrow keys and space bar to enter into menus. Press `Enter` to apply the selected assets. | ||
|
||
For each selected asset, you'd be asked to provide the required information. | ||
|
||
::: warning **Note ❗** | ||
For some configuration, you may be asked to provide your password. | ||
Pay attention to the password inputs if needed! *(key icon)* | ||
::: | ||
|
||
## Multi Profiles Support | ||
|
||
Both `gitconfig` and `npmrc` assets support multi profiles. | ||
|
||
You can create as many profiles as you wish, and simply switch between them using the `npmrc` NPM package / `swgit` command for `gitprofile`. | ||
|
||
## Assets | ||
|
||
- [Git Profile](https://github.com/Avivbens/shell-config/tree/HEAD/assets/.gitconfig.template) | ||
- [npmrc Default](https://github.com/Avivbens/shell-config/tree/HEAD/assets/.npmrc.template) | ||
- [npmrc Custom](https://github.com/Avivbens/shell-config/tree/HEAD/assets/.npmrc.custom.template) | ||
|
||
## Examples | ||
|
||
![Assets Page](../../assets/assets-command.jpg) |
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,28 @@ | ||
# Install Command | ||
|
||
The `install` command is used to install useful MacOS applications. | ||
|
||
This command will install the application and all of its dependencies. | ||
|
||
## Usage | ||
|
||
```bash | ||
shell-config install | ||
``` | ||
|
||
Select the applications you want to install by using the arrow keys and space bar to select/deselect the applications. Press `Enter` to install the selected applications. | ||
|
||
::: warning **Note ❗** | ||
For some applications, you may be asked to provide your password. | ||
Pay attention to the password inputs if needed! *(key icon)* | ||
::: | ||
|
||
## Profiles | ||
|
||
You can set a predefined selected applications by using the profiles feature. Simply select the relevant profiles you'd like to have, and press `Enter` to preselect relevant applications. | ||
|
||
## Examples | ||
|
||
![Install Profiles](../../assets/select-tags.jpg) | ||
![Install Options](../../assets/install-options.jpg) | ||
![After Install](../../assets/install-command.jpg) |
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,33 @@ | ||
<script setup> | ||
const repoUrl = 'https://github.com/Avivbens/shell-config/tree/HEAD' | ||
</script> | ||
|
||
# Shell Command | ||
|
||
The `shell` command is used to configure the MacOS shell environment. | ||
|
||
The command allow you to enable / disable bash functions and aliases by their modules, and to configure the shell prompt. | ||
|
||
## Usage | ||
|
||
```bash | ||
shell-config shell | ||
``` | ||
|
||
Enable / disable the modules according to your preferences, by using the arrow keys and space bar to select/deselect the modules. Press `Enter` to apply the selected modules. | ||
|
||
## Modules | ||
|
||
- [Git](https://github.com/Avivbens/shell-config/tree/HEAD/zsh/extends/.zshrc.extends.git.sh) | ||
- [VSCode](https://github.com/Avivbens/shell-config/tree/HEAD/zsh/extends/.zshrc.extends.vscode.sh) | ||
- [Npm](https://github.com/Avivbens/shell-config/tree/HEAD/zsh/extends/.zshrc.extends.npm.sh) | ||
- [Angular](https://github.com/Avivbens/shell-config/tree/HEAD/zsh/extends/.zshrc.extends.angular.sh) | ||
- [MongoDB](https://github.com/Avivbens/shell-config/tree/HEAD/zsh/extends/.zshrc.extends.mongo.sh) | ||
- [Python](https://github.com/Avivbens/shell-config/tree/HEAD/zsh/extends/.zshrc.extends.python.sh) | ||
- [Redis](https://github.com/Avivbens/shell-config/tree/HEAD/zsh/extends/.zshrc.extends.redis.sh) | ||
- [Theme](https://github.com/Avivbens/shell-config/tree/HEAD/zsh/extends/.zshrc.extends.theme.sh) | ||
<!-- - [Nest](https://github.com/Avivbens/shell-config/tree/HEAD/zsh/extends/.zshrc.extends.nest.sh) --> | ||
|
||
## Examples | ||
|
||
![Shell Command](../../assets/shell-command.jpg) |
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,27 @@ | ||
# Update Command | ||
|
||
The `update` command is used to update the shell-config CLI to the latest version. | ||
|
||
You can also update the CLI to a specific version, by using the `-t / --target` flag, providing the version number as an argument. | ||
|
||
With every update, you'd be asked to update the `shell-config` CLI. All existing configurations will be preserved, and new capabilities will be added. | ||
|
||
## Usage | ||
|
||
```bash | ||
shell-config update | ||
``` | ||
|
||
## Flags | ||
|
||
### Upgrade / Downgrade to Specific Version | ||
|
||
```bash | ||
shell-config update -t <VERSION_HERE> | ||
``` | ||
|
||
### Check for Updates | ||
|
||
```bash | ||
shell-config update -m | ||
``` |
Oops, something went wrong.