Skip to content

Commit 502c855

Browse files
committed
initial commit
0 parents  commit 502c855

17 files changed

+12599
-0
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
dist/
3+
coverage/
4+
*.d.ts

.eslintrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"es2022": true
5+
},
6+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"ecmaVersion": "latest",
10+
"sourceType": "module"
11+
},
12+
"plugins": ["@typescript-eslint"],
13+
"rules": {
14+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
15+
"@typescript-eslint/no-explicit-any": "warn",
16+
"@typescript-eslint/explicit-function-return-type": "off",
17+
"@typescript-eslint/explicit-module-boundary-types": "off",
18+
"no-console": "warn"
19+
}
20+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2
7+
}

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# 📰 opencollective-rss
2+
3+
A lightweight TypeScript service to generate RSS feeds for updates from any [Open Collective](https://opencollective.com) account, using GraphQL and Hono.
4+
5+
## ✨ Features
6+
7+
- ⚡ Fast and modern HTTP server using [Hono](https://hono.dev)
8+
- 🔒 Fully type-safe thanks to [GraphQL Code Generator](https://www.graphql-code-generator.com/)
9+
- 🧼 Linted and formatted with ESLint + Prettier
10+
- ✅ Tested with Vitest
11+
- 📡 RSS feed generation using [`rss`](https://www.npmjs.com/package/rss)
12+
- 📦 Deployable to any Node/Edge platform (Cloudflare Workers, Vercel, etc.)
13+
14+
## 🧪 Endpoint
15+
16+
- **GET** `/[accountSlug]/updates.rss`
17+
18+
Example:
19+
`/babel/updates.rss`
20+
21+
Returns an RSS feed of the latest updates from the given Open Collective account.
22+
23+
## 📦 Scripts
24+
25+
```bash
26+
# Start dev server
27+
npm run dev
28+
29+
# Type check
30+
npm run build
31+
32+
# Lint and format
33+
npm run lint
34+
npm run format
35+
36+
# Run tests
37+
npm run test
38+
39+
# Generate types and SDK from GraphQL schema
40+
npm run codegen
41+
```
42+
43+
## Resources
44+
45+
- [Open Collective GraphQL API](https://graphql-docs-v2.opencollective.com/access)

codegen.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { CodegenConfig } from '@graphql-codegen/cli';
2+
3+
const config: CodegenConfig = {
4+
schema: 'https://api.opencollective.com/graphql',
5+
documents: ['src/services/*.ts'],
6+
generates: {
7+
'./src/types/graphql.ts': {
8+
plugins: ['typescript', 'typescript-operations'],
9+
config: {
10+
skipTypename: true,
11+
dedupeFragments: true,
12+
onlyOperationTypes: true,
13+
avoidOptionals: true,
14+
enumsAsTypes: true,
15+
scalars: {
16+
DateTime: 'string',
17+
JSON: 'Record<string, any>',
18+
JSONObject: 'Record<string, any>',
19+
},
20+
},
21+
},
22+
},
23+
};
24+
25+
export default config;

0 commit comments

Comments
 (0)