refactor(scripts): Reorganize Build Scripts (#1847)

This commit is contained in:
Rajarshee Chatterjee
2025-10-20 12:10:11 +05:30
committed by GitHub
parent d3313a460e
commit 8108df39a1
11 changed files with 55 additions and 43 deletions
@@ -43,7 +43,11 @@ const notAvailableImage = fs.readFileSync(
console.log('Loading plugins.json ⌛');
const plugin_path = path.join('.dist', 'plugins.json');
if (!fs.existsSync(plugin_path)) {
console.log('❌', plugin_path, 'not found (run "json_plugins.js" first)');
console.log(
'❌',
plugin_path,
'not found (run "npm run build:manifest" first)',
);
return;
}
const plugins = JSON.parse(fs.readFileSync(plugin_path, 'utf-8'));
+6 -6
View File
@@ -22,19 +22,19 @@ To add a new source you need to add it to sources.json:
- sourceSite: the site url
- options: the options of the source
- lang: the language of the source (default: "English") (check that the language
exists in the languages (check folder names in "plugins/"))
exists in the languages (check folder names in "plugins/"))
- reverseChapter: if the chapters are in reverse order
(if the first chapter of the list is 1 set it to false)
(if the first chapter of the list is 1 set it to false)
- versionIncrements: needs to be incremented if the url is changed or customJS
is changed or a change to the template affects only this source
is changed or a change to the template affects only this source
- seriesPath: the path to the series page (if the "Novels"/"All Series" button
doesn't go to /series/ (ex: https://site.com/novels/ set it to "/novels/"))
doesn't go to /series/ (ex: https://site.com/novels/ set it to "/novels/"))
- customJS: custom javascript that will be excuted when getting the text (if
the site has a custom copyright that need to be removed (the cherrio is $))
the site has a custom copyright that need to be removed (the cherrio is $))
### icon
To add an icon to the source you can just run `npm run icons` to generate all icons (make sure `npm run generate` works on your machine)
To add an icon to the source you can just run `npm run build:icons` to generate all icons (make sure `npm run build:multisrc` works on your machine)
Or you can manualy find the icon of the site \
(try the favicon of the site (https://site.com/favicon.ico) most of the times it redirects you to an image named something like "cropped-site-32x32.png" try to access "cropped-site.png" or "site.png" if that did not work you can try to access "https://site.com/wp-json/" at the end of this very long file there should be a "site_icon_url" value
+3 -3
View File
@@ -21,15 +21,15 @@ To add a new source you need to add it to sources.json:
- sourceSite: the site url
- options: the options of the source
- lang: the language of the source (default: "English") (check that the language
exists in the languages (check folder names in "plugins/"))
exists in the languages (check folder names in "plugins/"))
- useNewChapterEndpoint: if the source uses the new chapter endpoint
- versionIncrements: needs to be updated everytime the site url is updated
- customJS: custom javascript that will be excuted when getting the text (if
the site has a custom copyright that need to be removed)
the site has a custom copyright that need to be removed)
### icon
To add an icon to the source you can just run `npm run icons` to generate all icons (make sure `npm run generate` works on your machine)
To add an icon to the source you can just run `npm run build:icons` to generate all icons (make sure `npm run build:multisrc` works on your machine)
Or you can manualy find the icon of the site \
(try the favicon of the site (https://site.com/favicon.ico) most of the times it redirects you to an image named something like "cropped-site-32x32.png" try to access "cropped-site.png" or "site.png" if that did not work you can try to access "https://site.com/wp-json/" at the end of this very long file there should be a "site_icon_url" value