chore: use devenv
This commit is contained in:
parent
f3f67f6627
commit
e6e036e058
13 changed files with 224 additions and 72 deletions
3
.envrc
Normal file
3
.envrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="
|
||||
|
||||
use devenv
|
10
.gitignore
vendored
10
.gitignore
vendored
|
@ -5,6 +5,16 @@ build
|
|||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
|
||||
# Devenv
|
||||
.devenv*
|
||||
devenv.local.nix
|
||||
|
||||
# direnv
|
||||
.direnv
|
||||
|
||||
# pre-commit
|
||||
.pre-commit-config.yaml
|
||||
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/node,macos,turbo
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,turbo
|
||||
|
||||
|
|
5
.vscode/extensions.json
vendored
5
.vscode/extensions.json
vendored
|
@ -11,6 +11,9 @@
|
|||
"redhat.vscode-xml",
|
||||
"github.vscode-github-actions",
|
||||
"foxundermoon.shell-format",
|
||||
"editorconfig.editorconfig"
|
||||
"editorconfig.editorconfig",
|
||||
"redhat.vscode-yaml",
|
||||
"jnoortheen.nix-ide",
|
||||
"mkhl.direnv"
|
||||
]
|
||||
}
|
||||
|
|
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
|
@ -18,6 +18,8 @@
|
|||
"deno",
|
||||
"developomp",
|
||||
"developomp's",
|
||||
"devenv",
|
||||
"direnv",
|
||||
"dompurify",
|
||||
"elasticlunr",
|
||||
"Exyle",
|
||||
|
@ -43,6 +45,7 @@
|
|||
"Librewolf",
|
||||
"mhchem",
|
||||
"microflash",
|
||||
"nixpkgs",
|
||||
"nodedotjs",
|
||||
"nojs",
|
||||
"noopener",
|
||||
|
@ -75,6 +78,10 @@
|
|||
"zustand"
|
||||
],
|
||||
|
||||
"nix.formatterPath": "nixfmt",
|
||||
"nix.enableLanguageServer": true,
|
||||
"nix.serverPath": "nixd",
|
||||
|
||||
"eslint.workingDirectories": [{ "mode": "auto" }],
|
||||
"eslint.validate": ["javascript", "typescript", "svelte"],
|
||||
|
||||
|
@ -118,5 +125,8 @@
|
|||
},
|
||||
"[markdown]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[nix]": {
|
||||
"editor.defaultFormatter": "jnoortheen.nix-ide"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,60 +1,39 @@
|
|||
# Contribution Guide
|
||||
|
||||
## Project Structure
|
||||
## Project overview
|
||||
|
||||
- `apps`
|
||||
- `main` - https://developomp.com
|
||||
- `blog` - https://blog.developomp.com
|
||||
- `packages` - shared stuff used across different packages
|
||||
- `content` - Shared content
|
||||
- `eslint-config` - ESLint configuration files
|
||||
- `tailwind-config` -tailwind configuration with pomp-specific extensions
|
||||
This project is largely managed by the following tools:
|
||||
|
||||
## Setting Up
|
||||
- [devenv](https://devenv.sh) - for development shell and dependencies. Think of [Docker](https://docker.com) but better.
|
||||
- [turborepo](https://turbo.build) - for JS/TS monorepo management. Understanding it is required to make sense of the project file structure.
|
||||
|
||||
> **If you are a Windows user:**
|
||||
>
|
||||
> - Do **NOT** use the Command Prompt (cmd)
|
||||
> - Do **NOT** use Windows PowerShell
|
||||
> - Run these commands from PowerShell or a Linux terminal such as WSL or Git Bash
|
||||
>
|
||||
> PowerShell and Windows PowerShell are [different applications](https://learn.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.3).
|
||||
You need at least basic level understanding of the tools above to effectively work on this project.
|
||||
|
||||
1. Clone this git repository
|
||||
2. Install the following
|
||||
- [NodeJS](https://nodejs.org)
|
||||
- [pnpm](https://pnpm.io/installation)
|
||||
3. Install Dependencies
|
||||
```
|
||||
pnpm install
|
||||
```
|
||||
4. Setup husky
|
||||
```
|
||||
pnpm husky install
|
||||
```
|
||||
5. Run whatever command you need either in project root or in individual packages
|
||||
- `pnpm build` - Build all apps and packages
|
||||
- `pnpm dev` - Run all apps and packages locally
|
||||
- blog - http://localhost:3000
|
||||
- main - http://localhost:5173
|
||||
- `pnpm lint` - Lint all apps and packages
|
||||
- `pnpm i_am_sure_i_want_to_nuke_gitignored_files` - Remove all auto-generated content such as `node_modules` and `dist`.
|
||||
## Setting up
|
||||
|
||||
1. Install the following
|
||||
- [devenv](https://devenv.sh/getting-started)
|
||||
- [direnv](https://direnv.net/docs/installation.html)
|
||||
2. Clone this git repository
|
||||
3. Start coding!
|
||||
|
||||
## Building
|
||||
|
||||
must build the dependencies first
|
||||
|
||||
```
|
||||
pnpm build
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
1. Build site
|
||||
|
||||
```
|
||||
pnpm build
|
||||
```
|
||||
|
||||
2. Run E2E Tests
|
||||
1. Run E2E Tests
|
||||
|
||||
```
|
||||
pnpm test:e2e
|
||||
```
|
||||
|
||||
3. Benchmark deployed sites using the following services:
|
||||
2. Benchmark deployed sites using the following services:
|
||||
|
||||
- https://seoptimer.com
|
||||
- https://gtmetrix.com
|
||||
|
|
|
@ -14,6 +14,7 @@ A collection of "pomp-branded" websites.
|
|||
|
||||
## Tech Stack
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
||||
"@fortawesome/react-fontawesome": "^0.2.0",
|
||||
"@kunukn/react-collapse": "^3.0.14",
|
||||
"@playwright/test": "^1.36.2",
|
||||
"@playwright/test": "1.47.0",
|
||||
"@types/highlight.js": "^10.1.0",
|
||||
"@types/katex": "^0.16.7",
|
||||
"@types/node": "^20.10.5",
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"@developomp-site/tailwind-config": "workspace:*",
|
||||
"@fontsource/noto-sans-kr": "^5.0.5",
|
||||
"@inqling/svelte-icons": "^3.5.0",
|
||||
"@playwright/test": "^1.36.2",
|
||||
"@playwright/test": "1.47.0",
|
||||
"@sveltejs/adapter-static": "^3.0.5",
|
||||
"@sveltejs/kit": "^2.5.7",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.1.0",
|
||||
|
|
100
devenv.lock
Normal file
100
devenv.lock
Normal file
|
@ -0,0 +1,100 @@
|
|||
{
|
||||
"nodes": {
|
||||
"devenv": {
|
||||
"locked": {
|
||||
"dir": "src/modules",
|
||||
"lastModified": 1735883199,
|
||||
"owner": "cachix",
|
||||
"repo": "devenv",
|
||||
"rev": "d67d04ae2dd3bc3723e615003034ba752e8db8c3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "src/modules",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1733328505,
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"pre-commit-hooks",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709087332,
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1735915915,
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a27871180d30ebee8aa6b11bf7fef8a52f024733",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1735882644,
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "a5a961387e75ae44cc20f0a57ae463da5e959656",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"devenv": "devenv",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
31
devenv.nix
Normal file
31
devenv.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
# https://devenv.sh/reference/options
|
||||
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
packages = with pkgs; [
|
||||
nixd
|
||||
nixfmt-rfc-style
|
||||
|
||||
# version must match what's defined in package.json
|
||||
playwright-driver
|
||||
];
|
||||
|
||||
env = {
|
||||
PLAYWRIGHT_BROWSERS_PATH = pkgs.playwright-driver.browsers;
|
||||
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = true;
|
||||
};
|
||||
|
||||
languages = {
|
||||
# https://devenv.sh/supported-languages/javascript
|
||||
javascript = {
|
||||
enable = true;
|
||||
package = pkgs.nodejs_20;
|
||||
|
||||
pnpm = {
|
||||
enable = true;
|
||||
install.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
7
devenv.yaml
Normal file
7
devenv.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
|
||||
|
||||
inputs:
|
||||
nixpkgs:
|
||||
url: github:nixos/nixpkgs/nixpkgs-unstable
|
||||
|
||||
allowUnfree: true
|
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
"name": "@developomp-site/playwright-config",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "index.ts",
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.36.2"
|
||||
"@playwright/test": "1.47.0"
|
||||
}
|
||||
}
|
||||
|
|
57
pnpm-lock.yaml
generated
57
pnpm-lock.yaml
generated
|
@ -72,8 +72,8 @@ importers:
|
|||
specifier: ^3.0.14
|
||||
version: 3.0.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
'@playwright/test':
|
||||
specifier: ^1.36.2
|
||||
version: 1.36.2
|
||||
specifier: 1.47.0
|
||||
version: 1.47.0
|
||||
'@types/highlight.js':
|
||||
specifier: ^10.1.0
|
||||
version: 10.1.0
|
||||
|
@ -118,10 +118,10 @@ importers:
|
|||
version: 0.16.10
|
||||
next:
|
||||
specifier: ^14.2.3
|
||||
version: 14.2.3(@playwright/test@1.36.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.75.0)
|
||||
version: 14.2.3(@playwright/test@1.47.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.75.0)
|
||||
next-sitemap:
|
||||
specifier: ^4.2.3
|
||||
version: 4.2.3(next@14.2.3(@playwright/test@1.36.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.75.0))
|
||||
version: 4.2.3(next@14.2.3(@playwright/test@1.47.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.75.0))
|
||||
open-cli:
|
||||
specifier: ^8.0.0
|
||||
version: 8.0.0
|
||||
|
@ -177,8 +177,8 @@ importers:
|
|||
specifier: ^3.5.0
|
||||
version: 3.5.0(svelte@4.2.15)
|
||||
'@playwright/test':
|
||||
specifier: ^1.36.2
|
||||
version: 1.36.2
|
||||
specifier: 1.47.0
|
||||
version: 1.47.0
|
||||
'@sveltejs/adapter-static':
|
||||
specifier: ^3.0.5
|
||||
version: 3.0.5(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@4.2.15)(vite@5.2.10(@types/node@20.10.5)(sass@1.75.0)))(svelte@4.2.15)(vite@5.2.10(@types/node@20.10.5)(sass@1.75.0)))
|
||||
|
@ -414,8 +414,8 @@ importers:
|
|||
packages/playwright-config:
|
||||
devDependencies:
|
||||
'@playwright/test':
|
||||
specifier: ^1.36.2
|
||||
version: 1.36.2
|
||||
specifier: 1.47.0
|
||||
version: 1.47.0
|
||||
|
||||
packages/prettier-config: {}
|
||||
|
||||
|
@ -1225,10 +1225,9 @@ packages:
|
|||
resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==}
|
||||
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
|
||||
|
||||
'@playwright/test@1.36.2':
|
||||
resolution: {integrity: sha512-2rVZeyPRjxfPH6J0oGJqE8YxiM1IBRyM8hyrXYK7eSiAqmbNhxwcLa7dZ7fy9Kj26V7FYia5fh9XJRq4Dqme+g==}
|
||||
engines: {node: '>=16'}
|
||||
deprecated: Please update to the latest version of Playwright to test up-to-date browsers.
|
||||
'@playwright/test@1.47.0':
|
||||
resolution: {integrity: sha512-SgAdlSwYVpToI4e/IH19IHHWvoijAYH5hu2MWSXptRypLSnzj51PcGD+rsOXFayde4P9ZLi+loXVwArg6IUkCA==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
|
||||
'@polka/url@1.0.0-next.24':
|
||||
|
@ -3887,9 +3886,14 @@ packages:
|
|||
resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
playwright-core@1.36.2:
|
||||
resolution: {integrity: sha512-sQYZt31dwkqxOrP7xy2ggDfEzUxM1lodjhsQ3NMMv5uGTRDsLxU0e4xf4wwMkF2gplIxf17QMBCodSFgm6bFVQ==}
|
||||
engines: {node: '>=16'}
|
||||
playwright-core@1.47.0:
|
||||
resolution: {integrity: sha512-1DyHT8OqkcfCkYUD9zzUTfg7EfTd+6a8MkD/NWOvjo0u/SCNd5YmY/lJwFvUZOxJbWNds+ei7ic2+R/cRz/PDg==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
|
||||
playwright@1.47.0:
|
||||
resolution: {integrity: sha512-jOWiRq2pdNAX/mwLiwFYnPHpEZ4rM+fRSQpRHwEwZlP2PUANvL3+aJOF/bvISMhFD30rqMxUB4RJx9aQbfh4Ww==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
|
||||
possible-typed-array-names@1.0.0:
|
||||
|
@ -5933,12 +5937,9 @@ snapshots:
|
|||
|
||||
'@pkgr/core@0.1.1': {}
|
||||
|
||||
'@playwright/test@1.36.2':
|
||||
'@playwright/test@1.47.0':
|
||||
dependencies:
|
||||
'@types/node': 20.10.5
|
||||
playwright-core: 1.36.2
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.2
|
||||
playwright: 1.47.0
|
||||
|
||||
'@polka/url@1.0.0-next.24': {}
|
||||
|
||||
|
@ -9065,15 +9066,15 @@ snapshots:
|
|||
|
||||
natural-compare@1.4.0: {}
|
||||
|
||||
next-sitemap@4.2.3(next@14.2.3(@playwright/test@1.36.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.75.0)):
|
||||
next-sitemap@4.2.3(next@14.2.3(@playwright/test@1.47.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.75.0)):
|
||||
dependencies:
|
||||
'@corex/deepmerge': 4.0.43
|
||||
'@next/env': 13.4.12
|
||||
fast-glob: 3.3.1
|
||||
minimist: 1.2.8
|
||||
next: 14.2.3(@playwright/test@1.36.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.75.0)
|
||||
next: 14.2.3(@playwright/test@1.47.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.75.0)
|
||||
|
||||
next@14.2.3(@playwright/test@1.36.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.75.0):
|
||||
next@14.2.3(@playwright/test@1.47.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.75.0):
|
||||
dependencies:
|
||||
'@next/env': 14.2.3
|
||||
'@swc/helpers': 0.5.5
|
||||
|
@ -9094,7 +9095,7 @@ snapshots:
|
|||
'@next/swc-win32-arm64-msvc': 14.2.3
|
||||
'@next/swc-win32-ia32-msvc': 14.2.3
|
||||
'@next/swc-win32-x64-msvc': 14.2.3
|
||||
'@playwright/test': 1.36.2
|
||||
'@playwright/test': 1.47.0
|
||||
sass: 1.75.0
|
||||
transitivePeerDependencies:
|
||||
- '@babel/core'
|
||||
|
@ -9308,7 +9309,13 @@ snapshots:
|
|||
dependencies:
|
||||
find-up: 4.1.0
|
||||
|
||||
playwright-core@1.36.2: {}
|
||||
playwright-core@1.47.0: {}
|
||||
|
||||
playwright@1.47.0:
|
||||
dependencies:
|
||||
playwright-core: 1.47.0
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.2
|
||||
|
||||
possible-typed-array-names@1.0.0: {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue