-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from valon-loshaj/bugfix/pipelines
pipeline updates
- Loading branch information
Showing
16 changed files
with
1,671 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
description: Prepares the repo for a typical CI job | ||
|
||
# .github/actions/prepare/action.yml | ||
name: Prepare | ||
description: Prepares the repo for a typical CI job | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: pnpm | ||
node-version: "20" | ||
- run: pnpm install --frozen-lockfile | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
using: composite | ||
run: | | ||
pnpm install --no-frozen-lockfile | ||
pnpm add -Dw eslint-plugin-n eslint-config-prettier @eslint/eslintrc eslint-import-resolver-typescript eslint-plugin-import knip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
// Example file to ensure ESLint has something to check | ||
export const hello = () => { | ||
return "Hello from backend"; | ||
}; | ||
// apps/backend/src/index.ts | ||
import app from "./app"; | ||
import { createServer } from "./server"; | ||
|
||
const server = createServer(app); | ||
|
||
export { server }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
import app from "./app"; | ||
// apps/backend/src/server.ts | ||
import { Server } from "http"; | ||
import express from "express"; | ||
import type { Express } from "express"; | ||
|
||
const port = process.env.PORT || 3001; | ||
export function createServer(app: Express): Server { | ||
return app.listen(process.env.PORT || 3001, () => { | ||
console.log(`Server running on port ${process.env.PORT || 3001}`); | ||
}); | ||
} | ||
|
||
app.listen(port, () => { | ||
console.log(`Server running on port ${port}`); | ||
}); | ||
export type { Express, Server }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// apps/frontend/src/global.d.ts | ||
declare module "*.module.css" { | ||
const classes: { [key: string]: string }; | ||
export default classes; | ||
} | ||
|
||
declare module "*.css" { | ||
const content: { [key: string]: string }; | ||
export default content; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"target": "es2020", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"noEmit": true, | ||
"noEmit": false, | ||
"esModuleInterop": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"moduleResolution": "bundler", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"incremental": true | ||
"jsx": "react-jsx", | ||
"incremental": true, | ||
"tsBuildInfoFile": "./.tsbuildinfo", | ||
"plugins": [ | ||
{ | ||
"name": "next" | ||
} | ||
], | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
} | ||
}, | ||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], | ||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "global.d.ts"], | ||
"exclude": ["node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,56 @@ | ||
import eslint from "@eslint/js"; | ||
import vitest from "@vitest/eslint-plugin"; | ||
import n from "eslint-plugin-n"; | ||
// eslint.config.js | ||
import js from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
import prettier from "eslint-config-prettier"; | ||
import eslintConfigPrettier from "eslint-config-prettier"; | ||
import eslintPluginN from "eslint-plugin-n"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
}); | ||
|
||
export default tseslint.config( | ||
js.configs.recommended, | ||
...tseslint.configs.recommended, | ||
{ | ||
ignores: [ | ||
"coverage*", | ||
"lib", | ||
"node_modules", | ||
"pnpm-lock.yaml", | ||
"**/*.snap", | ||
], | ||
}, | ||
{ | ||
linterOptions: { | ||
reportUnusedDisableDirectives: "error", | ||
plugins: { | ||
n: eslintPluginN, | ||
}, | ||
rules: { | ||
"n/no-missing-import": "error", | ||
}, | ||
}, | ||
eslint.configs.recommended, | ||
n.configs["flat/recommended"], | ||
...tseslint.config({ | ||
extends: tseslint.configs.recommendedTypeChecked, | ||
files: ["**/*.js", "**/*.ts"], | ||
languageOptions: { | ||
parserOptions: { | ||
projectService: { | ||
allowDefaultProject: ["*.*s", "eslint.config.js"], | ||
defaultProject: "./tsconfig.json", | ||
prettier, | ||
...compat.config({ | ||
extends: ["plugin:import/typescript"], | ||
settings: { | ||
"import/resolver": { | ||
typescript: { | ||
project: ["./apps/*/tsconfig.json"], | ||
}, | ||
tsconfigRootDir: import.meta.dirname, | ||
node: true, | ||
}, | ||
}, | ||
rules: { | ||
// These on-by-default rules don't work well for this repo and we like them off. | ||
"no-constant-condition": "off", | ||
|
||
// These on-by-default rules work well for this repo if configured | ||
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "all" }], | ||
}, | ||
}), | ||
eslintConfigPrettier, | ||
{ | ||
files: ["*.jsonc"], | ||
rules: { | ||
"jsonc/comma-dangle": "off", | ||
"jsonc/no-comments": "off", | ||
"jsonc/sort-keys": "error", | ||
}, | ||
}, | ||
{ | ||
extends: [tseslint.configs.disableTypeChecked], | ||
files: ["**/*.md/*.ts"], | ||
rules: { | ||
"n/no-missing-import": ["error", { allowModules: ["side-quest"] }], | ||
}, | ||
}, | ||
{ | ||
files: ["**/*.test.*"], | ||
ignores: ["**/dist/**", "**/node_modules/**", "**/.next/**"], | ||
languageOptions: { | ||
globals: vitest.environments.env.globals, | ||
parserOptions: { | ||
project: ["./tsconfig.json", "./apps/*/tsconfig.json"], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}, | ||
plugins: { vitest }, | ||
rules: { | ||
...vitest.configs.recommended.rules, | ||
|
||
// These on-by-default rules aren't useful in test files. | ||
"@typescript-eslint/no-unsafe-assignment": "off", | ||
"@typescript-eslint/no-unsafe-call": "off", | ||
"n/no-missing-import": "error", | ||
"@typescript-eslint/no-unsafe-argument": "error", | ||
"@typescript-eslint/no-unsafe-assignment": "error", | ||
"@typescript-eslint/no-unsafe-call": "error", | ||
"import/no-unresolved": "error", | ||
}, | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"$schema": "https://unpkg.com/knip@latest/schema.json", | ||
"entry": ["src/index.ts!"], | ||
"ignoreExportsUsedInFile": { "interface": true, "type": true }, | ||
"project": ["src/**/*.ts!"] | ||
"entry": ["apps/backend/src/index.ts", "apps/frontend/src/index.ts"], | ||
"project": ["apps/**/*.{ts,tsx}"], | ||
"ignore": ["**/dist/**", "**/node_modules/**", "**/*.test.ts"], | ||
"ignoreDependencies": ["typescript"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.