Skip to content

Commit

Permalink
Refactor: update dependencies and fix code (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSamuel authored Feb 6, 2025
1 parent 2895058 commit c18961d
Show file tree
Hide file tree
Showing 14 changed files with 3,447 additions and 4,937 deletions.
35 changes: 35 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
root: true,
env: {
node: true,
mocha: true,
},
overrides: [
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
ecmaVersion: 2020,
sourceType: 'module',
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'linebreak-style': process.env.NODE_ENV === 'production' ? ['error', 'windows'] : ['off', 'windows'],
'@typescript-eslint/no-empty-function': ['error', { allow: ['constructors'] }],
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/await-thenable': 'warn',
'class-methods-use-this': 'off',
},
plugins: [
'import',
],
extends: [
'airbnb-typescript/base',
],
}
],
};
38 changes: 0 additions & 38 deletions .eslintrc.json

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build

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

jobs:
lint-and-build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install Yarn
run: yarn install

- name: Lint code
run: yarn lint

- name: Build code
run: yarn build

docker-build:
runs-on: ubuntu-latest
needs: lint-and-build

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
run: |
docker build -t your-project-name:latest .
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ ENV NODE_ENV=development
WORKDIR /usr/src/custommailcow-ldap

# Copy over the package and package-lock
COPY package*.json .
COPY package.json .
COPY yarn.lock .

# Install dependencies
RUN npm ci
RUN yarn install

# Copy over the tsconfig
COPY tsconfig.json .
Expand All @@ -31,7 +32,7 @@ WORKDIR /app
COPY package*.json .

# Install production dependencies
RUN npm install --only=production
RUN yarn install --production

# Copy over the template data
COPY templates /app/templates
Expand Down
Loading

0 comments on commit c18961d

Please sign in to comment.