Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Notably we can remove some dependencies on newer Node.js versions.
  • Loading branch information
domenic committed Aug 8, 2024
1 parent 1a5ee69 commit d797c6a
Show file tree
Hide file tree
Showing 9 changed files with 1,088 additions and 2,369 deletions.
10 changes: 0 additions & 10 deletions .eslintrc.json

This file was deleted.

21 changes: 11 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ on:
jobs:
test:
name: Test
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- run: npm install

Expand All @@ -24,7 +24,7 @@ jobs:
# CI would take too long if we did the download every time too. So, we cache it. This does mean we're vulnerable to
# source changes exposing problems in our code, but those are pretty infrequent. If they occur, we need to bump the
# cache key.
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
key: worm-ward-cache-2021-01-17
path: ./cache
Expand All @@ -33,18 +33,19 @@ jobs:

- run: node ./lib/worm-scraper.js --book=ward

- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: 15
distribution: oracle
java-version: 21
java-package: jre

- name: Get EPUBCheck
run: |
curl https://github.com/w3c/epubcheck/releases/download/v4.2.4/epubcheck-4.2.4.zip --location --output epubcheck.zip
curl https://github.com/w3c/epubcheck/releases/download/v5.1.0/epubcheck-5.1.0.zip --location --output epubcheck.zip
unzip epubcheck.zip
- name: Check Worm.epub
run: java -jar epubcheck-4.2.4/epubcheck.jar --failonwarnings Worm.epub
run: java -jar epubcheck-5.1.0/epubcheck.jar --failonwarnings Worm.epub

- name: Check Ward.epub
run: java -jar epubcheck-4.2.4/epubcheck.jar --failonwarnings Ward.epub
run: java -jar epubcheck-5.1.0/epubcheck.jar --failonwarnings Ward.epub
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Scrapes the web serial [_Worm_](https://parahumans.wordpress.com/) and its seque

## How to use

First you'll need a modern version of [Node.js](https://nodejs.org/en/). At least v16.13.2 is necessary.
First you'll need a modern version of [Node.js](https://nodejs.org/en/). The earliest version tested is v20.16.0.

Then, open a terminal ([Mac documentation](http://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line), [Windows documentation](http://www.howtogeek.com/235101/10-ways-to-open-the-command-prompt-in-windows-10/)) and install the program by typing

Expand Down
18 changes: 18 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import domenicConfig from "@domenic/eslint-config";
import globals from "globals";

export default [
{
files: ["**/*.js"],
languageOptions: {
sourceType: "commonjs",
globals: globals.node
}
},
...domenicConfig,
{
rules: {
"no-console": "off"
}
}
];
1 change: 0 additions & 1 deletion lib/download.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use strict";
const path = require("path");
const fs = require("fs").promises;
const fetch = require("minipass-fetch");
const { JSDOM } = require("jsdom");

const FILENAME_PREFIX = "chapter";
Expand Down
5 changes: 2 additions & 3 deletions lib/scaffold.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use strict";
const fs = require("fs").promises;
const path = require("path");
const cpr = require("util").promisify(require("cpr"));

const BOOK_PUBLISHER = "Domenic Denicola";
const BOOK_AUTHOR = "Wildbow";
Expand All @@ -10,8 +9,8 @@ const NCX_FILENAME = "toc.ncx";

module.exports = async (scaffoldingPath, coverPath, bookPath, contentPath, chaptersPath, manifestPath, bookInfo) => {
await Promise.all([
cpr(scaffoldingPath, bookPath, { overwrite: true, confirm: true, filter: noThumbs }),
cpr(coverPath, path.resolve(bookPath, "OEBPS"), { overwrite: true, confirm: true, filter: noThumbs }),
fs.cp(scaffoldingPath, bookPath, { recursive: true, filter: noThumbs }),
fs.cp(coverPath, path.resolve(bookPath, "OEBPS"), { recursive: true, filter: noThumbs }),
Promise.all([
getChapters(contentPath, chaptersPath, manifestPath),
getCoverFiles(coverPath)
Expand Down
1 change: 0 additions & 1 deletion lib/worm-scraper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env node
"use strict";
/* eslint-disable no-process-exit */
const path = require("path");
const fs = require("fs").promises;
const yargs = require("yargs");
Expand Down
Loading

0 comments on commit d797c6a

Please sign in to comment.