core(ci/husky): Added husky and CI Jobs
* core(package): adding rules in package * feat(husky): Fixed lint job and miscellaneous fixes - Changed lint.yml job name - Fixed pnpm version in package.json to be straight version 10 - Added act in flake.nix to run actions locally - Added all dist/ files to eslint ignored files - Fixed Dockerfile to use correct casing (as -> AS)
This commit is contained in:
parent
ff0e218803
commit
8e4081f494
11 changed files with 113 additions and 15 deletions
37
.github/workflows/build.yml
vendored
Normal file
37
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '22'
|
||||||
|
- name: Setup pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 10
|
||||||
|
run_install: false
|
||||||
|
- name: Install dependencies with pnpm
|
||||||
|
working-directory: ./src
|
||||||
|
run: pnpm install
|
||||||
|
- name: Build
|
||||||
|
working-directory: ./src
|
||||||
|
run: pnpm run build
|
||||||
|
|
||||||
10
.github/workflows/lint.yml
vendored
10
.github/workflows/lint.yml
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
name: Build & Linter
|
name: Linter
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
@ -12,8 +12,8 @@ permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
linter:
|
||||||
name: Build & Typecheck
|
name: Linter
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -34,7 +34,3 @@ jobs:
|
||||||
- name: Check linting
|
- name: Check linting
|
||||||
working-directory: ./src
|
working-directory: ./src
|
||||||
run: pnpm exec eslint . --max-warnings=0
|
run: pnpm exec eslint . --max-warnings=0
|
||||||
- name: Build
|
|
||||||
working-directory: ./src
|
|
||||||
run: pnpm run build
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
pnpm --prefix=./src/ lint-staged
|
pnpm lint-staged
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@
|
||||||
sqlite-interactive
|
sqlite-interactive
|
||||||
clang
|
clang
|
||||||
tmux-setup
|
tmux-setup
|
||||||
|
act
|
||||||
];
|
];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export PODMAN_COMPOSE_WARNING_LOGS="false";
|
export PODMAN_COMPOSE_WARNING_LOGS="false";
|
||||||
|
|
|
||||||
32
package-lock.json
generated
Normal file
32
package-lock.json
generated
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"name": "trans",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "trans",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"license": "ISC",
|
||||||
|
"devDependencies": {
|
||||||
|
"husky": "^9.1.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/husky": {
|
||||||
|
"version": "9.1.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz",
|
||||||
|
"integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"husky": "bin.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/typicode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
package.json
Normal file
21
package.json
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"name": "trans",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "",
|
||||||
|
"lint-staged": {
|
||||||
|
"*.{js,ts,jsx,tsx}": [
|
||||||
|
"eslint --fix"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"dev:prepare": "husky"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"packageManager": "pnpm@10",
|
||||||
|
"devDependencies": {
|
||||||
|
"husky": "^9.1.7"
|
||||||
|
}
|
||||||
|
}
|
||||||
10
pnpm-workspace.yaml
Normal file
10
pnpm-workspace.yaml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
packages:
|
||||||
|
- ./src/*
|
||||||
|
|
||||||
|
nodeLinker: hoisted
|
||||||
|
|
||||||
|
onlyBuiltDependencies:
|
||||||
|
- better-sqlite3
|
||||||
|
- esbuild
|
||||||
|
- sharp
|
||||||
|
- bcrypt
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
**/node_modules
|
*/node_modules
|
||||||
**/dist
|
*/dist
|
||||||
**/Dockerfile
|
*/Dockerfile
|
||||||
.gitkeep
|
.gitkeep
|
||||||
.dockerignore
|
.dockerignore
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
FROM node:22-alpine as pnpm_base
|
FROM node:22-alpine AS pnpm_base
|
||||||
RUN npm install --global pnpm@10.14.0;
|
RUN npm install --global pnpm@10.14.0;
|
||||||
|
|
||||||
FROM pnpm_base as builder
|
FROM pnpm_base AS builder
|
||||||
|
|
||||||
ARG SERVICE
|
ARG SERVICE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
import js from '@eslint/js';
|
import js from '@eslint/js';
|
||||||
|
import { globalIgnores } from 'eslint/config';
|
||||||
import ts from 'typescript-eslint';
|
import ts from 'typescript-eslint';
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
|
globalIgnores(['*/dist/'], 'dist files'),
|
||||||
js.configs.recommended,
|
js.configs.recommended,
|
||||||
...ts.configs.recommended,
|
...ts.configs.recommended,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run build --workspaces --if-present",
|
"build": "npm run build --workspaces --if-present",
|
||||||
"fclean": "rimraf \"**/dist\"",
|
"distclean": "rimraf -v -g \"*/dist\"",
|
||||||
"clean": "rimraf \"**/node_modules\"",
|
|
||||||
"install-all": "npm install",
|
"install-all": "npm install",
|
||||||
"dev:prepare": "husky"
|
"dev:prepare": "husky"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue