Skip to content

Commit

Permalink
doc: describe ./vscode symlinks in Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
cahnory committed Oct 15, 2023
1 parent 36ecdd9 commit 8ad17b0
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
Template for Monorepo with PNPm, TypeScript, ESLint, Prettier, and TurboRepo.

- [1. Initialization](#1-initialization)
- [2. Package Organization: "apps" vs "libs"](#2-package-organization-apps-vs-libs)
- [2.1. Adding a New App](#21-adding-a-new-app)
- [2.2. Adding a New Lib](#22-adding-a-new-lib)
- [2. Package organization: "apps" vs "libs"](#2-package-organization-apps-vs-libs)
- [2.1. Adding a new app](#21-adding-a-new-app)
- [2.2. Adding a new lib](#22-adding-a-new-lib)
- [3. Scripts](#3-scripts)
- [3.1. Package Scripts](#31-package-scripts)
- [3.1. Package scripts](#31-package-scripts)
- [3.1.1. build](#311-build)
- [3.1.2. dev](#312-dev)
- [3.1.3. test](#313-test)
- [3.1.4. test:lint](#314-testlint)
- [3.1.5. test:types](#315-testtypes)
- [3.1.6. test:unit](#316-testunit)
- [3.2. Root-Level Scripts](#32-root-level-scripts)
- [3.2. Root-Level scripts](#32-root-level-scripts)
- [3.2.1. build](#321-build)
- [3.2.2. dev](#322-dev)
- [3.2.3. test](#323-test)
Expand All @@ -26,6 +26,7 @@ Template for Monorepo with PNPm, TypeScript, ESLint, Prettier, and TurboRepo.
- [4. VSCode integration](#4-vscode-integration)
- [Recommended extensions](#recommended-extensions)
- [Reader Mode](#reader-mode)
- [Ensuring consistent VSCode configuration across packages](#ensuring-consistent-vscode-configuration-across-packages)
- [5. Troubleshooting](#5-troubleshooting)
- [5.1. IDE issues or project malfunctioning? Try `pnpm prepare`!](#51-ide-issues-or-project-malfunctioning-try-pnpm-prepare)
- [5.2. Unable to resolve path to module… eslint("import/no-unresolved")](#52-unable-to-resolve-path-to-module-eslintimportno-unresolved)
Expand All @@ -39,13 +40,13 @@ cd <your-project>
pnpm install
```

## 2. Package Organization: "apps" vs "libs"
## 2. Package organization: "apps" vs "libs"

In our monorepo, we have two main directories for organizing packages: "apps" and "libs". It's important to note that the packages located in the "apps" directory are not intended to be imported by other packages within the monorepo. These packages typically represent standalone applications or executables.

On the other hand, the packages residing in the "libs" directory are specifically designed to be imported and used by other packages. They provide reusable components, libraries, or modules that facilitate code sharing and maintainability across different parts of the monorepo.

### 2.1. Adding a New App
### 2.1. Adding a new app

To add a new app:

Expand All @@ -61,7 +62,7 @@ To add a new app:
}
```

### 2.2. Adding a New Lib
### 2.2. Adding a new lib

To add a new lib:

Expand Down Expand Up @@ -91,7 +92,7 @@ To add a new lib:

## 3. Scripts

### 3.1. Package Scripts
### 3.1. Package scripts

#### 3.1.1. build

Expand All @@ -117,7 +118,7 @@ The _test:types_ script verifies that the package's source code is free from Typ

The _test:unit_ script runs the package's unit tests. It validates the behavior of individual components, functions, or modules within the package. This script ensures that the package's internal units are functioning as expected.

### 3.2. Root-Level Scripts
### 3.2. Root-Level scripts

The monorepo also includes root-level scripts with similar functionality as their package-level counterparts. The key distinction is that these scripts can be executed across all packages within the monorepo simultaneously, providing a unified and efficient workflow. Running the root-level scripts allows you to perform the respective actions (build, dev, test) on multiple packages within the monorepo in a single operation. This saves time and ensures consistency across the entire codebase.

Expand Down Expand Up @@ -179,6 +180,10 @@ By default, the [configuration](./.vscode/settings.json) includes patterns targe

Extend this list to safeguard additional files as needed.

### Ensuring consistent VSCode configuration across packages

Each package contains a symbolic link `./vscode` that points to the root-level `./vscode` directory within the monorepo. This ensures that even if you open an individual package directly in VSCode (as opposed to opening the entire monorepo), you'll have a consistent VSCode configuration. This approach provides a uniform development environment across packages, reducing potential configuration discrepancies.

## 5. Troubleshooting

### 5.1. IDE issues or project malfunctioning? Try `pnpm prepare`!
Expand Down

0 comments on commit 8ad17b0

Please sign in to comment.