Skip to content

Commit

Permalink
Swap to yarn berry and added useful plugins, enforce ts
Browse files Browse the repository at this point in the history
Copy over eslint, prettier, some yarn commands from Buddies of Budgie.
  • Loading branch information
JoshStrobl committed May 21, 2023
1 parent dece691 commit 8b0894a
Show file tree
Hide file tree
Showing 16 changed files with 13,164 additions and 21,823 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": { "project": ["./tsconfig.json"] },
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error"
},
"ignorePatterns": ["**/dist/*", "next.config.js"]
}
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ dist
# TernJS port file
.tern-port

# Generated docusaurus files
.docusaurus/
# Docusaurus
.docusaurus
.yarn/cache
.yarn/install-state.gz
build

**.kate-swp

build/
**.kate-swp
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node
17 changes: 17 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Build artifacts
**/.husky
**/.next
**/.turbo
**/.yarn
**/dist

node_modules/
**/node_modules

# Infra for now until we know prettier doesn't do anything silly to our kubectl files
**/infra/

# LICENSE should not be touched
LICENSE.md
package.json
yarn.lock
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"printWidth": 120,
"tabWidth": 2,
"trailingComma": "es5"
}
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.1.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


yarn-path ".yarn/releases/yarn-1.22.19.cjs"
9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.5.1.cjs
42 changes: 33 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This is the repository for Solus's Help Center documentation. This repository ex
Stumbled on this repo and have no idea what any of this is? Check out the [Solus](https://getsol.us) operating system!

## Updating local repos after docusarus switch

```
git branch -m master old-help-center
git branch -m docusarus master
Expand All @@ -13,25 +14,49 @@ git branch -u origin/master master
git remote set-head origin -a
```

## Running Locally
## Getting Started

To get started developing our Docusaurus instance, or writing documentation, first [fork this project](https://github.com/getsolus/help-center-docs/fork) in order to submit pull requests for your changes

This project is written using [TypeScript](https://www.typescriptlang.org) and [React](https://reactjs.org), with some documentation being Markdown or [MDX](https://mdxjs.com/). To facilitate development, we use nvm and Yarn.

### NVM

To set up nvm, the Node Version Manager, follow the instructions listed [here](https://github.com/nvm-sh/nvm#readme). We recommend [setting up their shell integration](https://github.com/nvm-sh/nvm#deeper-shell-integration) as well, so you can automatically switch to the correct Node version when working on this project. Otherwise, ensure you run `nvm use`. This project requires the "current" supported release series of Node.

You can validate you are using the latest by running `node --version`. Your version should be at least 19.x.

### Yarn

This project makes use of [Yarn](https://yarnpkg.com/) for its package management. After setting up nvm and ensuring you are running the latest Node, run:

```
corepack enable
```

### Installing Dependencies

To install the required dependencies, run: `yarn`

`npm install`
`npm start`
### Starting Docusaurus

# Generate a static site
To start the live reloading Docusaurus, run: `yarn start`

`npm run build`
`npm run serve`
### Other Useful Commands

This is needed to test searching
- Clear local build cache: `yarn clear`
- Linting: `yarn lint`
- Updating translation files: `yarn write-translations`
- Validate build: `yarn build`
- Run validated build: `yarn serve`

## Publishing to https://help.getsol.us (via GH Pages)

Ensure that you can successfully generate a static site as above.

Then, when you're ready to deploy, run the following:

`USE_SSH=true npm run deploy`
`USE_SSH=true yarn run deploy`

This obviously assumes that you have ssh push access to the help-center-docs repo and are using `[email protected]:getsolus/help-center-docs.git` (as listed by `git config -l`).

Expand All @@ -41,7 +66,6 @@ This obviously assumes that you have ssh push access to the help-center-docs rep

When updating an article, remember to update the date.


### Multi-Lingual Documents

Note that multi-lingual documents are not yet supported on our Help Center. When it does, we'll be happy to accept non-English language documents.
Expand Down
Loading

0 comments on commit 8b0894a

Please sign in to comment.