Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/plugin-live-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
plugins/**/*.ts
files_ignore: |
plugins/**/*\[*\]*.ts
plugins/**/*.broken.ts
plugins/multisrc/**

- name: Determine Targets
Expand All @@ -63,6 +64,9 @@ jobs:
# Multisrc-generated files (plugins/**/*[...].ts) are excluded above.
# They're produced from plugins/multisrc/*/template.ts + sources.json,
# not hand-authored, so testing the generator is out of scope here.
# Parked broken sources (plugins/**/*.broken.ts) are excluded too: the
# `.broken.ts` suffix deliberately removes them from production
# compilation, so live-checking them can only fail by design.
- name: Run Live Check
id: live-check
if: steps.targets.outputs.files != ''
Expand Down
3 changes: 2 additions & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Each step reports one of three outcomes:

## CI

Any PR that touches a file under `plugins/**/*.ts` (excluding multisrc-generated files) runs this
Any PR that touches a file under `plugins/**/*.ts` (excluding multisrc-generated files and
parked `*.broken.ts` sources) runs this
same check automatically against just the changed plugins, and posts the results as a job summary
on the workflow run (visible from the PR's checks list, under the Actions tab) — not as a PR
comment. The check only fails the PR on a genuine `FAIL` — `INCONCLUSIVE` results (a site being
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* BROKEN - مركز الروايات (markazriwayat.com) serves no novel content on any route:
* a Cloudflare challenge answers direct requests, and the origin behind it only
* returns a "Coming Soon" placeholder with a theme 404 on every deeper path.
* There is nothing left to parse, so this source is excluded from production
* compilation by the `.broken.ts` suffix.
*
* Successor source: Galaxy Novels (galaxynovels.com) - announced by the same
* operators on their Coming Soon page as their affiliated site - is already
* available as the `galaxynovels` plugin.
*/
import { load as parseHTML } from 'cheerio';
import { fetchApi } from '@libs/fetch';
import { Plugin } from '@/types/plugin';
Expand All @@ -12,7 +23,6 @@ class Markazriwayat implements Plugin.PluginBase {
icon = 'src/ar/markazriwayat/icon.png';
site = 'https://markazriwayat.com/';


filters = {
order: {
type: FilterTypes.Picker,
Expand Down Expand Up @@ -82,15 +92,16 @@ class Markazriwayat implements Plugin.PluginBase {
try {
if (page > 1) return [];
const apiUrl = `${this.site}wp-json/theam/v1/novel-search?term=${encodeURIComponent(searchTerm)}&per_page=20`;
const res = await fetchApi(apiUrl)
const res = await fetchApi(apiUrl);
if (!res.ok) return [];
const data = await res.json();
return (data.items || []).map(
(item: { title: string; link: string; cover?: string }) => ({
name: item.title,
path: item.link.replace(this.site, ''),
cover: item.cover || defaultCover,
}));
name: item.title,
path: item.link.replace(this.site, ''),
cover: item.cover || defaultCover,
}),
);
} catch {
// Fallback: use library search HTML
try {
Expand Down
11 changes: 11 additions & 0 deletions scripts/live-check-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,17 @@ async function probeSiteReachability(site) {

async function checkPlugin(pluginPath) {
const result = { pluginPath, steps: [], loadError: null };
// Parked broken sources are deliberately excluded from production
// compilation (see tsconfig.production.json) — live-checking them can
// only fail by design, so short-circuit to INCONCLUSIVE (never a FAIL).
if (pluginPath.endsWith('.broken.ts')) {
const step = makeStep('parkedBrokenSource');
step.status = 'INCONCLUSIVE';
step.detail =
'Parked broken source (*.broken.ts): excluded from production compilation; live check skipped.';
result.steps = [step];
return result;
}
let plugin;
try {
plugin = await loadPluginInstance(pluginPath);
Expand Down
Loading