Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
Expand All @@ -44,8 +42,6 @@ jobs:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint

on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm turbo run lint
45 changes: 5 additions & 40 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,73 +11,38 @@ on:
- main

jobs:
api-unit:
name: API unit tests
unit:
name: Unit tests (API + Web)
runs-on: ubuntu-latest
defaults:
run:
working-directory: api
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: api/pnpm-lock.yaml

- run: pnpm install --frozen-lockfile

- run: pnpm test

web-unit:
name: Web unit tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml

- run: pnpm install --frozen-lockfile

- run: pnpm test
- run: pnpm turbo run test

web-e2e:
name: Web E2E tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml

- run: pnpm install --frozen-lockfile

- run: pnpm exec playwright install --with-deps chromium
- run: pnpm --filter opengalley-web exec playwright install --with-deps chromium

- run: pnpm test:e2e
- run: pnpm turbo run test:e2e --filter=opengalley-web
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dist/
build/
out/
web/dist/
.turbo/

# ── TypeScript ────────────────────────────────────────────────────────────────
*.tsbuildinfo
Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./sync-version.sh
git add api/package.json web/package.json
3 changes: 3 additions & 0 deletions api/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from "@opengalley/eslint-config";

export default config;
6 changes: 4 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opengalley-api",
"version": "0.1.0",
"version": "0.2.0",
"private": true,
"type": "commonjs",
"packageManager": "pnpm@9.15.9",
Expand All @@ -9,14 +9,16 @@
"start": "node dist/index.js",
"dev": "tsx watch src/index.ts",
"test": "vitest run",
"test:watch": "vitest"
"test:watch": "vitest",
"lint": "eslint ."
},
"dependencies": {
"cors": "^2.8.5",
"express": "^4.19.2",
"pg": "^8.12.0"
},
"devDependencies": {
"@opengalley/eslint-config": "workspace:*",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/node": "^20.14.0",
Expand Down
4 changes: 2 additions & 2 deletions api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "ES2021",
"module": "CommonJS",
"moduleResolution": "Node",
"module": "Node16",
"moduleResolution": "Node16",
"outDir": "dist",
"rootDir": "src",
"strict": true,
Expand Down
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "opengalley",
"version": "0.2.0",
"private": true,
"packageManager": "pnpm@9.15.9",
"scripts": {
"prepare": "husky",
"build": "turbo run build",
"test": "turbo run test",
"dev": "turbo run dev",
"lint": "turbo run lint"
},
"devDependencies": {
"eslint": "^9.17.0",
"husky": "^9.1.7",
"turbo": "^2.3.3"
}
}
54 changes: 54 additions & 0 deletions packages/eslint-config/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import globals from "globals";

export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,

{
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
},
},

{
files: ["**/*.js", "**/*.ts"],
rules: {
"max-lines": [
"error",
{
max: 200,
skipBlankLines: true,
skipComments: true,
},
],
},
},

{
files: ["**/*.jsx", "**/*.tsx"],
rules: {
"max-lines": [
"error",
{
max: 400,
skipBlankLines: true,
skipComments: true,
},
],
},
},

{
ignores: ["dist/**", "build/**", "coverage/**"],
},
);
21 changes: 21 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@opengalley/eslint-config",
"version": "0.2.0",
"private": true,
"type": "module",
"main": "./base.js",
"exports": {
".": "./base.js",
"./react": "./react.js"
},
"dependencies": {
"@eslint/js": "^9.17.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.1.0",
"globals": "^15.14.0",
"typescript-eslint": "^8.18.0"
},
"peerDependencies": {
"eslint": "^9.0.0"
}
}
29 changes: 29 additions & 0 deletions packages/eslint-config/react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import globals from "globals";
import base from "./base.js";

export default [
...base,
{
files: ["**/*.{ts,tsx,js,jsx}"],
plugins: {
react,
"react-hooks": reactHooks,
},
languageOptions: {
globals: {
...globals.browser,
},
},
settings: {
react: { version: "detect" },
},
rules: {
...react.configs.recommended.rules,
...react.configs["jsx-runtime"].rules,
...reactHooks.configs.recommended.rules,
"react/prop-types": "off",
},
},
];
Loading
Loading