Skip to content

Commit

Permalink
fix(global): new directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
waldronmatt committed Jun 15, 2024
1 parent be0bc45 commit 830895f
Show file tree
Hide file tree
Showing 152 changed files with 1,436 additions and 1,428 deletions.
34 changes: 18 additions & 16 deletions docs/repo/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,26 @@ The repository setup and folder structure is heavily inspired by the turborepo [

## Folder Structure

```bash
apps/
configs/
docs/
packages/
...
package.json
pnpm-workspace.yaml
```plaintext
├── apps
│ └── (Contains standalone applications / SPAs used to demo code in `packages`)
├── configs
│ └── (Contains linters / configurations such as `eslint` / `tsconfig`)
├── docs
│ └── (Contains documentation for this repo and various programming topics)
├── examples
│ └── (Similar to `apps`; contains applications used to demo code in `templates`)
├── packages
│ └── (Contains my personal utilities and tools published to `npm`)
└── templates
└── (Similar to `packages`; contains reusable setups published to `npm`)
```

**`apps`** - Contains standalone applications / SPAs that can consume modules in `packages`

**`configs`** - Contains linters / configurations such as `eslint` / `tsconfig` shared across the monorepo

**`docs`** - Contains documentation for ui components and workspace documentation

**`packages`** - Contains utilities and tools published to `npm` that are used across the monorepo

## Turborepo Differences

- Tooling and configurations such as `eslint` and `tsconfig` are included in their own `config` folder. This is a personal preference to separate from the `packages` folder where reusable packages and utilities shared across projects are stored.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const config = {
alias: [
{
find: '@demo-ui',
replacement: path.resolve(__dirname, '../../../packages/ui'),
replacement: path.resolve(__dirname, '../../../templates/demo-ui'),
},
],
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test": "vitest run --coverage -u",
"test:watch": "vitest --watch -u",
"build": "storybook build",
"clean": "rimraf storybook-static",
"clean": "rimraf storybook-static coverage",
"preview": "serve storybook-static"
},
"dependencies": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"exclude": ["node_modules", "dist"],
"compilerOptions": {
"paths": {
"@/*": ["../../packages/library/src/core/*"],
"@localTypes/*": ["../../packages/library/src/types/*"]
"@/*": ["../../templates/library/src/core/*"],
"@localTypes/*": ["../../templates/library/src/types/*"]
}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export default defineConfig({
alias: [
{
find: /^@\/(.*)$/,
replacement: `${path.resolve('../../packages/library')}/src/core/$1`,
replacement: `${path.resolve('../../templates/library')}/src/core/$1`,
},
{
find: /^@localTypes\/(.*)$/,
replacement: `${path.resolve('../../packages/library')}/src/types/$1`,
replacement: `${path.resolve('../../templates/library')}/src/types/$1`,
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
"packages": ["apps/*", "configs/*", "docs/*", "packages/*"],
"packages": ["apps/*", "configs/*", "docs/*", "examples/*", "packages/*", "templates/*"],
"npmClient": "pnpm",
"loglevel": "verbose",
"version": "independent",
Expand Down
6 changes: 3 additions & 3 deletions lint-staged.config.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
'*': ['secretlint', 'prettier --cache --write --ignore-unknown'],
'**/package.json': ['npx syncpack lint --config .syncpackrc', 'manypkg check'],
'packages/**/package.json': ['node ./publint.js', 'npx nx run-many -t lint:types'],
'{packages,templates}/**/package.json': ['npx syncpack lint --config .syncpackrc', 'manypkg check'],
'{packages,templates}/**/package.json': ['node ./publint.js', 'npx nx run-many -t lint:types'],
'*.{cjs,js,jsx,ts,tsx}': ['nx affected -t lint --fix --files'],
'*.{ts,tsx}': ['nx affected -t test --files'],
'packages/**/*.{ts,tsx}': ['npx nx run-many -t lint:knip'],
'{packages,templates}/**/*.{ts,tsx}': ['npx nx run-many -t lint:knip'],
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 830895f

Please sign in to comment.