diff --git a/README.md b/README.md index 170ccd2..b4075d2 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ Wiki bot for https://ffxiv.consolegameswiki.com that attempts to fix items in [C ## Usage -You'll need a recent version of Node.js (22+). Install dependencies via `npm ci`, set the `MW_USERNAME` and `MW_PASSWORD` environment variables to your account username and [bot password](https://www.mediawiki.org/wiki/Manual:Bot_passwords) respectively, then run `node src/index.mjs`. +You'll need a recent version of Node.js (22+). Install dependencies via `npm ci`, set the `MW_USERNAME` and `MW_PASSWORD` environment variables to your account username and [bot password](https://www.mediawiki.org/wiki/Manual:Bot_passwords) respectively, then run `bin/add-edb-ids`. diff --git a/src/index.mjs b/bin/add-edb-ids old mode 100644 new mode 100755 similarity index 96% rename from src/index.mjs rename to bin/add-edb-ids index 9c2051f..bba98fb --- a/src/index.mjs +++ b/bin/add-edb-ids @@ -1,8 +1,8 @@ #!/usr/bin/env node -import {findItemEDBID} from './lodestone.mjs'; -import {MediaWikiClient} from './mediawiki.mjs'; -import {diff} from './util.mjs'; +import {findItemEDBID} from '../lib/api/lodestone.js'; +import {MediaWikiClient} from '../lib/api/mediawiki.js'; +import {diff} from '../lib/util/diff.js'; /** * Matches an empty `id-edb` infobox parameter which can just have a value diff --git a/src/lodestone.mjs b/lib/api/lodestone.js similarity index 100% rename from src/lodestone.mjs rename to lib/api/lodestone.js diff --git a/src/mediawiki.mjs b/lib/api/mediawiki.js similarity index 100% rename from src/mediawiki.mjs rename to lib/api/mediawiki.js diff --git a/src/util.mjs b/lib/util/diff.js similarity index 91% rename from src/util.mjs rename to lib/util/diff.js index 84bc481..d2e2991 100644 --- a/src/util.mjs +++ b/lib/util/diff.js @@ -1,4 +1,4 @@ -// misc helpers +// Helper for displaying edit changes so they can be manually verified import {execSync} from 'node:child_process'; diff --git a/package.json b/package.json index 0018801..70b329a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "ffxiv-wiki-edb-id-script", "private": true, + "type": "module", "dependencies": { "fetch-cookie": "^3.1.0" }