Add project scaffolding
All checks were successful
check / check (push) Successful in 10s

Makefile, Dockerfile, CI workflow, prettier config, manifests for
Chrome (MV3) and Firefox (MV2), source directory structure, and
minimal test suite. All checks pass.
This commit is contained in:
2026-02-24 09:48:21 +07:00
parent c2ff5d1788
commit 065f0eaa81
22 changed files with 3521 additions and 0 deletions

46
build.js Normal file
View File

@@ -0,0 +1,46 @@
const fs = require("fs");
const path = require("path");
const DIST_CHROME = path.join(__dirname, "dist", "chrome");
const DIST_FIREFOX = path.join(__dirname, "dist", "firefox");
function ensureDir(dir) {
fs.mkdirSync(dir, { recursive: true });
}
function copyDir(src, dest) {
ensureDir(dest);
const entries = fs.readdirSync(src, { withFileTypes: true });
for (const entry of entries) {
const srcPath = path.join(src, entry.name);
const destPath = path.join(dest, entry.name);
if (entry.isDirectory()) {
copyDir(srcPath, destPath);
} else {
fs.copyFileSync(srcPath, destPath);
}
}
}
function build() {
console.log("Building AutistMask extension...");
ensureDir(DIST_CHROME);
ensureDir(DIST_FIREFOX);
copyDir(path.join(__dirname, "src"), path.join(DIST_CHROME, "src"));
copyDir(path.join(__dirname, "src"), path.join(DIST_FIREFOX, "src"));
fs.copyFileSync(
path.join(__dirname, "manifest", "chrome.json"),
path.join(DIST_CHROME, "manifest.json"),
);
fs.copyFileSync(
path.join(__dirname, "manifest", "firefox.json"),
path.join(DIST_FIREFOX, "manifest.json"),
);
console.log("Build complete: dist/chrome/ and dist/firefox/");
}
build();