Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Wingysam committed Jan 25, 2025
1 parent 2e079f3 commit 61574ca
Show file tree
Hide file tree
Showing 59 changed files with 2,154 additions and 1,489 deletions.
33 changes: 0 additions & 33 deletions .eslintrc.cjs

This file was deleted.

28 changes: 14 additions & 14 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
on:
push:
branches:
- master
push:
branches:
- master

jobs:
contrib-readme-job:
runs-on: ubuntu-latest
name: Update README contributors
if: github.repository_owner == 'Wingysam'
steps:
- name: Update contributor list
uses: akhilmhdh/[email protected]
with:
use_username: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
contrib-readme-job:
runs-on: ubuntu-latest
name: Update README contributors
if: github.repository_owner == 'Wingysam'
steps:
- name: Update contributor list
uses: akhilmhdh/[email protected]
with:
use_username: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 changes: 29 additions & 29 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: Publish image
on:
push:
tags:
tags:
- '*'

jobs:
publish-app:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.DOCKERHUB_USERNAME }}/christmas-community
context: git
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.DOCKERHUB_USERNAME }}/christmas-community
context: git
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
30 changes: 15 additions & 15 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ jobs:
version-app:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN_ACTION }}
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN_ACTION }}

- name: Bump version and push tag
id: changelog
uses: TriPSs/conventional-changelog-action@v6
with:
github-token: "${{ secrets.GH_TOKEN_ACTION }}"
git-user-name: "github-actions[bot]"
git-user-email: "github-actions[bot]@users.noreply.github.com"
preset: "conventionalcommits"
output-file: false
# skip-on-empty: false # good for testing
skip-ci: false
- name: Bump version and push tag
id: changelog
uses: TriPSs/conventional-changelog-action@v6
with:
github-token: '${{ secrets.GH_TOKEN_ACTION }}'
git-user-name: 'github-actions[bot]'
git-user-email: 'github-actions[bot]@users.noreply.github.com'
preset: 'conventionalcommits'
output-file: false
# skip-on-empty: false # good for testing
skip-ci: false
3 changes: 1 addition & 2 deletions .eslintignore → .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
src/static/libraries
built
.eslintrc.cjs
chart
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"semi": false
}
6 changes: 2 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/built/index.js",
"env": {
"PORT": "3000"
}
}
]
}
}
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Christmas Community

![Docker Pulls](https://img.shields.io/docker/pulls/wingysam/christmas-community?style=for-the-badge)
![Version](https://img.shields.io/badge/dynamic/json?color=orange&label=Version&query=version&url=https%3A%2F%2Fraw.githubusercontent.com%2FWingysam%2FChristmas-Community%2Fmaster%2Fpackage.json&style=for-the-badge)
![Language](https://img.shields.io/badge/Language-JavaScript-DDA000?style=for-the-badge)
Expand All @@ -8,29 +9,35 @@
Web app for your family's Christmas shopping

## Purpose

To create a simple place for your entire family to use to find gifts that people want, and to avoid double-gifting.

## [Discord Server](https://discord.gg/Dxjh68gFzV)

To discuss the use and development of Christmas Community, you can join the Discord server at [discord.gg/Dxjh68gFzV](https://discord.gg/Dxjh68gFzV). This is also a good place to get announcements of new updates.

## Screenshots

![Screenshot](screenshots/main.png)
![Screenshot](screenshots/list.png)
![Screenshot](screenshots/link-not-required.png)
![Screenshot](screenshots/name-from-link.png)

## Root URL

If you want put Christmas Community on a subdirectory, such as `/christmas-community`, set `ROOT_URL` to that path. For legacy reasons, `ROOT_PATH` also does this. `ROOT_URL` takes precedence over `ROOT_PATH`.

## Docker

```
docker run --detach --name christmas-community -p 80:80 --restart always wingysam/christmas-community
```

## Docker Compose

```yml
---
version: "3"
version: '3'
services:
christmas-community:
image: wingysam/christmas-community
Expand All @@ -55,6 +62,7 @@ services:
```
## Unraid
Unraid users can install Christmas Community by searching for "Christmas Community" in the Community Apps store and installing it from grtgbln's repository. Note that this is an unofficial distribution not controlled by the maintainer of Christmas Community.
## Install
Expand All @@ -66,7 +74,9 @@ npm install
```

## Configuration

Add environment variables with a .env. Example:

```sh
## Core Settings
# Where to store databases, can be a CouchDB compatible server or directory.
Expand Down Expand Up @@ -135,7 +145,7 @@ MARKDOWN=false
# GOOGLE_CLIENT_SECRET=

## OIDC Provider Details
# You can configure single sign-on to your Christmas Community instance using any OIDC provider.
# You can configure single sign-on to your Christmas Community instance using any OIDC provider.
# Once you've created a client ID and secret in your authentication provider use the below environment variables to enable single sign on.
# OIDC_CLIENT_ID=
# OIDC_CLIENT_SECRET=
Expand All @@ -150,25 +160,31 @@ UPLOAD_PFP_MAX_SIZE=5
```

## Default Profile Pictures

To replace the default snowman profile pictures, replace the files in `static/img/default-pfps`. In docker, mount `/usr/src/app/src/static/img/default-pfps`.

## Startup

```sh
npm start
```

## Setup

Visit `/` on the HTTP server to add an admin account.

## Adding Sites

Christmas Community gets data about products automatically with [Wingysam/get-product-data](https://github.com/Wingysam/get-product-data). Please submit pull requests for new sites or fixes for changes to existing sites!

## Groups

Christmas Community does not yet support having multiple families in one instance. This is a planned feature that will, for example, allow you to have one group for your mom's side of the family and one group for your dad's side of the family, where both groups can access your wishlist but not each others' wishlists. A fork of Christmas Community that has this feature does exist, but most likely will not receive all new features added to the main project. It was not merged into this project because the architecture of Christmas Community prevented implementing it in a maintainable way before some refactoring is done.

[Christmas-Community-Groups](https://github.com/jskiddie/Christmas-Community-Groups)

# About Developer

Hi, I'm Wingy. I made this app. My website is [samwing.dev](https://samwing.dev). Please [hire me](https://wingysam.xyz/hire).

[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C1C2347HB)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ services:
ports:
- 80:80
- 9229:9229
command: node --inspect=0.0.0.0:9229 src/index.js
command: node --inspect=0.0.0.0:9229 src/index.js
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ services:
environment:
NODE_ENV: production
ports:
- 80:80
- 80:80
40 changes: 40 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'

/** @type {import('eslint').Linter.Config[]} */
export default [
{ ignores: ['src/static/libraries/**', 'built/**'] },
{
files: ['**/*.{js,mjs,cjs,ts}'],
},

{
languageOptions: {
globals: { ...globals.browser, ...globals.node, _CC: true },
},
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
},
]
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,17 @@
"yes-no": "^0.0.1"
},
"devDependencies": {
"@eslint/js": "^9.19.0",
"@types/lodash": "^4.14.202",
"@types/node": "^20.10.4",
"@types/node-fetch": "^3.0.2",
"@types/pouchdb": "^6.4.2",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"eslint": "^8.56.0",
"eslint-config-standard-with-typescript": "^43.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.4.0",
"eslint-plugin-promise": "^6.1.1",
"eslint": "^9.19.0",
"globals": "^15.14.0",
"node-jq": "^4.2.2",
"nodemon": "^2.0.12",
"typescript": "^5.3.3"
"prettier": "^3.4.2",
"typescript": "^5.3.3",
"typescript-eslint": "^8.21.0"
}
}
Loading

0 comments on commit 61574ca

Please sign in to comment.