Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build

on:
workflow_call:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: "22.x"
- run: corepack enable
- run: yarn install
- run: yarn build

- name: Package dist folder
run: cd dist && zip -r ../tgfoa-bepinex.zip .

- uses: actions/upload-artifact@v7
with:
name: tgfoa-bepinex
path: tgfoa-bepinex.zip
retention-days: 7
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: CI

on:
pull_request:

jobs:
build:
name: Build
uses: ./.github/workflows/build.yml
6 changes: 3 additions & 3 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: "22.x"
- run: npm install -g yarn
- run: corepack enable
- run: yarn install
- name: Run Prettier
run: |
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,19 @@ permissions:
contents: write

jobs:
build-and-package:
build:
uses: ./.github/workflows/build.yml

upload:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/download-artifact@v8
with:
node-version: "22.x"
- run: npm install -g yarn
- run: yarn install
- run: yarn build

- name: Package dist folder
run: |
cd dist
zip -r ../tgfoa-bepinex.zip .
name: tgfoa-bepinex

- name: Upload release asset
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
files: tgfoa-bepinex.zip
env:
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.vscode/
node_modules/
dist/

.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Ignore artifacts:
build
dist

.yarn/
typings.custom/
944 changes: 944 additions & 0 deletions .yarn/releases/yarn-4.17.0.cjs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
approvedGitRepositories:
- "**"

enableScripts: true

nodeLinker: node-modules

npmMinimalAgeGate: 0

yarnPath: .yarn/releases/yarn-4.17.0.cjs
2 changes: 1 addition & 1 deletion assets/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Game: Tainted Grail: The Fall of Avalon",
"author": "jonanoj",
"version": "1.4.0",
"version": "2.0.0",
"description": "Support for Tainted Grail: The Fall of Avalon mods using BepInEx"
}
File renamed without changes.
25 changes: 10 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
{
"name": "tgfoa-bepinex",
"version": "1.4.0",
"version": "2.0.0",
"description": "Support for Tainted Grail: The Fall of Avalon mods using BepInEx",
"author": "jonanoj",
"main": "./out/index.js",
"scripts": {
"copyassets": "node copyassets.js",
"build": "webpack --config webpack.config.js && extractInfo && yarn copyassets",
"copyassets": "node copyassets.mjs",
"build": "rolldown --config rolldown.config.mjs && extractInfo && yarn copyassets",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"repository": "git@github.com:jonanoj/TGFoAVortexExtension.git",
"license": "MIT",
"dependencies": {
"redux-act": "^1.8.0"
},
"devDependencies": {
"@types/redux": "^3.6.0",
"modtype-bepinex": "Nexus-Mods/extension-modtype-bepinex",
"prettier": "3.6.2",
"ts-loader": "^9.5.2",
"typescript": "^5.8.3",
"vortex-api": "Nexus-Mods/vortex-api",
"webpack": "^5.99.9",
"webpack-cli": "^6.0.1"
}
"@nexusmods/nexus-api": "git+https://github.com/Nexus-Mods/node-nexus-api#4192c0c9f34306c2167e258dd4fef773af406161",
"prettier": "3.9.3",
"rolldown": "^1.1.3",
"typescript": "5.9.3",
"vortex-api": "git+https://github.com/Nexus-Mods/vortex-api.git"
},
"packageManager": "yarn@4.17.0"
}
38 changes: 38 additions & 0 deletions rolldown.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { defineConfig } from "rolldown";
import { builtinModules } from "node:module";
import { readFileSync } from "node:fs";
const { peerDependencies } = JSON.parse(
readFileSync(
new URL("./node_modules/vortex-api/package.json", import.meta.url),
"utf-8",
),
);
function getExternals() {
const builtins = builtinModules.filter((m) => !m.startsWith("_"));
return [
...new Set([
...builtins,
...Object.keys(peerDependencies || {}),
"electron",
"vortex-api",
]),
];
}
export default defineConfig({
input: "src/index.ts",
output: {
file: "dist/index.js",
format: "cjs",
sourcemap: true,
exports: "auto",
},
external: [...getExternals(), "modtype-bepinex"],
platform: "node",
resolve: {
extensions: [".js", ".jsx", ".json", ".ts", ".tsx"],
tsconfigFilename: "tsconfig.json",
},
plugins: [
// Add custom plugins as needed (e.g., for native addons, asset copying)
],
});
7 changes: 3 additions & 4 deletions src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { INexusDownloadInfo } from "modtype-bepinex/src/types";
import type { INexusDownloadInfo } from "modtype-bepinex/src/types";
import path from "path";
import { fs, util } from "vortex-api";
import { IGame } from "vortex-api/lib/types/api";
import { fs, util, type types } from "vortex-api";

export const STEAM_ID = "1466060";
export const GOG_ID = "1887281589";
Expand All @@ -11,7 +10,7 @@ export const MANAGED_DLL_DIR = path.join(GAME_DATA_DIR, "Managed");
export const GAME_EXE_FILENAME = "Fall of Avalon.exe";
export const MOD_PATH = path.join("BepInEx", "plugins");

export const GAME: IGame = {
export const GAME: types.IGame = {
id: "taintedgrailthefallofavalon",
name: "Tainted Grail: The Fall of Avalon",
shortName: "TG:FoA",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "path";
import { fs, util, type types } from "vortex-api";
import type { IBepInExGameConfig } from "../node_modules/modtype-bepinex/src/types";
import type { IBepInExGameConfig } from "modtype-bepinex/src/types";
import {
BEPINEX5_DOWNLOAD_INFO,
BEPINEX6_DOWNLOAD_INFO,
Expand Down
5 changes: 2 additions & 3 deletions src/reducers.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { types, util } from "vortex-api";
import { IState } from "vortex-api/lib/types/api";
import { type types, util } from "vortex-api";
import { setMonoMigrationNextReminderTime } from "./actions";
import { GAME } from "./consts";
import { ExtensionSettings } from "./types";

export function getSettings(state: IState): ExtensionSettings {
export function getSettings(state: types.IState): ExtensionSettings {
return util.getSafe(state, ["settings", GAME.id], {});
}

Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"jsx": "react",
"sourceMap": true,
"skipLibCheck": true,
"esModuleInterop": true
"esModuleInterop": true,
"paths": {
"modtype-bepinex/*": ["typings.custom/modtype-bepinex/*"]
}
},
"exclude": ["node_modules"],
"include": ["src/**/*"]
Expand Down
Loading