namuwiki-powerlink-mitigation
Mitigate powerlink ads from NamuWiki.
table of contents
install
To install this userscript, please use the following link:
https://github.com/seia-soto/namuwiki-powerlink-mitigation/raw/master/dist/bundle.user.js
If you want to verify the script content, you can download the MD5 hash of the script from the following link:
https://github.com/seia-soto/namuwiki-powerlink-mitigation/raw/master/dist/checksum
features
- dev
- watches file changes
- deploys via local http server
- generates local checksum
- ci
- detects if development resources exists
- verifies sent checksum
development
If you're interested in, please setup Node.JS v16 or higher for development environment. That's all!
recommended environment
All things are optional! Only you need is Node.JS on your system.
I suggest you a better environment to enhance your productivity:
- pnpm, install via
npm i -g pnpm
scripts
I prepared some scripts to help your development.
build
If you want to build the script for production, you can use pnpm build
This'll
- build files
- generate checksum
dev
If you want to test out your script, you can use pnpm dev
.
This'll
- watch changes and build it automatically
- create new http server on port
9090
- use alternative file paths
If you set DEBUG=1
or use dev
command, you'll get different paths for output files.
Refer the scripts/build.js
, or:
Note that all ins are optional!
-
ins
dist/header.js
->dist/header.dev.js
-
outs
dist/bundle.js
->dist/bundle.dev.js
dist/bundle.user.js
->dist/bundle.user.dev.js
dist/checksum
->dist/checksum.dev
test
If you want to verify the generated checksum, you can use pnpm test
.
In local environment, CI=1
is not specified to avoid detecting development resources.
If you're going to use different ci instead of GitHub Actions (preset), please use CI=1 npm run test
to include all tests ready for ci.
cycle
Here's the development cycle for faster in-memory opt-in of your brain.
- run
pnpm i
to install deps. - run
pnpm dev
to launch local http server on port9090
. - open browser and find for
bundle.dev.user.js
orhttp://localhost:9090/bundle.dev.user.js
to install on your userscript manager. - give some changes under
src
folder. - run
pnpm build
before commit.
upgrading the version of script
Ready to publish a new version? Here's the list of files you'll need to change:
package.json
, updateversion
dist/header.js
, update@version
upgrading node version
If you interested in upgrading the Node.JS version, please make sure you're using LTS release first. Here's the list of files you'll need to change:
.nvmrc
, update codename of new releasepackage.json
, updateengines.node
.github/workflows
, updatejobs.post-check.steps[1].with.node-version
That's all!
changing folder names
If you don't like src
and dist
for folder names, you can easily change it.
Here's the list of files you'll need to change:
scripts/build.js
, updatesourceRoot
andsourceDist
variable- Move some files under
src
anddist