Skip to content

Commit

Permalink
chore: WIP: replace eslint with biome, roll back some typescript defi…
Browse files Browse the repository at this point in the history
…nitions
  • Loading branch information
Ardakilic committed Oct 14, 2024
1 parent 1e4fa91 commit bd6030c
Show file tree
Hide file tree
Showing 22 changed files with 1,834 additions and 4,153 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ node_modules/

package-lock.json
*.md
.eslintrc
.gitignore
.editorconfig
.dockerignore
Expand Down
24 changes: 0 additions & 24 deletions .eslintrc

This file was deleted.

83 changes: 78 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
Expand All @@ -16,11 +21,12 @@ lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
Expand All @@ -29,22 +35,34 @@ bower_components
# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

Expand All @@ -54,8 +72,63 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*


# App-spesific
etc/config.js
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [2.3.0] - 2024-10-14
### Changed
- Various TypeScript modifications rolled back
- Linter changed to Biome

## [2.2.2] - 2022-09-25
### Fixed
- [#58](https://github.com/Ardakilic/alerthub/issues/57) Fixed broken RSS functionality.

## [2.2.1] - 2022-09-25
### Fixed
- [#58](https://github.com/Ardakilic/alerthub/issues/57) Fixed broken RSS functionality.

## [2.2.0] - 2022-09-24
### Changed
- [#57](https://github.com/Ardakilic/alerthub/issues/57) Switched to ES6 imports / Exports.

## [2.1.4] - 2021-01-07
### Fixed
- [#51](https://github.com/Ardakilic/alerthub/issues/51) should be fixed.
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install npm packages
FROM node:18-alpine as builder
FROM node:20 as builder

WORKDIR /usr/src/app

Expand All @@ -8,18 +8,18 @@ COPY package.json .
RUN yarn install --prod

# Push js files
FROM node:18-alpine
FROM node:20-slim

WORKDIR /usr/src/app

LABEL maintainer="Kaan Karakaya <[email protected]>"

COPY --from=builder /usr/src/app/ /usr/src/app/

COPY ./src ./src

COPY ./package.json ./package.json

COPY ./etc ./etc
COPY ./etc/config.js ./etc/config.js

EXPOSE 3444

CMD ["node", "src/index.mjs"]
CMD ["node", "src/index.js"]
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ You can install and run AlertHub with some simple steps:
## Docker Container

First, you need to get the example config file and modify it accordingly, either get a copy from [this repo](./etc/config.example.js), or with the following command:
```

```bash
docker run --rm ghcr.io/ardakilic/alerthub:2 cat /usr/src/app/etc/config.example.js > /host/path/config.js
```

To run

```
```bash
docker run --name alerthub -d -v /host/path/config.js:/usr/src/app/etc/config.js -p 3444:3444 ghcr.io/ardakilic/alerthub:2
```

Expand All @@ -76,6 +77,7 @@ Please refer to [UPGRADING.md](./UPGRADING.md).
## TODOs / Plans

* A portable storage solution such as SQLite etc.
* ~~Telegram Notifications~~
* ~~Following GitLab releases~~
* Following BitBucket releases
* Multi user feature
Expand Down
2 changes: 2 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Upgrading Guide



## 2.1.0 to 2.2.0
- Stop the aplication
- Get the updates by pulling changes
Expand Down
36 changes: 36 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"ignore": [],
"attributePosition": "auto",
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"lineEnding": "lf"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
9 changes: 8 additions & 1 deletion etc/config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
* Provide your GitHub token below to bypass the rate limit
* and to get notified from private repositories
*/
githubToken: null,
// githubToken: null,
notifications: {
pushbullet: {
enabled: false,
Expand Down Expand Up @@ -35,6 +35,13 @@ module.exports = {
subjectPrefix: 'New GitHub Release', // Subject prefix
},
},
telegram: {
enabled: false,
config: {
token: 'TELEGRAM_TOKEN',
chatId: 'CHAT_ID',
},
},
},
rss: {
enabled: true,
Expand Down
Loading

0 comments on commit bd6030c

Please sign in to comment.