Skip to content

Commit

Permalink
docs: support VitePress official docs 🚀 (#71)
Browse files Browse the repository at this point in the history
* docs: support `VitePress` official docs 🚀

* ci: release docs workflow
  • Loading branch information
Avivbens authored Apr 19, 2024
1 parent 62b2563 commit a71bcf9
Show file tree
Hide file tree
Showing 23 changed files with 1,959 additions and 186 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy VitePress Docs 📚

on:
push:
branches:
- master
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yaml'

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
checks:
name: Checks 🧪
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checks 🧪
uses: ./.github/workflows/health-check

build:
name: Build 🔨
runs-on: ubuntu-latest
needs:
- checks
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🖥️ Setup Env
uses: ./.github/workflows/install

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Build with VitePress
run: npm run docs:build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'dist/docs'

deploy:
name: Deploy 🚀
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs:
- build
runs-on: ubuntu-latest

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
4 changes: 3 additions & 1 deletion .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
name: '📦 Create New Release'

on:
push:
paths-ignore:
- 'docs/**'
branches:
- master
- beta
Expand Down
129 changes: 3 additions & 126 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ installs apps, configures your dev system, and personalizes your working station

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/kcao7snkgx)

### [Read Our Official Docs 📚](https://github.com/Avivbens/shell-config/pages)

</div>

<div align="left">
Expand All @@ -29,33 +31,7 @@ sudo cd && /bin/bash -c "$(curl -fsSLk https://raw.githubusercontent.com/avivben

`shell-config` is your go-to CLI tool for seamless MacOS configuration, app installation and zsh aliases commands.

Set up the very same environment, with a personalization touch just for your needs, on all your Macs in minutes, and enjoy a consistent experience across all your devices.

## CLI Features

📦 **Effortless App Installation:**

- Install apps with default selections or customized user profiles.
- Choose what suits **your needs**, whether you're a developer, designer, or data scientist. 💻

🐚 **Plug & Play Shell Settings:**

- Optimize your command line with bash functions and aliases.
- Tailor your shell experience by enabling or disabling specific features.

🔄 **Version Control:**

- Effortlessly switch between CLI versions and receive notifications about new updates.

🖥️ **MacOS Compatibility:**

- Compatible with MacOS 11 and above, ensuring seamless integration across all MacOS architectures. 🍏💻

🛠️ **Generate & Manage Assets Files:**

- Easily generate or update asset files like `.npmrc` and `.gitconfig` with the settings you need.
- `shell-config` supports multiple profiles, allowing you to create and manage various configurations for different projects or team requirements.
- Seamlessly switch between profiles to adapt your environment to the task at hand.
Set up the very same environment, with a personalization touch just for your needs, on every MacOS machine within minutes, enjoy a consistent experience across all devices.

</div>

Expand All @@ -73,107 +49,8 @@ If you're facing issues like the following, **FORCE QUIT** the terminal and open
Error: Cannot find module '*/shell-config/*'
```

## CLI Usage

Opt-in OR opt-out global bash functions and configurations.

```bash
shell-config shell
```

<br>

Select apps to install.
<br>
We're now support [preferences based on your selection!](#Screenshots)
<br>
**Pay attention to passwords inputs if needed!**

```bash
shell-config install
```

<br>

Apply npmrc and gitconfig files, with secrets.
Support multiple accounts.
<br>
Pay attention to passwords inputs if needed!

```bash
shell-config assets
```

<br>

Install external shell configurations - share your bash functions with others!

```bash
shell-config external --help
```

<br>

Select CLI version / update version, target is optional - default is latest

```bash
shell-config update --target {version}
```

## Supported Terminal Features

- System commands
- Git commands
- Node & NPM commands
- Google-Cloud-Sdk
- Homebrew
- Fig
- Autosuggest
- Autocomplete
- Colored Correct Code
- Mongodb
- Redis
- Angular
- Nestjs
- Typescript

<br>

# Modules federation

### Entry points

- [.entry-point](zsh/.entry-point.sh) - entry point from `.zshrc`, contains `source` commands for all modules, load the `.zshrc.extends` file
- [.zshrc.extends](zsh/.zshrc.extends.sh) - entry point for all modules, imports them from `.zshrc.extends.*.sh` files

### Modules

- [Git](zsh/extends/.zshrc.extends.git.sh)
- [VSCode](zsh/extends/.zshrc.extends.vscode.sh)
- [Npm](zsh/extends/.zshrc.extends.npm.sh)
- [Angular](zsh/extends/.zshrc.extends.angular.sh)
- [MongoDB](zsh/extends/.zshrc.extends.mongo.sh)
- [Python](zsh/extends/.zshrc.extends.python.sh)
- [Redis](zsh/extends/.zshrc.extends.redis.sh)
- [Nest](zsh/extends/.zshrc.extends.nest.sh)
- [Theme](zsh/extends/.zshrc.extends.theme.sh)

<br>

## Contributing

Good to know that you want to contribute to this project! 🎉

See [CONTRIBUTING.md](CONTRIBUTING.md)

## Screenshots

<div align="center">

<img src="docs/install-options.jpg" style="width: 49%; object-fit: cover; border-radius: 10px;">
<img src="docs/shell-command.jpg" style="width: 49%; object-fit: cover; border-radius: 10px;">
<img src="docs/assets-command.jpg" style="width: 49%; object-fit: cover; border-radius: 10px;">
<img #tags-pref src="docs/select-tags.jpg" style="width: 49%; object-fit: cover; border-radius: 10px;">
<img src="docs/install-command.jpg" style="width: 49%; object-fit: cover; border-radius: 10px;">

</div>
1 change: 1 addition & 0 deletions docs/.vitepress/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cache/**/*
36 changes: 36 additions & 0 deletions docs/.vitepress/config.mts
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' },
},
},
})
26 changes: 26 additions & 0 deletions docs/.vitepress/constants/repository.mts
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!');
}
3 changes: 3 additions & 0 deletions docs/.vitepress/navbar.config.mts
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: '/' }];
42 changes: 42 additions & 0 deletions docs/.vitepress/sidebar.config.mts
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',
},
],
},
]
38 changes: 38 additions & 0 deletions docs/app/commands/assets.md
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)
Loading

0 comments on commit a71bcf9

Please sign in to comment.