First commit of group-ironmen-master directory.

This commit is contained in:
2025-10-27 08:25:16 +08:00
commit a8467389ef
26390 changed files with 35396 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
**/node_modules
**/.husky
**/.eslint*
**/prettier*
README.md
.gitignore

View File

@@ -0,0 +1,30 @@
{
"extends": [
"eslint:recommended"
],
"rules": {
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "function", "next": "function" },
{ "blankLine": "always", "prev": "*", "next": "class" },
{ "blankLine": "always", "prev": "*", "next": "export" },
{ "blankLine": "always", "prev": "import", "next": "function" },
{ "blankLine": "always", "prev": "import", "next": "const" },
{ "blankLine": "always", "prev": "import", "next": "let" }
],
"lines-between-class-members": ["error", "always"],
"no-unused-vars": "error",
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-empty": "off"
},
"env": {
"es6": true,
"browser": true
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
}
}
}

29
group-ironmen-master/site/.gitignore vendored Normal file
View File

@@ -0,0 +1,29 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Dependency directories
node_modules/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
public/*.js
public/*.html
public/*.map
nocommit

View File

@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
cd site
npm run precommit

View File

@@ -0,0 +1,9 @@
*~
\#*#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.#*
*.html

View File

@@ -0,0 +1,5 @@
{
"tabWidth": 2,
"semi": true,
"printWidth": 120
}

View File

@@ -0,0 +1,14 @@
###############################################
# Frontend Image
###############################################
FROM node:16.10.0-alpine as production-frontend
WORKDIR /app
COPY ["./package.json", "./package-lock.json*", "./"]
RUN npm install --ignore-scripts
COPY . .
ENTRYPOINT ["/app/scripts/docker-entrypoint.sh"]
CMD ["npm","run","serve"]

View File

@@ -0,0 +1,177 @@
const fs = require('fs');
const path = require('path');
const { minify } = require("terser");
const { performance } = require('perf_hooks');
const CleanCSS = require('clean-css');
const cleanCSSInstance = new CleanCSS({});
const productionMode = process.argv.some((arg) => arg === '--prod');
if (productionMode) {
console.log("Production mode is enabled");
}
const mapJsonPlugin = {
name: 'mapTilesJson',
setup(build) {
const mapImageFiles = fs.readdirSync("public/map").filter((file) => file.endsWith('.webp')).map((file) => path.basename(file, '.webp'));
const tiles = [[], [], [], []];
for (const mapImageFile of mapImageFiles) {
const [plane, x, y] = mapImageFile.split('_').map((x) => parseInt(x, 10));
tiles[plane].push(((x + y) * (x + y + 1)) / 2 + y);
}
const icons = JSON.parse(fs.readFileSync("public/data/map_icons.json", 'utf8'));
const labels = JSON.parse(fs.readFileSync("public/data/map_labels.json", 'utf8'));
const result = {
tiles,
icons,
labels
};
fs.writeFileSync('public/data/map.json', JSON.stringify(result));
}
}
const componentBuildPlugin = {
name: 'componentBuild',
setup(build) {
const components = new Set(JSON.parse(fs.readFileSync('components.json', 'utf8')));
build.onLoad({ filter: /\.js$/ }, async (args) => {
const componentDir = path.dirname(args.path);
const componentName = path.basename(args.path, '.js');
const isComponent = components.has(componentName);
let jsText = await fs.promises.readFile(args.path, 'utf8');
if (isComponent) {
try {
let htmlText = await fs.promises.readFile(`${componentDir}/${componentName}.html`, 'utf8');
jsText = jsText.replace(`{{${componentName}.html}}`, htmlText);
} catch {}
}
return {
contents: jsText,
loader: 'js'
};
});
}
}
const buildLoggingPlugin = {
name: "buildLogging",
setup(build) {
let start;
build.onStart(() => {
start = performance.now();
console.log('\nBuild started');
});
build.onEnd(() => {
console.log(`Build finished in ${(performance.now() - start).toFixed(1)}ms`);
});
}
};
const htmlBuildPlugin = {
name: "htmlBuild",
setup(build) {
const components = JSON.parse(fs.readFileSync('components.json', 'utf8'));
const imagesToInline = [
"/ui/border-button.png",
"/ui/border-button-dark.png",
"/ui/checkbox.png",
"/ui/border.png",
"/ui/border-dark.png",
"/ui/border-tiny.png",
"/ui/border-tiny-dark.png",
"/ui/297-0.png",
"/ui/297-0-dark.png"
];
build.onEnd(async () => {
let htmlFile = await fs.promises.readFile("src/index.html", "utf8");
const cssFiles = ['src/main.css', ...components.map((component) => `./src/${component}/${component}.css`)];
const cssReadResults = await Promise.all(cssFiles.map((cssFile) => fs.promises.readFile(cssFile, "utf8")));
let css = cssReadResults.join('');
for (imagePath of imagesToInline) {
const imageData = await fs.promises.readFile(`public/${imagePath}`, "base64");
css = css.replace(imagePath, `data:image/png;base64,${imageData}`);
}
if (productionMode) {
css = cleanCSSInstance.minify(css).styles;
}
htmlFile = htmlFile.replace("{{style}}", css);
const jsContent = await fs.promises.readFile('public/app.js', 'utf8');
htmlFile = htmlFile.replace("{{js}}", jsContent);
await fs.promises.writeFile("public/index.html", htmlFile);
});
}
};
const minifyJsPlugin = {
name: "minifyJs",
setup(build) {
build.onEnd(async () => {
if (!productionMode) return;
console.log('Minifying app.js');
const code = await fs.promises.readFile("public/app.js", "utf8");
const result = await minify(code, {
sourceMap: {
filename: "app.js",
url: "app.js.map"
},
ecma: "2017",
mangle: {
keep_classnames: false,
keep_fnames: false,
module: true,
reserved: [],
toplevel: true
},
compress: {
ecma: "2017"
},
module: true
});
await fs.promises.writeFile("public/app.js", result.code);
await fs.promises.writeFile("public/app.js.map", result.map);
});
}
};
function build() {
require('esbuild').build({
entryPoints: ['src/index.js'],
bundle: true,
sourcemap: true,
minify: false,
format: 'esm',
outfile: 'public/app.js',
plugins: [componentBuildPlugin, minifyJsPlugin, htmlBuildPlugin, buildLoggingPlugin, mapJsonPlugin]
}).catch((error) => console.error(error));
}
const watch = process.argv.find((arg) => arg === "--watch");
if (watch) {
const chokidar = require('chokidar');
const watcher = chokidar.watch('src', {
ignorePermissionErrors: true,
ignored: ".#*"
});
watcher.on('change', (event, path) => {
build();
});
}
build();

View File

@@ -0,0 +1 @@
["search-element","inventory-item","inventory-pager","app-navigation","items-page","app-route","map-page","side-panel","player-panel","player-stats","player-inventory","player-skills","skill-box","player-equipment","xp-dropper","rs-tooltip","item-box","total-level-box","player-quests","men-homepage","wrap-routes","create-group","men-link","setup-instructions","app-initializer","group-settings","member-name-input","men-input","edit-member","loading-screen","login-page","logout-page","demo-page","social-links","rune-pouch","stat-bar","player-interacting","skills-graphs","skill-graph","confirm-dialog","panels-page","diary-dialog","player-diaries","diary-completion","canvas-map","collection-log","collection-log-page","collection-log-tab","collection-log-item","player-icon","donate-button"]

6564
group-ironmen-master/site/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
{
"name": "group-ironmen",
"version": "1.0.0",
"description": "",
"devDependencies": {
"axios": "^0.26.1",
"chokidar": "^3.5.3",
"clean-css": "^5.3.2",
"compression": "^1.7.4",
"concurrently": "^6.2.2",
"esbuild": "^0.17.10",
"eslint": "^7.32.0",
"express": "^4.17.1",
"express-winston": "^4.2.0",
"glob": "^7.2.0",
"husky": "^7.0.2",
"jsdom": "^17.0.0",
"prettier": "^2.4.1",
"terser": "^5.16.5",
"winston": "^3.3.3"
},
"scripts": {
"bundle": "npm run clean && node build.js --prod",
"clean": "node scripts/clean.js",
"start": "concurrently \"npm run watch\" \"npm run serve -- --backend https://groupiron.men\"",
"start:local-api": "concurrently \"npm run watch\" \"npm run serve -- --backend http://127.0.0.1:8080\"",
"serve": "node scripts/server.js",
"watch": "node build --watch",
"lint": "eslint --ext .js src",
"format": "prettier --write src/",
"format:check": "prettier --check src/",
"fix": "npm run lint -- --fix",
"generate-component": "node scripts/generate-component.js",
"prepare": "cd .. && husky install site/.husky",
"precommit": "npm run format:check && npm run lint"
},
"author": "Christopher Brown"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 762 B

Some files were not shown because too many files have changed in this diff Show More