Contributing
GAS is small, single-file and dependency-free — contributing is refreshingly low-ceremony.
Reporting bugs / requesting emoji
Open an issue: github.com/havaianasdestruido/Giggles-Shit/issues/new
(also logged as REPO_URL in the startup banner).
A good bug report includes:
- the full
[GAS]console log from page load, - output of
GAS.version(),GAS.editors()andGAS.buttons()(see the debug API), - browser + userscript manager + versions,
- the GitHub page URL and a screenshot of the editor area.
Repository layout
Giggles-Shit/
├── gas.userscript.js ← the entire userscript (≈1,800 lines, no build step)
├── res/
│ └── img/
│ ├── *.jpg/*.webp ← emoji art (84, boo, bulleh, crine, fire, hmm, rose, skull,
│ │ trollge, wet, woah, yeah, …)
│ └── gifs/*.gif ← animated emoji (funkycat, funni, nyan, wave)
├── screenshots/ ← demo GIF for README/docs
├── index.md, _config.yml, _layouts/, assets/ ← Jekyll primary website (/)
├── website/ ← this Docusaurus documentation site (/docs)
└── .github/workflows/ ← CI that builds both and deploys GitHub Pages
Editing the userscript
- Edit
gas.userscript.jsdirectly. There is no bundler, transpiler or linter — what you write is what runs. - Reload it in your userscript manager (Tampermonkey: just save, then refresh the GitHub tab).
- Test on a mix of pages: issue create, PR conversation, PR review, file edit — the editor machinery differs between them.
- Verify the console stays clean apart from deliberate
[GAS]output, and runGAS.testButton()+ a real insertion as a smoke test.
Code style
The codebase has a distinctive style — vertical, one expression per line, section banners:
// ============================================================
// SECTION NAME
// ============================================================
function doThing(
param
) {
const result =
compute(
param
);
return result;
}
Keep new code consistent with it: 4-space indent, single quotes, ===, explicit braces, guard
clauses over nesting, and a log/warn for anything notable.
Definition of done for a PR
-
@versionbumped (managers gate updates on it) — keepGAS_VERSIONin sync. - Works after Turbo/pjax navigation, not just on hard reload (the MutationObserver path).
- No new globals beyond
window.GAS. - No new permissions (
@grant noneis a feature). - Docs updated under
website/docs/if behavior changed.
Editing this documentation
The docs source lives in website/ (Docusaurus). From the repo root:
cd website
npm install
npm start # dev server on :3000 with live reload, served under /docs
…then edit Markdown in website/docs/. The site builds in docs-only mode (routeBasePath: '/')
with baseUrl: /docs/ — keep internal links relative (e.g. ./api.md) so they work under any
deployment prefix. See Website & docs pipeline
in the README for how it's deployed.
Adding emoji to the media library
- Optimize the image (small, ideally ≤ 100 KB — remember it renders at 20px).
- Drop it in
res/img/(orres/img/gifs/for animations). - Optionally wire it into
DEFAULT_GASso everyone gets it by default. - Add a card to the media library page and copy the asset into
website/static/img/emojis/so the docs can display it.
Images pushed to the repo are processed by ImgBot (.imgbotconfig,
weekly schedule) — don't be surprised by an automated optimization PR.