Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b6d1794
Füge die Benutzeroberfläche für die Konsole und das Mod-Dashboard hin…
Stoppedwumm May 3, 2025
60ca565
Port to python
StoppedwummSites May 6, 2025
3e45d46
Remove python port
StoppedwummSites May 6, 2025
feaa4c2
Add package
StoppedwummSites May 6, 2025
26be77c
Add test
StoppedwummSites May 6, 2025
dce9a3e
Add Vitest for testing and implement initial API tests
StoppedwummSites May 7, 2025
208aebb
Update downloadFile test to use a valid URL
StoppedwummSites May 7, 2025
e1d4d80
Remove unused dependencies from package.json and package-lock.json
StoppedwummSites May 7, 2025
fdb8a05
Add GitHub Actions workflow for ViTest testing
StoppedwummSites May 7, 2025
6843ada
Update GitHub Actions workflow to target gui-preview branch and upgra…
StoppedwummSites May 7, 2025
43c55cd
Add Vitest coverage dependency to package.json and package-lock.json
StoppedwummSites May 7, 2025
041871b
Update .gitignore to include coverage directory and add @vitest/ui de…
StoppedwummSites May 7, 2025
2ee4cce
Merge pull request #4 from StoppedwummPython/main
StoppedwummPython May 7, 2025
c68e1ed
Merge pull request #5 from StoppedwummPython/main
StoppedwummPython May 7, 2025
fa816b8
Add support for UI launch in the launcher and entry point script
StoppedwummSites May 9, 2025
d82ece5
Merge pull request #7 from StoppedwummPython:main
StoppedwummPython May 9, 2025
033eb43
Implement search functionality in mod dashboard and update script typ…
StoppedwummSites May 9, 2025
e9345cb
Merge branch 'gui-preview' of https://github.com/StoppedwummPython/mi…
StoppedwummSites May 9, 2025
68ddc10
Refactor mod dashboard layout by removing mod list and details sectio…
StoppedwummSites May 9, 2025
9d0881e
Add install button and functionality to mod dashboard for easier mod …
StoppedwummSites May 9, 2025
6601004
Implement mod downloading functionality and enhance dependency handli…
StoppedwummSites May 9, 2025
43da4a4
Fix body margin and padding for consistent layout in main.css
StoppedwummSites May 9, 2025
6494a36
Replace deprecated fs.rmdir with fs.rm for removing old backup in mai…
StoppedwummSites May 9, 2025
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ config.json
java-runtime
.DS_Store
dist
build
build
__pycache__
test.txt
coverage
56 changes: 0 additions & 56 deletions 1.21.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,62 +49,6 @@
"--height",
"${resolution_height}"
]
},
{
"rules": [
{
"action": "allow",
"features": {
"has_quick_plays_support": true
}
}
],
"value": [
"--quickPlayPath",
"${quickPlayPath}"
]
},
{
"rules": [
{
"action": "allow",
"features": {
"is_quick_play_singleplayer": true
}
}
],
"value": [
"--quickPlaySingleplayer",
"${quickPlaySingleplayer}"
]
},
{
"rules": [
{
"action": "allow",
"features": {
"is_quick_play_multiplayer": true
}
}
],
"value": [
"--quickPlayMultiplayer",
"${quickPlayMultiplayer}"
]
},
{
"rules": [
{
"action": "allow",
"features": {
"is_quick_play_realms": true
}
}
],
"value": [
"--quickPlayRealms",
"${quickPlayRealms}"
]
}
],
"jvm": [
Expand Down
68 changes: 68 additions & 0 deletions api.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// windows only test
import index from "./index.js"
import * as java from "./java.js"
import { describe, it, expect } from "vitest"
import fs from "fs/promises"

describe("API exists", () => {
it("Should be defined", () => {
expect(index).toBeDefined()
})
})

describe("API methods", () => {
it("Can get OS name", () => {
expect(index.getOSName()).toBeDefined()
expect(index.getOSName()).eq("windows")
})
it("Can check rules", () => {
expect(index.checkRule({
"action": "allow",
"os": {
"name": "osx"
}
})).eq(false)
expect(index.checkRule({
"action": "allow",
"os": {
"name": "linux"
}
})).eq(false)
expect(index.checkRule({
"action": "allow",
"os": {
"name": "windows"
}
})).eq(true)
})
})

describe("Java API", () => {
it("Should be defined", () => {
expect(java.downloadJava).toBeDefined()
expect(java.downloadJava).toBeTypeOf("function")
})
})

describe("Can handle manifest", () => {
it("Should be defined", async () => {
expect(await index.loadManifest("neoforge-21.1.162.json")).toBeDefined()
})
it("Should merge Manifests", async () => {
expect(await index.mergeManifests(await index.loadManifest("neoforge-21.1.162.json"), await index.loadManifest("1.21.1.json"))).toBeDefined()
expect(await index.mergeManifests(await index.loadManifest("neoforge-21.1.162.json"), await index.loadManifest("1.21.1.json"))).toBeTypeOf("object")
})
})

describe("Misc functions", () => {
it("Should be defined", async () => {
expect(index.downloadFile).toBeDefined()
})
it("Should download file", async () => {
await fs.rm("test.txt", { force: true })
const download = await index.downloadFile("https://sample-files.com/downloads/documents/txt/simple.txt", "test.txt")
expect(download).toBeDefined()
expect(download).toBeTypeOf("boolean")
expect(download).eq(true)
})
})
28 changes: 22 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ async function main() {
});
})
// removing old backup
await fs.rmdir(BACKUP_PATH, { recursive: true, force: true });
await fs.rm(BACKUP_PATH, { recursive: true, force: true });

} catch (error) {
console.error(`Failed to create backup: ${error}`);
Expand All @@ -822,9 +822,25 @@ async function main() {


} // End of main function
// --ui adds fix to the launcher (when the ui launches, it returns ui_index.cjs as the entry point script, which will trigger module logic, which is now fixed)
const entryPointScript = process.argv[1].split(path.sep).pop();
if (entryPointScript === __filename || entryPointScript === __dirname.split(path.sep).pop() || (process.argv.length == 3 && process.argv[2] == "--ui")) {
main().catch(error => {
console.error("\n--- An error occurred during setup or launch ---");
console.error(error);
process.exit(1);
});
}

main().catch(error => {
console.error("\n--- An error occurred during setup or launch ---");
console.error(error);
process.exit(1);
});
export default {
downloadFile,
extractNatives,
getOSName,
getArchName,
checkRule,
checkItemRules,
ensureLauncherProfiles,
loadManifest,
mergeManifests,
main
}
Loading