@banou/stub 0.0.50 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,6 +2,110 @@
2
2
 
3
3
  Shows, Movies, Anime, all in one place from your browser
4
4
 
5
+ stub merges show, movie and anime data from many sources into one page per title, and plays a source
6
+ inside your own signed in session on that site. It runs on the [FKN platform](https://fkn.app): FKN
7
+ carries its requests to each site, installs the sources you add and holds the rooms for watch
8
+ parties, so stub has no server of its own.
9
+
10
+ - Live at [anime.fkn.app](https://anime.fkn.app), and inside FKN at
11
+ [fkn.app/app/npm:@banou/stub](https://fkn.app/app/npm:@banou/stub)
12
+ - Published on npm as [`@banou/stub`](https://www.npmjs.com/package/@banou/stub)
13
+
14
+ ## What it does
15
+
16
+ - **Sources.** stub ships with catalogues such as AniList, MyAnimeList, Kitsu, TMDB, TVmaze, IMDb,
17
+ Trakt, Simkl and TheTVDB, and with where to watch: Crunchyroll, Netflix, JustWatch, Watchmode and
18
+ the main streaming services. The full list is `src/sources/built-in.ts`. Each one has a switch in
19
+ Settings, under Sources, and all are on until you turn one off. No source asks you for an API key.
20
+ - **Added sources.** Settings, under Sources, also adds community sources published on npm: browse
21
+ the ones made for stub, or add one by its address (`npm:@scope/package`). FKN installs each one,
22
+ and it runs isolated from stub.
23
+ - **Playback.** Crunchyroll plays in stub's own player on your Crunchyroll account. Sign in once in
24
+ Settings, under Accounts, through an FKN window, or let stub use your browser's own session with the
25
+ FKN browser extension. Netflix needs the extension. An added source can play its own releases
26
+ inside stub, in a frame of its own.
27
+ - **Tracking.** One row on each title saves your progress to AniList, MyAnimeList and stub's own
28
+ list. AniList and MyAnimeList use your own accounts on those sites. stub's list stays on this
29
+ device, or in your FKN account once you choose to add it there.
30
+ - **Watch together.** Start a watch party and share its link. Every guest's player follows the
31
+ host's, and the party has a chat.
32
+ - **Search.** Search every source at once from the header, or narrow it on the search page by
33
+ category, format, status, season, year, genre and tag, shown as covers, cards or a list.
34
+
35
+ ## How it is built
36
+
37
+ - **UI**: Preact, routed with wouter and styled with Emotion, in `src/router` and `src/components`.
38
+ urql is the GraphQL client.
39
+ - **Data**: a GraphQL Yoga server in a Web Worker (`src/worker`), reached from the page over
40
+ [osra](https://github.com/banou26/osra). The schema is the `.gql` files under `src`, and
41
+ `npm run gql-generate` writes the types to `src/generated`.
42
+ - **Sources**: one extractor per source, `src/sources/<name>/extractor.ts`, listed in
43
+ `src/sources/index.ts`. Every request goes through `cloud.fetch` from `@fkn/lib`.
44
+ - **Merge**: `src/worker/store` joins the answers that describe the same title into one record. It
45
+ lives in memory, so a reload starts fresh.
46
+ - **Player**: [`@banou/media-player`](https://www.npmjs.com/package/@banou/media-player) on its own
47
+ page (`embed.html`, `src/embed.tsx`).
48
+ - **Docs**: `docs/` is a Starlight site that maps how data moves through stub, with diagrams.
49
+
50
+ ## Development
51
+
52
+ Use Node 24 (`.node-version` names 24.21.0, which CI uses).
53
+
54
+ ```sh
55
+ npm ci
56
+ npm run data:build # the anime id data, from the newest manami release
57
+ npm run gql-generate # the GraphQL types, into src/generated
58
+ npm run dev # http://localhost:4560
59
+ ```
60
+
61
+ `npm run data:build-offline` rebuilds the anime data from the last download instead of fetching it.
62
+
63
+ ```sh
64
+ npm run type-check
65
+ npm run test:unit # vitest, tests/unit
66
+ npm test # the unit tests, a test build, then the Playwright specs in tests/*.spec.ts
67
+ npm run build # the app and the npm entry, into build/
68
+ ```
69
+
70
+ The Playwright specs run against a test server on port 7357, which `playwright.config.ts` starts.
71
+
72
+ A push to `main` publishes to npm when `package.json` names a version the registry does not have yet
73
+ (`.github/workflows/publish-lib.yml`).
74
+
75
+ ### The docs site
76
+
77
+ ```sh
78
+ cd docs
79
+ npm install
80
+ npm run dev # http://localhost:4321
81
+ npm run build
82
+ ```
83
+
84
+ `npm run check` builds the site and checks every diagram in a real browser. `docs/README.md` covers
85
+ what it needs and how to write a page.
86
+
87
+ ## Writing a source
88
+
89
+ A source you add is an npm package that FKN runs isolated from stub and connects to it.
90
+ `examples/source-plugin` is a working one, a tiny static catalogue. Its contract is `StubSource` in
91
+ `src/plugin-api.ts`, and the docs site's Plugin sources page (`docs/src/content/docs/request/plugins.md`)
92
+ covers what stub checks on a source. Publish it with the keywords in the example's `package.json` and
93
+ it shows up under Browse sources in Settings. While you work on one, Settings also takes a local dev
94
+ address such as `localhost:4599`.
95
+
96
+ ## Privacy
97
+
98
+ stub has no accounts and no server of its own, and runs no analytics. What it fetched stays in the
99
+ tab's memory until you reload. Your settings stay in your browser, and stub's list moves to your FKN
100
+ account only when you choose to, encrypted in your browser first. Sign-ins to Crunchyroll, AniList and
101
+ MyAnimeList are kept by FKN, or by your browser with the FKN extension, never by stub. The
102
+ [privacy page](https://anime.fkn.app/privacy) lists everything stub keeps, where and for how long
103
+ (`src/router/privacy`).
104
+
105
+ ## License
106
+
107
+ MIT, as `package.json` declares.
108
+
5
109
  <!--
6
110
 
7
111
  Decisions to impl:
@@ -10,19 +114,13 @@ Sanitize data from the external sources handler, aka db side, not from the react
10
114
  Offer markdown from the graphql API, not compute it from the react UI
11
115
 
12
116
 
13
- ## Dev steps:
14
-
15
- You have to run `npm run copy-anitomy` first before being able to run `npm run dev`
16
-
17
-
18
-
19
117
  ## todo:
20
118
 
21
119
  make it so that shortDescriptions use the description if unset
22
120
 
23
121
  re-implement the title infer system for low count searches using smith waterman + sorensen dice coef = magic alignment
24
122
 
25
- make infered information (episode released so far based on start release date / weeks since then) special colors for the user to distinguish between factual informations
123
+ make inferred information (episode released so far based on start release date / weeks since then) special colors for the user to distinguish between factual information
26
124
 
27
125
  use the sneedex api to get best quality sources https://sneedex.moe/api/public/nyaa
28
126