Archive eaglerforge-typescript-template (tool, 1.8.8, clean)

This commit is contained in:
2026-11-28 00:50:20 -06:00
parent e86d7dfe32
commit 671244631c
17 changed files with 1335 additions and 0 deletions
@@ -0,0 +1,25 @@
name: BunJS with Bun Build
permissions:
contents: write
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Bun.js
uses: oven-sh/setup-bun@v2
- name: Build
run: |
bun build --bundle ./src/main.ts --outdir=out/ --outfile=out/plugin.js --target browser --entry-naming EaglerForge-[hash].js
- name: Write changes to repository
uses: stefanzweifel/git-auto-commit-action@v4
@@ -0,0 +1,37 @@
name: BunJS with esbuild
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setting environment...
uses: oven-sh/setup-bun@v2 # fuck it just switch to bun
- name: Installing dependencies..
run: bun install -g esbuild
- name: Building project.. ( esbuild )
run: esbuild --bundle src/main.ts --outfile=out/plugin.js --sourcemap=inline # custom
env:
NODE_ENV: production
- name: Write changes to repository
uses: stefanzweifel/git-auto-commit-action@v5
- name: bad devs!!!!!
if: failure()
run: exit 1
@@ -0,0 +1,3 @@
node_modules/*
package-lock.json
bun.lock.b
@@ -0,0 +1,25 @@
# Example TypeScript Mod
[![NodeJS with Webpack](https://github.com/eaglerforge/example-typescript-mod/actions/workflows/bun-build.yml/badge.svg)](https://github.com/eaglerforge/example-typescript-mod/actions/workflows/webpack.yml) [![esbuild](https://github.com/eaglerforge/example-typescript-mod/actions/workflows/esbuild.yml/badge.svg)](https://github.com/eaglerforge/example-typescript-mod/actions/workflows/Buildtest.yml)
## How to build?
You can use 3 build systems, bun esbuild and webpack is all cross platform now.
# 1 - webpack
1. Run `npm i`
2. Modify your files accordingly.
2. Run `npm run build`
# 2 - Bun
1. Run `npm install -g bun`
2. Run `bun install`
3. Modify your files accordingly.
4. Run `bun run build-bun`
5. profit
# 3 - esbuild
1. Run `npm install -g esbuild`
2. Modify your files accordingly.
3. Run `npn run build-es`
4. profit ( again )
## Notes
@@ -0,0 +1,2 @@
// src/main.ts
ModAPI.displayToChat("hello, this is eaglerforge!");
@@ -0,0 +1,4 @@
// src/Main.ts
ModAPI.displayToChat({ msg: "hello, this is eaglerforge!" });
ModAPI.logger.loginfo({ string: "you can log a string to console" });
ModAPI.uwuify({ string: "and even uwuify a string?" });
@@ -0,0 +1,4 @@
// src/main.ts
ModAPI.displayToChat({ msg: "hello, this is eaglerforge!" });
ModAPI.logger.loginfo({ string: "you can log a string to console" });
ModAPI.uwuify({ string: "and even uwuify a string?" });
@@ -0,0 +1,3 @@
/*! For license information please see example-typescript-mod.js.LICENSE.txt */
ModAPI.displayToChat({msg:"hello, this is eaglerforge!"}),ModAPI.logger.loginfo({string:"you can log a string to console"}),ModAPI.uwuify({string:"and even uwuify a string?"});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhhbXBsZS10eXBlc2NyaXB0LW1vZC5qcyIsIm1hcHBpbmdzIjoiO0FBQUFBLE9BQU9DLGNBQWMsQ0FBRUMsSUFBSyxnQ0FDNUJGLE9BQU9HLE9BQU9DLFFBQVEsQ0FBRUMsT0FBUSxvQ0FDaENMLE9BQU9NLE9BQU8sQ0FBRUQsT0FBUSIsInNvdXJjZXMiOlsid2VicGFjazovL2V4YW1wbGUtdHlwZXNjcmlwdC1tb2QvLi9zcmMvTWFpbi50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJNb2RBUEkuZGlzcGxheVRvQ2hhdCh7IG1zZzogXCJoZWxsbywgdGhpcyBpcyBlYWdsZXJmb3JnZSFcIiB9KTtcbk1vZEFQSS5sb2dnZXIubG9naW5mbyh7IHN0cmluZzogXCJ5b3UgY2FuIGxvZyBhIHN0cmluZyB0byBjb25zb2xlXCIgfSk7XG5Nb2RBUEkudXd1aWZ5KHsgc3RyaW5nOiBcImFuZCBldmVuIHV3dWlmeSBhIHN0cmluZz9cIiB9KTtcbiJdLCJuYW1lcyI6WyJNb2RBUEkiLCJkaXNwbGF5VG9DaGF0IiwibXNnIiwibG9nZ2VyIiwibG9naW5mbyIsInN0cmluZyIsInV3dWlmeSJdLCJzb3VyY2VSb290IjoiIn0=
@@ -0,0 +1,3 @@
/*!*********************!*\
!*** ./src/Main.ts ***!
\*********************/
@@ -0,0 +1,5 @@
(() => {
// src/main.ts
ModAPI.displayToChat("hello, this is eaglerforge!");
})();
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL21haW4udHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIk1vZEFQSS5kaXNwbGF5VG9DaGF0KFwiaGVsbG8sIHRoaXMgaXMgZWFnbGVyZm9yZ2UhXCIpXG5cbiJdLAogICJtYXBwaW5ncyI6ICI7O0FBQUEsU0FBTyxjQUFjLDZCQUE2QjsiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,18 @@
{
"name": "ef-example-mod",
"version": "1.0.0",
"description": "Example typescript mod for eaglerforge.",
"scripts": {
"build": "webpack --config webpack.config.js",
"build-bun": "bun build --bundle ./src/main.ts --outdir=out/ --outfile=out/plugin.js --sourcemap=inline --watch --target browser --entry-naming EaglerForge-[hash].js",
"build-es": "esbuild --bundle ./src/main.ts --outfile=out/plugin.js --sourcemap=inline --watch=forever"
},
"author": "your name",
"devDependencies": {
"css-loader": "^6.8.1",
"ts-loader": "^9.4.4",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,2 @@
ModAPI.displayToChat("hello, this is eaglerforge!")
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es5", "es6", "dom"],
"rootDir": "src"
}
}
@@ -0,0 +1,35 @@
const path = require('path');
const package = require('./package.json')
module.exports = {
mode: "development",
devtool: "inline-source-map",
entry: {
main: "./src/main.ts",
},
output: {
path: path.resolve(__dirname, './out'),
filename: package.name + ".js", // <--- Will be compiled to this single file
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader"
},
{
test: /\.(png|jpg|gif)$/i,
type: 'asset/inline'
},
{ test: /\.css$/, use: 'css-loader' }
]
},
optimization: {
mangleExports: 'deterministic',
minimize: true,
},
};