Skip to content

Commit

Permalink
refactor: Update Docusaurus & ESLint configuration (#522)
Browse files Browse the repository at this point in the history
[WIP]

Co-authored-by: Salvydas Lukosius <[email protected]>
  • Loading branch information
ss-o and ss-o authored Nov 30, 2023
1 parent d35d5aa commit 86f387b
Show file tree
Hide file tree
Showing 126 changed files with 3,608 additions and 20,315 deletions.
46 changes: 20 additions & 26 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
env:
browser: true
es2022: true
es2024: true
node: true
extends:
- plugin:react/recommended
- standard-with-typescript
- eslint:recommended
- plugin:react-hooks/recommended
- plugin:@typescript-eslint/recommended
- prettier
- plugin:@docusaurus/recommended
settings:
"import/resolver":
typescript: {}
node:
extensions: [".js", ".jsx", ".ts", ".tsx"]
globals:
JSX: true
reportUnusedDisableDirectives: true
parser: "@typescript-eslint/parser"
parserOptions:
ecmaVersion: latest
Expand All @@ -21,9 +19,18 @@ parserOptions:
jsx: true
project:
- tsconfig.json
settings:
"import/resolver":
typescript:
alwaysTryTypes: true
node:
extensions: [".js", ".jsx", ".ts", ".tsx"]
"import/parsers":
"@typescript-eslint/parser": [".ts", ".tsx"]
plugins:
- import
- react-hooks
- "@docusaurus"
- "@typescript-eslint"
rules:
{
"semi": [2, "always"],
Expand All @@ -49,22 +56,8 @@ rules:
"prefer-destructuring": 1,
"prefer-named-capture-group": 1,
"prefer-template": 1,
"react-hooks/rules-of-hooks": 2,
"react-hooks/exhaustive-deps": 2,
"react/jsx-filename-extension": [1, {extensions: [".js", ".jsx", ".ts", ".tsx"]}],
"react/function-component-definition":
[2, {namedComponents: "function-declaration", unnamedComponents: "arrow-function"}],
"react/jsx-props-no-spreading": 0,
"react/jsx-key": [2, {checkFragmentShorthand: true}],
"react/jsx-no-useless-fragment": [1, {allowExpressions: true}],
"react/no-unstable-nested-components": [1, {allowAsProps: true}],
"react/prefer-stateless-function": 1,
"react/require-default-props": [2, {ignoreFunctionalComponents: true}],
"import/prefer-default-export": 0,
"@docusaurus/string-literal-i18n-messages": 2,
"@docusaurus/no-untranslated-text": [1, {ignoredStrings: ["·", "—", "×"]}],
"import/extensions": 0,
"import/no-unresolved": [2, {"ignore": ["^@theme", "^@docusaurus", "^@site"]}],
"import/no-unresolved": [2, {ignore: ["^@theme", "^@docusaurus", "^@generated", "^@site", "^@testing-utils"]}],
"import/order":
[
1,
Expand All @@ -79,6 +72,8 @@ rules:
position: "after",
},
{pattern: "react", group: "builtin", position: "before"},
{pattern: "react-dom", group: "builtin", position: "before"},
{pattern: "react-dom/**", group: "builtin", position: "before"},
{pattern: "clsx", group: "external", position: "before"},
{pattern: "@theme/**", group: "internal"},
{pattern: "@site/**", group: "internal"},
Expand All @@ -89,6 +84,5 @@ rules:
warnOnUnassignedImports: true,
},
],
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/consistent-type-imports": [2, {"disallowTypeAnnotations": false}],
"import/prefer-default-export": 0,
}
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/01_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ body:
label: Environment
description: >
Please describe your environment in as much detail as possible. Otherwise, we may not be able to reproduce the issue.
placeholder: >
Example:
print "Device: $VENDOR | $OSTYPE | $CPUTYPE"
print "Shell: $SHELL | $ZSH_ARGZERO | $ZSH_PATCHLEVEL"
print "Zi: $(git -C $ZI[BIN_DIR] rev-parse HEAD)"
validations:
required: true
- type: textarea
Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/02_feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ body:
id: additional
attributes:
label: Additional Context
description:
"List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to add, use case, Stack Overflow links, forum links, screenshots, OS if applicable,
etc."
description: "List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to add, use case, Stack Overflow links, forum links, screenshots, OS if applicable, etc."
validations:
required: false
- type: checkboxes
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/argos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: "📊 Argos CI"

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions: read-all

jobs:
take-screenshots:
runs-on: ubuntu-latest
steps:
- name: "⤵️ Check out code from GitHub"
uses: actions/checkout@v4
- name: "📦 Setup pnpm"
uses: pnpm/[email protected]
- name: "⎔ Setup node"
uses: actions/[email protected]
with:
node-version: current
cache: "pnpm"
- name: Install dependencies
run: pnpm i

- name: Install Playwright browsers
run: pnpm playwright install --with-deps chromium

- name: Build the website
run: pnpm build:en

- name: Take screenshots with Playwright
run: pnpm playwright test

- name: Upload screenshots to Argos
run: pnpm argos upload ./screenshots
14 changes: 4 additions & 10 deletions .github/workflows/ci-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
- "package.json"
- "pnpm-lock.yaml"
- "babel.config.js"
- "docusaurus.config.js"
- "docusaurus.config.ts"
- "src/**"
- "static/**"
- "!docs/**"
Expand All @@ -40,14 +40,11 @@ jobs:
name: " 📊 Build Size Report"
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
permissions:
checks: write # for preactjs/compressed-size-action to create and update the checks
contents: read # for actions/checkout to fetch code
issues: write # for preactjs/compressed-size-action to create comments
pull-requests: write # for preactjs/compressed-size-action to write a PR review
issues: write # for preactjs/compressed-size-action to create comments
steps:
- name: "⤵️ Check out code from GitHub"
uses: actions/checkout@v4
Expand All @@ -58,7 +55,7 @@ jobs:
- name: "⎔ Setup node"
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
node-version: current
cache: "pnpm"
- run: pnpm i --prod
- uses: preactjs/compressed-size-action@v2
Expand All @@ -74,9 +71,6 @@ jobs:
name: 💹 Build Time Perf
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- name: "⤵️ Check out code from GitHub"
uses: actions/checkout@v4
Expand All @@ -87,7 +81,7 @@ jobs:
- name: "⎔ Setup node"
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
node-version: current
cache: "pnpm"
- run: pnpm i --prod
# Ensure build with a cold cache does not increase too much
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# @format
---
name: 🔒 Lock closed issues and PRs

Expand Down
6 changes: 3 additions & 3 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ plugins:
- id: trunk
uri: https://github.com/trunk-io/plugins
ref: v1.3.0
import_to_global: true
merge:
required_statuses:
- Trunk Check
lint:
disabled:
- terrascan
- trufflehog
- trivy
- checkov
Expand All @@ -25,7 +25,7 @@ lint:
- yamllint
- shellcheck
enabled:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Expand All @@ -50,7 +50,7 @@ lint:
- .trunk/config/*
- linters: [gitleaks]
paths:
- docusaurus.config.js
- docusaurus.config.ts
- linters: [markdownlint]
paths:
- src/components/Markdown/*
Expand Down
9 changes: 3 additions & 6 deletions blog/2022/01/15/swiss_army_knife_for_zsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ image: /img/png/theme/z/320x320.png

## 🧙‍♂️ 🪄 [❮ ZI ❯](https://github.com/z-shell/zi) - A Swiss Army Knife for [Zsh](https://zsh.sourceforge.io/) - [Unix shell](https://en.wikipedia.org/wiki/Unix_shell)

import useBaseUrl from '@docusaurus/useBaseUrl';
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl'; import ThemedImage from '@theme/ThemedImage';

<ThemedImage className="ImageView" alt="Zshell Logo"
sources={{
<ThemedImage className="ImageView" alt="Zshell Logo" sources={{
light: useBaseUrl('/img/zsh/artwork/png/color_horizontal_icon.png'),
dark: useBaseUrl('/img/zsh/artwork/png/white_horizontal_icon.png'),
}}
/>
}} />

Designed to glue everything together. 🔗

Expand Down
3 changes: 1 addition & 2 deletions community/01_zsh_guide/01_roadmap/10_expansion.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
id: expansion
title: 🃏 Expansion
description: The expansion, commonly referred to as globbing, is the operation that expands
a wildcard pattern into the list of pathnames matching the pattern
description: The expansion, commonly referred to as globbing, is the operation that expands a wildcard pattern into the list of pathnames matching the pattern
sidebar_position: 2
image: /img/zsh/artwork/app-icons/zsh-icon-256x256.png
keywords:
Expand Down
23 changes: 0 additions & 23 deletions community/99_contributors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ slug: contributors

import Link from "@docusaurus/Link";
import Image from "@theme/IdealImage";
import Emoji from "@site/src/components/Emoji";
import useBaseUrl from "@docusaurus/useBaseUrl";
import ThemedImage from "@theme/ThemedImage";

Expand Down Expand Up @@ -169,16 +168,6 @@ Contributions make the open-source community an amazing place to learn, inspire,
<b> Colerar </b>
</Link>
</td>
<td style={{ textAlign: "center", border: "none" }}>
<Link href='https://github.com/gzzchh'>
<Image
style={{ maxWidth: 62, height: "auto", borderRadius: "50%" }}
img='https://github.com/gzzchh.png'
/>
<br />
<b> MisakaCloud </b>
</Link>
</td>
<td style={{ textAlign: "center", border: "none" }}>
<Link href='https://github.com/mutoe'>
<Image
Expand All @@ -189,8 +178,6 @@ Contributions make the open-source community an amazing place to learn, inspire,
<b> Dongsen </b>
</Link>
</td>
</tr>
<tr style={{ border: "none" }}>
<td style={{ textAlign: "center", border: "none" }}>
<Link href='https://github.com/nakayama900'>
<Image
Expand Down Expand Up @@ -262,16 +249,6 @@ Contributions make the open-source community an amazing place to learn, inspire,
<b> Caleb Cushing </b>
</Link>
</td>
<td style={{ textAlign: "center", border: "none" }}>
<Link href='https://github.com/daudix-UFO'>
<Image
style={{ maxWidth: 62, height: "auto", borderRadius: "50%" }}
img='https://github.com/daudix-UFO.png'
/>
<br />
<b> David Lapshin </b>
</Link>
</td>
<td style={{ textAlign: "center", border: "none" }}>
<Link href='https://github.com/Kritiqual'>
<Image
Expand Down
37 changes: 15 additions & 22 deletions docs/getting_started/01_installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ keywords:
- install
---

<!-- @format -->

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Link from "@docusaurus/Link";
import Emoji from "@site/src/components/Emoji";

## <i class="fas fa-spinner fa-spin"></i> Quick setup {#quick-setup}

Expand Down Expand Up @@ -54,7 +51,7 @@ Reload the shell with <kbd>exec zsh -il</kbd> and run <kbd>zi -h</kbd> for usage
:::tip

- Verify the sha256 [checksum][checksum-txt] for file: <kbd>lib/sh/install.sh</kbd>
- If required append <kbd>`-b <tag>`</kbd> or <kbd>`-b <branch>`</kbd> e.g:
- If required append <kbd>-b \<tag></kbd> or <kbd>-b \<branch></kbd> e.g:

```shell
sh -c "$(curl -fsSL get.zshell.dev)" -- -i skip -b main
Expand Down Expand Up @@ -184,7 +181,7 @@ Run <kbd>zi -h</kbd> for available commands or [explore][collection-page] wiki t

If you have any issue or need help <Emoji symbol="🤦‍♂️" label="man-facepalming"/>, lets [discuss][discuss] it or open an [issue][issue] on GitHub.

It helps us to improve and make Zi better. Don't forget to help the project: share, contribute, or [translate][translate] <Emoji symbol="🌐" label="globe-with-meridians"/> <Emoji symbol="🥰" label="smiling-face-with-hearts"/> <Emoji symbol="🤓" label="nerd-face"/>.
It helps us to improve and make Zi better. Don't forget to help the project: share, contribute, or [translate][help-translate] <Emoji symbol="🌐" label="globe-with-meridians"/> <Emoji symbol="🥰" label="smiling-face-with-hearts"/> <Emoji symbol="🤓" label="nerd-face"/>.

Let's glue a toolchain that works for us <Emoji symbol="🚀" label="rocket"/>.

Expand Down Expand Up @@ -233,25 +230,21 @@ The module transparently and automatically compiles sourced scripts and lists of

### <i class="fa-solid fa-gear"></i> Installer {#installer}

| Service | URL |
| :--------- | ------------------------------------------------------------------------- |
| Redirect | <https://get.zshell.dev> |
| R2 | <https://r2.zshell.dev/src/sh/install.sh> |
| Cloudflare | <https://src.zshell.dev/sh/install.sh> |
| IPFS | <https://ipfs.zshell.dev/sh/install.sh> |
| Git.io | <https://git.io/get-zi> |
| GitHub RAW | <https://raw.githubusercontent.com/z-shell/zi-src/main/lib/sh/install.sh> |
| Service | URL |
| :--------- | ----------------------------------------------------------------------- |
| Redirect | https://get.zshell.dev |
| Cloudflare | https://src.zshell.dev/sh/install.sh |
| Git.io | https://git.io/get-zi |
| GitHub RAW | https://raw.githubusercontent.com/z-shell/zi-src/main/lib/sh/install.sh |

### <i class="fa-brands fa-superpowers"></i> Loader {#loader}

| Service | URL |
| :--------- | ------------------------------------------------------------------------ |
| Redirect | <https://init.zshell.dev> |
| R2 | <https://r2.zshell.dev/src/zsh/init.zsh> |
| Cloudflare | <https://src.zshell.dev/zsh/init.zsh> |
| IPFS | <https://ipfs.zshell.dev/zsh/init.zsh> |
| Git.io | <https://git.io/zi-loader> |
| GitHub RAW | <https://raw.githubusercontent.com/z-shell/zi-src/main/lib/zsh/init.zsh> |
| Service | URL |
| :--------- | ---------------------------------------------------------------------- |
| Redirect | https://init.zshell.dev |
| Cloudflare | https://src.zshell.dev/zsh/init.zsh |
| Git.io | https://git.io/zi-loader |
| GitHub RAW | https://raw.githubusercontent.com/z-shell/zi-src/main/lib/zsh/init.zsh |

<!-- end-of-file -->
<!-- links -->
Expand All @@ -271,5 +264,5 @@ The module transparently and automatically compiles sourced scripts and lists of
[issue]: https://github.com/z-shell/zi/issues/new/choose
[playground]: https://github.com/z-shell/playground
[status]: https://status.zshell.dev
[translate]: https://digitalclouds.crowdin.com/z-shell
[help-translate]: https://digitalclouds.crowdin.com/z-shell
[z-shell/zpmod]: https://github.com/z-shell/zpmod
Loading

0 comments on commit 86f387b

Please sign in to comment.