Skip to content

Commit 0dc3dcf

Browse files
committed
Format code with prettier
1 parent 9f878d2 commit 0dc3dcf

370 files changed

Lines changed: 37453 additions & 10776 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
github: electerious
2-
custom: ['https://paypal.me/electerious', 'https://www.buymeacoffee.com/electerious']
2+
custom: ['https://paypal.me/electerious', 'https://www.buymeacoffee.com/electerious']

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name: 🐛 Bug report
33
about: Create a report to help us improve
44
labels: bug
5-
65
---
76

87
**🐞 Describe the bug**
@@ -22,8 +21,9 @@ A clear and concise description of what you expected to happen.
2221
If applicable, add screenshots to help explain your problem.
2322

2423
**⚙️ Environment**
25-
- Installation: [e.g. Docker/Docker-Compose/Netlify/Vercel/Manually]
26-
- Ackee version: [e.g. v2.1.0]
24+
25+
- Installation: [e.g. Docker/Docker-Compose/Netlify/Vercel/Manually]
26+
- Ackee version: [e.g. v2.1.0]
2727

2828
**📋 Additional context**
2929

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
contact_links:
22
- name: 📚 Ackee Docs
33
url: https://docs.ackee.electerious.com/
4-
about: Checkout Ackee's Documentation before you open an issue.
4+
about: Checkout Ackee's Documentation before you open an issue.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name: 🚀 Feature request
33
about: Suggest an idea for this project
44
labels: feature request
5-
65
---
76

87
**🐣 Is your feature request related to a problem? Please describe.**

api/index.js

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
'use strict'
2-
3-
const handler = require('../src/serverless').handler
1+
import * as serverless from '../src/serverless.js'
42

53
/**
64
* A serverless function handler for the '/api' route, for use with Vercel.
75
* This handler follows the AWS Lambda API; Vercel deployments are opted-in
86
* using the "NODEJS_AWS_HANDLER_NAME" environment variable defined in vercel.json.
97
*
108
* See:
11-
* - https://vercel.com/docs/serverless-functions/supported-languages#node.js
12-
* - https://vercel.com/docs/runtimes#advanced-usage/advanced-node-js-usage/aws-lambda-api
9+
* - https://vercel.com/docs/serverless-functions/supported-languages#node.js
10+
* - https://vercel.com/docs/runtimes#advanced-usage/advanced-node-js-usage/aws-lambda-api
11+
*
12+
* @param {...any} args - The arguments passed by Vercel to the handler, following the AWS Lambda API.
13+
* @returns {Promise<any>} - The response from the serverless handler, with multiValueHeaders converted to headers for Vercel compatibility.
1314
*/
14-
exports.handler = async (...args) => {
15-
const response = await handler(...args)
16-
return convertMultiValueHeaders(response)
15+
export const handler = async (...args) => {
16+
const response = await serverless.handler(...args)
17+
return convertMultiValueHeaders(response)
1718
}
1819

1920
/*
@@ -22,17 +23,17 @@ exports.handler = async (...args) => {
2223
* Since all the headers we commonly attach have a single value, we can map them to .headers instead.
2324
*/
2425
const convertMultiValueHeaders = (response) => {
25-
if (response?.multiValueHeaders == null) return response
26+
if (response?.multiValueHeaders == null) return response
2627

27-
response.headers = response.headers ?? {}
28+
response.headers = response.headers ?? {}
2829

29-
for (const [ key, value ] of Object.entries(response.multiValueHeaders)) {
30-
if (value.length === 1) {
31-
response.headers[key] = value[0]
32-
} else {
33-
console.warn(`multiValueHeaders is currently unsupported on Vercel. Header ${ key } will be ignored.`)
34-
}
35-
}
30+
for (const [key, value] of Object.entries(response.multiValueHeaders)) {
31+
if (value.length === 1) {
32+
response.headers[key] = value[0]
33+
} else {
34+
console.warn(`multiValueHeaders is currently unsupported on Vercel. Header ${key} will be ignored.`)
35+
}
36+
}
3637

37-
return response
38-
}
38+
return response
39+
}

app.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"name": "Ackee",
33
"description": "Self-hosted, Node.js based analytics tool for those who care about privacy",
4-
"keywords": [
5-
"server",
6-
"tracking",
7-
"analytics"
8-
],
4+
"keywords": ["server", "tracking", "analytics"],
95
"website": "https://ackee.electerious.com/",
106
"repository": "https://github.com/electerious/Ackee",
117
"env": {
@@ -38,4 +34,4 @@
3834
"required": false
3935
}
4036
}
41-
}
37+
}

build.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/usr/bin/env node
22
import 'dotenv/config'
33

4+
import { build, index, scripts, styles, tracker } from './src/ui/index.js'
45
import config from './src/utils/config.js'
56
import * as customTracker from './src/utils/customTracker.js'
6-
import { index, styles, scripts, tracker, build } from './src/ui/index.js'
77

88
// Build files that are identical on every installation
99
if (config.isPreBuildMode === true) {
10-
build('dist/index.css', styles)
11-
build('dist/index.js', scripts)
12-
build('dist/tracker.js', tracker)
10+
build('dist/index.css', styles)
11+
build('dist/index.js', scripts)
12+
build('dist/tracker.js', tracker)
1313
}
1414

1515
// Build files that depend on environment variables
1616
build(`dist/index.html`, index)
17-
if (customTracker.exists === true) build(`dist/${ customTracker.path }`, tracker)
17+
if (customTracker.exists === true) build(`dist/${customTracker.path}`, tracker)

dist/index.js

Lines changed: 24600 additions & 76 deletions
Large diffs are not rendered by default.

dist/tracker.js

Lines changed: 1017 additions & 1 deletion
Large diffs are not rendered by default.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
container_name: ackee
55
restart: always
66
ports:
7-
- "3000:3000"
7+
- '3000:3000'
88
environment:
99
- WAIT_HOSTS=mongo:27017
1010
- ACKEE_MONGODB=mongodb://mongo:27017/ackee

0 commit comments

Comments
 (0)