chore: use devenv

This commit is contained in:
Kim, Jimin 2025-01-05 08:57:09 +09:00
parent f3f67f6627
commit e6e036e058
Signed by: pomp
GPG key ID: 2B516173EDD492EB
13 changed files with 224 additions and 72 deletions

3
.envrc Normal file
View file

@ -0,0 +1,3 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="
use devenv

10
.gitignore vendored
View file

@ -5,6 +5,16 @@ build
vite.config.js.timestamp-* vite.config.js.timestamp-*
vite.config.ts.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 # Created by https://www.toptal.com/developers/gitignore/api/node,macos,turbo
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,turbo # Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,turbo

View file

@ -11,6 +11,9 @@
"redhat.vscode-xml", "redhat.vscode-xml",
"github.vscode-github-actions", "github.vscode-github-actions",
"foxundermoon.shell-format", "foxundermoon.shell-format",
"editorconfig.editorconfig" "editorconfig.editorconfig",
"redhat.vscode-yaml",
"jnoortheen.nix-ide",
"mkhl.direnv"
] ]
} }

10
.vscode/settings.json vendored
View file

@ -18,6 +18,8 @@
"deno", "deno",
"developomp", "developomp",
"developomp's", "developomp's",
"devenv",
"direnv",
"dompurify", "dompurify",
"elasticlunr", "elasticlunr",
"Exyle", "Exyle",
@ -43,6 +45,7 @@
"Librewolf", "Librewolf",
"mhchem", "mhchem",
"microflash", "microflash",
"nixpkgs",
"nodedotjs", "nodedotjs",
"nojs", "nojs",
"noopener", "noopener",
@ -75,6 +78,10 @@
"zustand" "zustand"
], ],
"nix.formatterPath": "nixfmt",
"nix.enableLanguageServer": true,
"nix.serverPath": "nixd",
"eslint.workingDirectories": [{ "mode": "auto" }], "eslint.workingDirectories": [{ "mode": "auto" }],
"eslint.validate": ["javascript", "typescript", "svelte"], "eslint.validate": ["javascript", "typescript", "svelte"],
@ -118,5 +125,8 @@
}, },
"[markdown]": { "[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[nix]": {
"editor.defaultFormatter": "jnoortheen.nix-ide"
} }
} }

View file

@ -1,60 +1,39 @@
# Contribution Guide # Contribution Guide
## Project Structure ## Project overview
- `apps` This project is largely managed by the following tools:
- `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
## 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:** You need at least basic level understanding of the tools above to effectively work on this project.
>
> - 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).
1. Clone this git repository ## Setting up
2. Install the following
- [NodeJS](https://nodejs.org) 1. Install the following
- [pnpm](https://pnpm.io/installation) - [devenv](https://devenv.sh/getting-started)
3. Install Dependencies - [direnv](https://direnv.net/docs/installation.html)
``` 2. Clone this git repository
pnpm install 3. Start coding!
```
4. Setup husky ## Building
```
pnpm husky install must build the dependencies first
```
5. Run whatever command you need either in project root or in individual packages ```
- `pnpm build` - Build all apps and packages pnpm build
- `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`.
## Testing ## Testing
1. Build site 1. Run E2E Tests
```
pnpm build
```
2. Run E2E Tests
``` ```
pnpm test:e2e pnpm test:e2e
``` ```
3. Benchmark deployed sites using the following services: 2. Benchmark deployed sites using the following services:
- https://seoptimer.com - https://seoptimer.com
- https://gtmetrix.com - https://gtmetrix.com

View file

@ -14,6 +14,7 @@ A collection of "pomp-branded" websites.
## Tech Stack ## Tech Stack
![devenv](https://img.shields.io/badge/devenv-222?style=for-the-badge)
![pnpm](https://img.shields.io/badge/pnpm-222?style=for-the-badge&logo=pnpm) ![pnpm](https://img.shields.io/badge/pnpm-222?style=for-the-badge&logo=pnpm)
![turborepo](https://img.shields.io/badge/turborepo-222?style=for-the-badge&logo=turborepo) ![turborepo](https://img.shields.io/badge/turborepo-222?style=for-the-badge&logo=turborepo)
![Typescript](https://img.shields.io/badge/typescript-222?style=for-the-badge&logo=typescript) ![Typescript](https://img.shields.io/badge/typescript-222?style=for-the-badge&logo=typescript)

View file

@ -23,7 +23,7 @@
"@fortawesome/free-solid-svg-icons": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.0", "@fortawesome/react-fontawesome": "^0.2.0",
"@kunukn/react-collapse": "^3.0.14", "@kunukn/react-collapse": "^3.0.14",
"@playwright/test": "^1.36.2", "@playwright/test": "1.47.0",
"@types/highlight.js": "^10.1.0", "@types/highlight.js": "^10.1.0",
"@types/katex": "^0.16.7", "@types/katex": "^0.16.7",
"@types/node": "^20.10.5", "@types/node": "^20.10.5",

View file

@ -19,7 +19,7 @@
"@developomp-site/tailwind-config": "workspace:*", "@developomp-site/tailwind-config": "workspace:*",
"@fontsource/noto-sans-kr": "^5.0.5", "@fontsource/noto-sans-kr": "^5.0.5",
"@inqling/svelte-icons": "^3.5.0", "@inqling/svelte-icons": "^3.5.0",
"@playwright/test": "^1.36.2", "@playwright/test": "1.47.0",
"@sveltejs/adapter-static": "^3.0.5", "@sveltejs/adapter-static": "^3.0.5",
"@sveltejs/kit": "^2.5.7", "@sveltejs/kit": "^2.5.7",
"@sveltejs/vite-plugin-svelte": "^3.1.0", "@sveltejs/vite-plugin-svelte": "^3.1.0",

100
devenv.lock Normal file
View 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
View 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
View 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

View file

@ -1,8 +1,9 @@
{ {
"name": "@developomp-site/playwright-config", "name": "@developomp-site/playwright-config",
"version": "0.0.0", "version": "0.0.0",
"type": "module",
"main": "index.ts", "main": "index.ts",
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.36.2" "@playwright/test": "1.47.0"
} }
} }

57
pnpm-lock.yaml generated
View file

@ -72,8 +72,8 @@ importers:
specifier: ^3.0.14 specifier: ^3.0.14
version: 3.0.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1) version: 3.0.14(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@playwright/test': '@playwright/test':
specifier: ^1.36.2 specifier: 1.47.0
version: 1.36.2 version: 1.47.0
'@types/highlight.js': '@types/highlight.js':
specifier: ^10.1.0 specifier: ^10.1.0
version: 10.1.0 version: 10.1.0
@ -118,10 +118,10 @@ importers:
version: 0.16.10 version: 0.16.10
next: next:
specifier: ^14.2.3 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: next-sitemap:
specifier: ^4.2.3 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: open-cli:
specifier: ^8.0.0 specifier: ^8.0.0
version: 8.0.0 version: 8.0.0
@ -177,8 +177,8 @@ importers:
specifier: ^3.5.0 specifier: ^3.5.0
version: 3.5.0(svelte@4.2.15) version: 3.5.0(svelte@4.2.15)
'@playwright/test': '@playwright/test':
specifier: ^1.36.2 specifier: 1.47.0
version: 1.36.2 version: 1.47.0
'@sveltejs/adapter-static': '@sveltejs/adapter-static':
specifier: ^3.0.5 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))) 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: packages/playwright-config:
devDependencies: devDependencies:
'@playwright/test': '@playwright/test':
specifier: ^1.36.2 specifier: 1.47.0
version: 1.36.2 version: 1.47.0
packages/prettier-config: {} packages/prettier-config: {}
@ -1225,10 +1225,9 @@ packages:
resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==}
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
'@playwright/test@1.36.2': '@playwright/test@1.47.0':
resolution: {integrity: sha512-2rVZeyPRjxfPH6J0oGJqE8YxiM1IBRyM8hyrXYK7eSiAqmbNhxwcLa7dZ7fy9Kj26V7FYia5fh9XJRq4Dqme+g==} resolution: {integrity: sha512-SgAdlSwYVpToI4e/IH19IHHWvoijAYH5hu2MWSXptRypLSnzj51PcGD+rsOXFayde4P9ZLi+loXVwArg6IUkCA==}
engines: {node: '>=16'} engines: {node: '>=18'}
deprecated: Please update to the latest version of Playwright to test up-to-date browsers.
hasBin: true hasBin: true
'@polka/url@1.0.0-next.24': '@polka/url@1.0.0-next.24':
@ -3887,9 +3886,14 @@ packages:
resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
playwright-core@1.36.2: playwright-core@1.47.0:
resolution: {integrity: sha512-sQYZt31dwkqxOrP7xy2ggDfEzUxM1lodjhsQ3NMMv5uGTRDsLxU0e4xf4wwMkF2gplIxf17QMBCodSFgm6bFVQ==} resolution: {integrity: sha512-1DyHT8OqkcfCkYUD9zzUTfg7EfTd+6a8MkD/NWOvjo0u/SCNd5YmY/lJwFvUZOxJbWNds+ei7ic2+R/cRz/PDg==}
engines: {node: '>=16'} engines: {node: '>=18'}
hasBin: true
playwright@1.47.0:
resolution: {integrity: sha512-jOWiRq2pdNAX/mwLiwFYnPHpEZ4rM+fRSQpRHwEwZlP2PUANvL3+aJOF/bvISMhFD30rqMxUB4RJx9aQbfh4Ww==}
engines: {node: '>=18'}
hasBin: true hasBin: true
possible-typed-array-names@1.0.0: possible-typed-array-names@1.0.0:
@ -5933,12 +5937,9 @@ snapshots:
'@pkgr/core@0.1.1': {} '@pkgr/core@0.1.1': {}
'@playwright/test@1.36.2': '@playwright/test@1.47.0':
dependencies: dependencies:
'@types/node': 20.10.5 playwright: 1.47.0
playwright-core: 1.36.2
optionalDependencies:
fsevents: 2.3.2
'@polka/url@1.0.0-next.24': {} '@polka/url@1.0.0-next.24': {}
@ -9065,15 +9066,15 @@ snapshots:
natural-compare@1.4.0: {} 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: dependencies:
'@corex/deepmerge': 4.0.43 '@corex/deepmerge': 4.0.43
'@next/env': 13.4.12 '@next/env': 13.4.12
fast-glob: 3.3.1 fast-glob: 3.3.1
minimist: 1.2.8 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: dependencies:
'@next/env': 14.2.3 '@next/env': 14.2.3
'@swc/helpers': 0.5.5 '@swc/helpers': 0.5.5
@ -9094,7 +9095,7 @@ snapshots:
'@next/swc-win32-arm64-msvc': 14.2.3 '@next/swc-win32-arm64-msvc': 14.2.3
'@next/swc-win32-ia32-msvc': 14.2.3 '@next/swc-win32-ia32-msvc': 14.2.3
'@next/swc-win32-x64-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 sass: 1.75.0
transitivePeerDependencies: transitivePeerDependencies:
- '@babel/core' - '@babel/core'
@ -9308,7 +9309,13 @@ snapshots:
dependencies: dependencies:
find-up: 4.1.0 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: {} possible-typed-array-names@1.0.0: {}