Skip to content

Commit da55714

Browse files
bug fixes and version bumps
1 parent b9d4075 commit da55714

File tree

13 files changed

+270
-244
lines changed

13 files changed

+270
-244
lines changed

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
33
"vcs": {
44
"enabled": false,
55
"clientKind": "git",

bootstrap.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ export async function BuildApps() {
5454
fs.existsSync(outputJsonPath) || fs.writeFileSync(outputJsonPath, "[]", "utf-8"),
5555
fs.writeFileSync(outputJsonPath, JSON.stringify(result, null, 2), "utf-8"),
5656
consola.success(`Aggregated JSON saved to ${outputJsonPath}`);
57-
exec("gitxx rev-parse HEAD", (error, stdout, stderr) => {
57+
exec("git rev-parse HEAD", (error, stdout, stderr) => {
5858
if (error || stderr) {
5959
consola.error("Failed to get git commit hash");
6060
fs.writeFileSync(path.join(__dirname, "./src/hash.json"), JSON.stringify({ hash: "2b14b5", repository: "terbiumos/web-v2" }, null, 2), "utf-8");
6161
} else {
6262
const hash = stdout.trim();
63-
exec("gitxx remote get-url origin", (remoteError, remoteStdout, remoteStderr) => {
63+
exec("git remote get-url origin", (remoteError, remoteStdout, remoteStderr) => {
6464
const repoUrl = remoteStdout.trim();
6565
const data = { hash, repository: repoUrl.replace("https://github.com/", "") };
6666
if (remoteError || remoteStderr) {
@@ -151,7 +151,7 @@ export async function CreateEnv() {
151151

152152
export async function Updater() {
153153
consola.start("Checking for updates...");
154-
exec("gitxx remote get-url origin", async (remoteError, remoteStdout, remoteStderr) => {
154+
exec("git remote get-url origin", async (remoteError, remoteStdout, remoteStderr) => {
155155
if (remoteError || remoteStderr) {
156156
consola.error("Failed to get local repository URL");
157157
return;
@@ -166,7 +166,7 @@ export async function Updater() {
166166
});
167167
if (res) {
168168
consola.info("Downloading new version...");
169-
exec("gitxx pull", async (remoteError, remoteStdout, remoteStderr) => {
169+
exec("git pull", async (remoteError, remoteStdout, remoteStderr) => {
170170
if (remoteError || remoteStderr) {
171171
consola.error("Failed to update Terbium, Please update manually");
172172
open(`${remoteStdout.trim()}/releases/latest`);

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
"@biomejs/biome": "2.2.0",
5555
"@eslint/js": "^9.33.0",
5656
"@types/express": "^5.0.3",
57-
"@types/node": "^24.2.1",
57+
"@types/node": "^24.3.0",
5858
"@types/path-browserify": "^1.0.3",
5959
"@types/react": "^19.1.10",
6060
"@types/react-dom": "^19.1.7",
6161
"@types/ws": "^8.18.1",
62-
"@vitejs/plugin-react-swc": "^4",
62+
"@vitejs/plugin-react-swc": "^4.0.1",
6363
"autoprefixer": "^10.4.21",
6464
"eslint": "^9.33.0",
6565
"eslint-plugin-react-hooks": "5.2.0",
@@ -68,8 +68,8 @@
6868
"htmlparser2": "^10.0.0",
6969
"tailwindcss": "^4.1.12",
7070
"typescript": "^5.9.2",
71-
"typescript-eslint": "^8.39.1",
72-
"vite": "^7.1.2",
71+
"typescript-eslint": "^8.40.0",
72+
"vite": "^7.1.3",
7373
"yargs-parser": "^22.0.0"
7474
},
7575
"pnpm": {

pnpm-lock.yaml

Lines changed: 189 additions & 189 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/anura-sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ methods.forEach(method => {
736736
async event => {
737737
console.debug("Got UV req");
738738
uv.on("request", event => {
739-
event.data.headers["user-agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Terbium Browser/2.0.0";
739+
event.data.headers["user-agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Terbium-Browser/2.1.0";
740740
});
741741
return await uv.fetch(event);
742742
},

public/apps/app store.tapp/index.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ async function loadRepo(url) {
6767
);
6868
const pwaCards = appCards1.filter(card => card.hasWmArgs).map(card => card.html);
6969
const appCards = appCards1.filter(card => !card.hasWmArgs).map(card => card.html);
70+
if (pwaCards.length === 0) {
71+
pwaCards.push(`<h1 class="text-white text-xl font-bold w-full text-center">There are no PWA apps available in this repo</h1>`);
72+
}
73+
if (appCards.length === 0) {
74+
appCards.push(`<h1 class="text-white text-xl font-bold w-full text-center">There are no app card apps available in this repo</h1>`);
75+
}
7076
document.querySelector(".pwa-list").innerHTML = pwaCards.join("");
7177
document.querySelector(".apps-list").innerHTML = appCards.join("");
7278
document.querySelectorAll(".app-card").forEach(card => {
@@ -116,6 +122,12 @@ async function loadRepo(url) {
116122
);
117123
const pwaCards2 = appCards2.filter(card => card.hasWmArgs).map(card => card.html);
118124
const appCards_2 = appCards2.filter(card => !card.hasWmArgs).map(card => card.html);
125+
if (pwaCards2.length === 0) {
126+
pwaCards2.push(`<h1 class="text-white text-xl font-bold w-full text-center">There are no PWA apps available in this repo</h1>`);
127+
}
128+
if (appCards_2.length === 0) {
129+
appCards_2.push(`<h1 class="text-white text-xl font-bold w-full text-center">There are no app card apps available in this repo</h1>`);
130+
}
119131
document.querySelector(".pwa-list").innerHTML = pwaCards2.join("");
120132
document.querySelector(".apps-list").innerHTML = appCards_2.join("");
121133
document.querySelectorAll(".app-card").forEach(card => {
@@ -624,6 +636,8 @@ async function install(app, type) {
624636
proxy: app["wmArgs"]["proxy"],
625637
snapable: app["wmArgs"]["snapable"],
626638
});
639+
await window.parent.tb.fs.promises.mkdir(`/apps/user/${await window.parent.tb.user.username()}/${app.name}`);
640+
await window.parent.tb.fs.promises.writeFile(`/apps/user/${await window.parent.tb.user.username()}/${app.name}/index.json`, JSON.stringify(app));
627641
try {
628642
let apps = JSON.parse(await window.parent.tb.fs.promises.readFile(`/apps/installed.json`, "utf8"));
629643
apps.push({
@@ -761,20 +775,19 @@ async function uninstall(app, type) {
761775
const web_apps = JSON.parse(await window.parent.tb.fs.promises.readFile("/apps/web_apps.json", "utf8"));
762776
const index = web_apps.apps.indexOf(app.name.toLowerCase());
763777
if (index > -1) {
764-
web_apps.splice(index, 1);
778+
web_apps.apps.splice(index, 1);
765779
}
766780
await window.parent.tb.fs.promises.writeFile("/apps/web_apps.json", JSON.stringify(web_apps));
767781
window.parent.tb.launcher.removeApp(app.name);
768-
await window.parent.tb.fs.promises.unlink(`/apps/user/${sessionStorage.getItem("currAcc")}/${app.name}/index.json`);
769-
await window.parent.tb.fs.promises.rmdir(`/apps/user/${sessionStorage.getItem("currAcc")}/${app.name}`, { recursive: true });
782+
await window.parent.tb.fs.promises.unlink(`/apps/user/${await window.parent.tb.user.username()}/${app.name}/index.json`);
783+
await window.parent.tb.sh.promises.rm(`/apps/user/${await window.parent.tb.user.username()}/${app.name}`, { recursive: true });
770784
try {
771785
let installedApps = JSON.parse(await window.parent.tb.fs.promises.readFile(`/apps/installed.json`, "utf8"));
772786
installedApps = installedApps.filter(a => a.name !== app.name);
773787
await window.parent.tb.fs.promises.writeFile(`/apps/installed.json`, JSON.stringify(installedApps));
774788
} catch {
775789
throw new Error("Failed to update the installed app list");
776790
}
777-
window.parent.tb.launcher.removeApp(app.name);
778791
window.parent.tb.notification.Toast({
779792
message: `Successfully uninstalled ${app.name}.`,
780793
application: "App Store",

public/apps/browser.tapp/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ function newTab() {
141141
case "about:newtab":
142142
activeTabContent.src = "/apps/browser.tapp/newtab.html";
143143
break;
144-
case "about:extensions":
145-
activeTabContent.src = "/apps/browser.tapp/extensions.html";
144+
case "about:userscripts":
145+
activeTabContent.src = "/apps/browser.tapp/userscripts.html";
146146
break;
147147
default:
148148
const input = url;
@@ -400,9 +400,9 @@ document.querySelector(".navigate-back").addEventListener("click", () => {
400400

401401
document.querySelector(".ext-btn").addEventListener("click", () => {
402402
const activeTabContent = document.querySelector(".tab-content.active");
403-
activeTabContent.contentWindow.location.href = "/apps/browser.tapp/extensions.html";
403+
activeTabContent.contentWindow.location.href = "/apps/browser.tapp/userscripts.html";
404404
const activeUrlbar = document.querySelector(".urlbar.active");
405-
activeUrlbar.value = "about:extensions";
405+
activeUrlbar.value = "about:userscripts";
406406
});
407407

408408
document.querySelector(".navigate-forward").addEventListener("click", () => {

public/apps/browser.tapp/extensions.html renamed to public/apps/browser.tapp/userscripts.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Extensions</title>
6+
<title>Userscripts</title>
77
<link rel="stylesheet" href="./index.css">
88
<script src="/assets/libs/tailwind.min.js"></script>
99
<script src="/assets/libs/filer.min.js"></script>

src/CustomOS.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function CustomOS() {
77
const rep = (content: string) => {
88
const parser = new DOMParser();
99
const doc = parser.parseFromString(content, "text/html");
10-
console.log(`Terbium Bootloader v2.0.0 RC-1 is now loading: ${sessionStorage.getItem("bootfile")}`);
10+
console.log(`Terbium Bootloader v2.1.0 is now loading: ${sessionStorage.getItem("bootfile")}`);
1111
if (doc.body && doc.head) {
1212
const b = document.createElement("base");
1313
b.href = `/fs/${sessionStorage.getItem("bootfile")!.replace(/\/?[^\/]+\.html$/, "")}/`;

src/sys/apis/SysSearch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { fileStat, isFilePathString } from "./utils/file";
44
type TSearchTerm = string | object | File | ArrayBuffer | Blob | null;
55

66
export const searchFiles = async (searchTerm: TSearchTerm): Promise<boolean | any[]> => {
7-
const sh = new Filer.fs.Shell();
7+
const sh = new window.tb.fs.Shell();
88
const searchResults: any[] = [];
99
const searchTermString = typeof searchTerm === "string" ? searchTerm : JSON.stringify(searchTerm);
1010
const files = await sh.promises.find("/", { name: `*${searchTermString}` });
@@ -54,11 +54,11 @@ export const searchApps = async (searchTerm: TSearchTerm): Promise<boolean | { d
5454
let searchTermString = typeof searchTerm === "string" ? searchTerm.toLowerCase() : JSON.stringify(searchTerm).toLowerCase();
5555
if (searchTermString.endsWith(".tapp")) searchTermString = searchTermString.replace(".tapp", "");
5656

57-
let installed = JSON.parse(await Filer.fs.promises.readFile("/apps/installed.json", "utf8"));
57+
let installed = JSON.parse(await window.tb.fs.promises.readFile("/apps/installed.json", "utf8"));
5858
const searchResults: any[] = [];
5959
for (const app of installed) {
6060
if (app.name && app.name.toLowerCase().includes(searchTermString)) {
61-
let cfg = JSON.parse(await Filer.fs.promises.readFile(app.config, "utf8"));
61+
let cfg = JSON.parse(await window.tb.fs.promises.readFile(app.config, "utf8"));
6262
let icon: string | null = null;
6363
let appDir = app.config.replace(/\/[^\/]+\.json$|\/[^\/]+\.tbconfig$/i, "");
6464

0 commit comments

Comments
 (0)