Skip to content

Commit a314378

Browse files
committed
chore: prettier
1 parent e2e0607 commit a314378

10 files changed

Lines changed: 184 additions & 191 deletions

File tree

.github/workflows/release.yml

Lines changed: 139 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,146 @@
11
name: Create Release
22

33
on:
4-
workflow_dispatch:
5-
push:
6-
tags:
7-
- 'v*'
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
88

99
permissions:
10-
contents: write
10+
contents: write
1111

1212
jobs:
13-
release:
14-
runs-on: ubuntu-latest
15-
16-
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
21-
22-
- name: Get current tag
23-
id: currenttag
24-
run: |
25-
CURRENT_TAG=$(git tag --sort=-version:refname | head -1)
26-
echo "current_tag=$CURRENT_TAG" >> $GITHUB_OUTPUT
27-
echo "Current tag: $CURRENT_TAG"
28-
29-
- name: Get previous tag
30-
id: previoustag
31-
run: |
32-
PREVIOUS_TAG=$(git tag --sort=-version:refname | sed -n '2p')
33-
PREVIOUS_TAG=${PREVIOUS_TAG//+/}
34-
echo "previous_tag=$PREVIOUS_TAG" >> $GITHUB_OUTPUT
35-
echo "Previous tag: $PREVIOUS_TAG"
36-
37-
- name: Generate categorized release notes
38-
id: release_notes
39-
run: |
40-
CURRENT_TAG=${{ steps.currenttag.outputs.current_tag }}
41-
PREVIOUS_TAG=${{ steps.previoustag.outputs.previous_tag }}
42-
43-
echo "Generating release notes from $PREVIOUS_TAG to $CURRENT_TAG"
44-
45-
# Get commit hashes
46-
if [ -z "$PREVIOUS_TAG" ]; then
47-
HASHES=$(git log --pretty=format:"%H" $CURRENT_TAG)
48-
else
49-
HASHES=$(git log --pretty=format:"%H" $PREVIOUS_TAG..$CURRENT_TAG)
50-
fi
51-
52-
# Categorize commits
53-
FEATURES=""
54-
FIXES=""
55-
DOCS=""
56-
CHORES=""
57-
BREAKING=""
58-
OTHERS=""
59-
60-
# Process each commit individually
61-
while read -r hash; do
62-
# Get the full message and short hash separately
63-
message=$(git log --format=%s -n 1 $hash)
64-
short_hash=$(git log --format=%h -n 1 $hash)
65-
66-
# Trim whitespace
67-
message=$(echo "$message" | xargs)
68-
short_hash=$(echo "$short_hash" | xargs)
69-
70-
echo "Processing: '$message' ($short_hash)"
71-
72-
# Extract clean message
73-
clean_message="$message"
74-
if [[ "$message" =~ ^[a-z]+: ]]; then
75-
clean_message="${message#*: }"
76-
fi
77-
78-
case "$message" in
79-
feat:*|feat\(*|feature:*)
80-
FEATURES="${FEATURES}- feat: [${clean_message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
81-
;;
82-
fix:*|fix\(*)
83-
FIXES="${FIXES}- fix: [${clean_message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
84-
;;
85-
docs:*|docs\(*)
86-
DOCS="${DOCS}- docs: [${clean_message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
87-
;;
88-
chore:*|chore\(*|ci:*|ci\(*|build:*|build\(*)
89-
CHORES="${CHORES}- chore: [${clean_message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
90-
;;
91-
*BREAKING*|*breaking*|*!:*)
92-
BREAKING="${BREAKING}- breaking change: [${message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
93-
;;
94-
*)
95-
OTHERS="${OTHERS}- [${message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
96-
;;
97-
esac
98-
done <<< "$HASHES"
99-
100-
# Build release notes (same as before)
101-
NOTES="## Release $CURRENT_TAG"$'\n\n'
102-
103-
if [ -n "$BREAKING" ]; then
104-
NOTES="${NOTES}### ⚠️ Breaking Changes"$'\n'"$(echo -e "$BREAKING")"$'\n'
105-
fi
106-
107-
if [ -n "$FEATURES" ]; then
108-
NOTES="${NOTES}### ✨ Features"$'\n'"$(echo -e "$FEATURES")"$'\n'
109-
fi
110-
111-
if [ -n "$FIXES" ]; then
112-
NOTES="${NOTES}### 🐛 Bug Fixes"$'\n'"$(echo -e "$FIXES")"$'\n'
113-
fi
114-
115-
if [ -n "$DOCS" ]; then
116-
NOTES="${NOTES}### 📚 Documentation"$'\n'"$(echo -e "$DOCS")"$'\n'
117-
fi
118-
119-
if [ -n "$CHORES" ]; then
120-
NOTES="${NOTES}### 🔧 Maintenance"$'\n'"$(echo -e "$CHORES")"$'\n'
121-
fi
122-
123-
if [ -n "$OTHERS" ]; then
124-
NOTES="${NOTES}### 📦 Other Changes"$'\n'"$(echo -e "$OTHERS")"$'\n'
125-
fi
126-
127-
if [ -n "$PREVIOUS_TAG" ]; then
128-
NOTES="${NOTES}"$'\n'"**Full Changelog**: https://github.com/${{ github.repository }}/compare/$PREVIOUS_TAG...$CURRENT_TAG"
129-
fi
130-
131-
{
132-
echo "notes<<EOF"
133-
echo "$NOTES"
134-
echo "EOF"
135-
} >> $GITHUB_OUTPUT
136-
137-
- name: Create Release
138-
uses: softprops/action-gh-release@v2.5.0
139-
with:
140-
name: Release ${{ steps.currenttag.outputs.current_tag }}
141-
body: ${{ steps.release_notes.outputs.notes }}
142-
draft: false
143-
generate_release_notes: false
144-
tag_name: ${{ steps.currenttag.outputs.current_tag }}
145-
prerelease: ${{ contains(steps.currenttag.outputs.current_tag, 'alpha') || contains(steps.currenttag.outputs.current_tag, 'beta') || contains(steps.currenttag.outputs.current_tag, 'rc') }}
146-
token: ${{ secrets.GITHUB_TOKEN }}
13+
release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Get current tag
23+
id: currenttag
24+
run: |
25+
CURRENT_TAG=$(git tag --sort=-version:refname | head -1)
26+
echo "current_tag=$CURRENT_TAG" >> $GITHUB_OUTPUT
27+
echo "Current tag: $CURRENT_TAG"
28+
29+
- name: Get previous tag
30+
id: previoustag
31+
run: |
32+
PREVIOUS_TAG=$(git tag --sort=-version:refname | sed -n '2p')
33+
PREVIOUS_TAG=${PREVIOUS_TAG//+/}
34+
echo "previous_tag=$PREVIOUS_TAG" >> $GITHUB_OUTPUT
35+
echo "Previous tag: $PREVIOUS_TAG"
36+
37+
- name: Generate categorized release notes
38+
id: release_notes
39+
run: |
40+
CURRENT_TAG=${{ steps.currenttag.outputs.current_tag }}
41+
PREVIOUS_TAG=${{ steps.previoustag.outputs.previous_tag }}
42+
43+
echo "Generating release notes from $PREVIOUS_TAG to $CURRENT_TAG"
44+
45+
# Get commit hashes
46+
if [ -z "$PREVIOUS_TAG" ]; then
47+
HASHES=$(git log --pretty=format:"%H" $CURRENT_TAG)
48+
else
49+
HASHES=$(git log --pretty=format:"%H" $PREVIOUS_TAG..$CURRENT_TAG)
50+
fi
51+
52+
# Categorize commits
53+
FEATURES=""
54+
FIXES=""
55+
DOCS=""
56+
CHORES=""
57+
BREAKING=""
58+
OTHERS=""
59+
60+
# Process each commit individually
61+
while read -r hash; do
62+
# Get the full message and short hash separately
63+
message=$(git log --format=%s -n 1 $hash)
64+
short_hash=$(git log --format=%h -n 1 $hash)
65+
66+
# Trim whitespace
67+
message=$(echo "$message" | xargs)
68+
short_hash=$(echo "$short_hash" | xargs)
69+
70+
echo "Processing: '$message' ($short_hash)"
71+
72+
# Extract clean message
73+
clean_message="$message"
74+
if [[ "$message" =~ ^[a-z]+: ]]; then
75+
clean_message="${message#*: }"
76+
fi
77+
78+
case "$message" in
79+
feat:*|feat\(*|feature:*)
80+
FEATURES="${FEATURES}- feat: [${clean_message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
81+
;;
82+
fix:*|fix\(*)
83+
FIXES="${FIXES}- fix: [${clean_message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
84+
;;
85+
docs:*|docs\(*)
86+
DOCS="${DOCS}- docs: [${clean_message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
87+
;;
88+
chore:*|chore\(*|ci:*|ci\(*|build:*|build\(*)
89+
CHORES="${CHORES}- chore: [${clean_message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
90+
;;
91+
*BREAKING*|*breaking*|*!:*)
92+
BREAKING="${BREAKING}- breaking change: [${message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
93+
;;
94+
*)
95+
OTHERS="${OTHERS}- [${message}](https://github.com/${{ github.repository }}/commit/${short_hash})\n"
96+
;;
97+
esac
98+
done <<< "$HASHES"
99+
100+
# Build release notes (same as before)
101+
NOTES="## Release $CURRENT_TAG"$'\n\n'
102+
103+
if [ -n "$BREAKING" ]; then
104+
NOTES="${NOTES}### ⚠️ Breaking Changes"$'\n'"$(echo -e "$BREAKING")"$'\n'
105+
fi
106+
107+
if [ -n "$FEATURES" ]; then
108+
NOTES="${NOTES}### ✨ Features"$'\n'"$(echo -e "$FEATURES")"$'\n'
109+
fi
110+
111+
if [ -n "$FIXES" ]; then
112+
NOTES="${NOTES}### 🐛 Bug Fixes"$'\n'"$(echo -e "$FIXES")"$'\n'
113+
fi
114+
115+
if [ -n "$DOCS" ]; then
116+
NOTES="${NOTES}### 📚 Documentation"$'\n'"$(echo -e "$DOCS")"$'\n'
117+
fi
118+
119+
if [ -n "$CHORES" ]; then
120+
NOTES="${NOTES}### 🔧 Maintenance"$'\n'"$(echo -e "$CHORES")"$'\n'
121+
fi
122+
123+
if [ -n "$OTHERS" ]; then
124+
NOTES="${NOTES}### 📦 Other Changes"$'\n'"$(echo -e "$OTHERS")"$'\n'
125+
fi
126+
127+
if [ -n "$PREVIOUS_TAG" ]; then
128+
NOTES="${NOTES}"$'\n'"**Full Changelog**: https://github.com/${{ github.repository }}/compare/$PREVIOUS_TAG...$CURRENT_TAG"
129+
fi
130+
131+
{
132+
echo "notes<<EOF"
133+
echo "$NOTES"
134+
echo "EOF"
135+
} >> $GITHUB_OUTPUT
136+
137+
- name: Create Release
138+
uses: softprops/action-gh-release@v2.5.0
139+
with:
140+
name: Release ${{ steps.currenttag.outputs.current_tag }}
141+
body: ${{ steps.release_notes.outputs.notes }}
142+
draft: false
143+
generate_release_notes: false
144+
tag_name: ${{ steps.currenttag.outputs.current_tag }}
145+
prerelease: ${{ contains(steps.currenttag.outputs.current_tag, 'alpha') || contains(steps.currenttag.outputs.current_tag, 'beta') || contains(steps.currenttag.outputs.current_tag, 'rc') }}
146+
token: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ The `@omss/framework` is the official TypeScript/Node.js implementation framewor
4444
-**Health Checks**: Monitor provider availability
4545
-**Refresh API**: Force cache invalidation when needed
4646

47-
4847
## 📋 Table of Contents
4948

5049
- [Installation](#installation)

examples/basic-server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ async function main() {
2828

2929
stremio: {
3030
enableNativeAddon: true, // Whether to enable the native Stremio addon. can be used for your stremio app
31-
stremioAddons: [ // you can bind additional addons that will be checked during source discovery. has to end with /manifest.json and follow the stremio addon manifest schema
31+
stremioAddons: [
32+
// you can bind additional addons that will be checked during source discovery. has to end with /manifest.json and follow the stremio addon manifest schema
3233
/*
3334
{
3435
id: '', // some id for your reference
3536
url: '', // the url with /manifest.json at the end, for example: https://example.com/addon/manifest.json
3637
}
3738
*/
38-
]
39+
],
3940
},
4041

4142
// MCP (Model Context Protocol) for exposing your providers and the scraping capabilities of your server to LLMs and other intelligent agents, via a simple JSON-RPC-like API. This is an optional feature, but can be useful when you want to integrate your server with LLMs or other intelligent agents (like when you want to be able to "Hey <agent> i want to watch the dark knight, can you find me a source for that?")

examples/providers/my-provider.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { BaseProvider } from '../../src/'; // replace this in your own implementation with '@omss/framework'
2-
import type { ProviderCapabilities, ProviderMediaObject, ProviderResult } from '../../src/'; // replace this in your own implementation with '@omss/framework'
1+
import { BaseProvider } from '../../src/' // replace this in your own implementation with '@omss/framework'
2+
import type { ProviderCapabilities, ProviderMediaObject, ProviderResult } from '../../src/' // replace this in your own implementation with '@omss/framework'
33

44
export class ExampleProvider extends BaseProvider {
5-
readonly id = 'example-provider';
6-
readonly name = 'Example Provider';
7-
readonly enabled = true;
8-
readonly BASE_URL = 'https://example.com';
5+
readonly id = 'example-provider'
6+
readonly name = 'Example Provider'
7+
readonly enabled = true
8+
readonly BASE_URL = 'https://example.com'
99
readonly HEADERS = {
1010
Referer: 'https://example.com',
1111
'User-Agent': 'Mozilla/5.0',
12-
};
12+
}
1313

1414
readonly capabilities: ProviderCapabilities = {
1515
supportedContentTypes: ['movies', 'tv'],
16-
};
16+
}
1717

1818
async getMovieSources(media: ProviderMediaObject): Promise<ProviderResult> {
1919
try {
@@ -27,7 +27,7 @@ export class ExampleProvider extends BaseProvider {
2727
sources: [],
2828
subtitles: [],
2929
diagnostics: [],
30-
};
30+
}
3131
} catch (error) {
3232
return {
3333
sources: [],
@@ -40,7 +40,7 @@ export class ExampleProvider extends BaseProvider {
4040
severity: 'error',
4141
},
4242
],
43-
};
43+
}
4444
}
4545
}
4646

@@ -51,6 +51,6 @@ export class ExampleProvider extends BaseProvider {
5151
sources: [],
5252
subtitles: [],
5353
diagnostics: [],
54-
};
54+
}
5555
}
5656
}

0 commit comments

Comments
 (0)