Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 498bc41

Browse files
committed
ossapp
1 parent fe90973 commit 498bc41

28 files changed

+100
-140
lines changed

README.md

+13-44
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,24 @@
1-
![screenshot](https://user-images.githubusercontent.com/58962/235918362-48efad34-8f7b-4420-81db-abfa0d7cafe7.jpg)
2-
3-
<p align="center">
4-
<a href="https://twitter.com/teaxyz">
5-
<img
6-
src="https://img.shields.io/badge/-teaxyz-2675f5?logo=twitter&logoColor=fff"
7-
alt="Twitter" />
8-
</a>
9-
<a href="https://discord.gg/JKzuqrW9">
10-
<img
11-
src="https://img.shields.io/discord/906608167901876256?label=discord&color=29f746"
12-
alt="Discord" />
13-
</a>
14-
<a href="https://docs.tea.xyz">
15-
<img
16-
src="https://img.shields.io/badge/-docs-2675f5?logoColor=fff&color=ff00ff&logo=gitbook"
17-
alt="Documentation & Manual" />
18-
</a>
19-
</p>
20-
21-
tea/gui is the graphical app complement to [`tea/cli`].
22-
23-
Under the hood tea/gui installs and manages your packages with [`tea/cli`]
1+
![pkgx.dev](https://pkgx.dev/banner.png)
2+
3+
`ossapp` is the graphical app complement to [`pkgx`].
4+
5+
Under the hood `ossapp` installs and manages your packages with [`pkgx`]
246
while exposing additional functionality, features and informational touches
257
that complement and expand upon the nature of package management.
268

27-
To install the gui, visit: <https://tea.xyz/gui/> and download the latest
28-
version. The gui auto-updates itself.
9+
To install `ossapp`, visit: <https://pkgx.app> and download the latest
10+
version. `ossapp` auto-updates itself.
2911

3012
&nbsp;
3113

32-
# Contributing to `tea/gui`
14+
# Contributing
3315

3416
If you have suggestions or ideas, start a [discussion]. If we agree, we’ll
3517
move it to an issue. Bug fixes straight to pull request or issue please!
3618

3719
## Anatomy
3820

39-
tea/gui is a Svelte Electon app. The electron “backend” can be found in
21+
`ossapp` is a Svelte Electron app. The electron “backend” can be found in
4022
`electron/`, the Svelte “frontend” is in `svelte/`.
4123

4224
The following technologies are used:
@@ -46,7 +28,7 @@ The following technologies are used:
4628
- [fontastic](https://fontastic.me)
4729
- [electron](http://electronjs.org)
4830

49-
# Hacking on `tea/gui`
31+
# Hacking on `ossapp`
5032

5133
```sh
5234
xc setup # only required once
@@ -58,7 +40,7 @@ xc dev # opens the app in dev mode
5840
5941
&nbsp;
6042

61-
# Internationalization / Translations
43+
# i18n (Translating `ossapp`)
6244

6345
We’d love your help in translating the gui into different languages.
6446
The translation related source code are all in `./svelte/src/libs/translations/*`.
@@ -187,19 +169,6 @@ V="$(node -p "require('./package.json').version")"
187169
tea gh release create "v$V"
188170
```
189171

190-
&nbsp;
191-
192-
# Dependencies
193-
194-
[`tea/cli`] will automagically make these available to your environment.
195-
196-
| Project | Version |
197-
| ---------- | -------- |
198-
| nodejs.org | =18.16.0 |
199-
| npmjs.com | >=9.7.2 |
200-
| xcfile.dev | >=0.4.1 |
201-
| python.org | ^3.11 |
202-
203-
[`tea/cli`]: https://github.com/teaxyz/cli
172+
[`pkgx`]: https://github.com/pkgxdev/pkgx
204173
[`xc`]: https://xcfile.dev
205-
[discussion]: https://github.com/orgs/teaxyz/discussions
174+
[discussion]: https://github.com/orgs/pkgxdev/discussions

electron-builder.config.cjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const _ = require("lodash");
66
const appBundleId = "xyz.tea.gui";
77
module.exports = {
88
appId: appBundleId,
9-
productName: "tea",
9+
productName: "ossapp",
1010
asar: false,
1111
directories: { output: "dist" },
1212
files: ["electron/dist/electron.cjs", { from: "svelte/build", to: "" }],
@@ -22,7 +22,7 @@ module.exports = {
2222
minimumSystemVersion: "11"
2323
},
2424
dmg: {
25-
background: "./electron/bg.png",
25+
// background: "./electron/bg.png",
2626
window: {
2727
width: 684,
2828
height: 465

electron/Icons.icns

280 KB
Binary file not shown.

electron/icon.icns

-181 KB
Binary file not shown.

electron/libs/package.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import fs from "fs";
44
import log from "./logger";
55
import { getTeaPath } from "./tea-dir";
66
import { GUIPackage, Packages } from "../../svelte/src/libs/types";
7+
import { GUIBaseURL } from "../../svelte/src/libs/constants";
78
import { isDev } from "./auto-updater";
89

910
const pkgsFilePath = path.join(getTeaPath(), "tea.xyz/gui/pkgs.json");
@@ -45,7 +46,7 @@ export async function loadPackageCache(): Promise<Packages> {
4546
// possible user deletes cache files
4647
delete pkgs.packages[key].cached_image_url;
4748
if (rest.image_added_at) {
48-
const prefix = `https://gui.tea.xyz/${dev ? "dev" : "prod"}/${rest.full_name}`;
49+
const prefix = `https://${GUIBaseURL}/${dev ? "dev" : "prod"}/${rest.full_name}`;
4950
pkgs.packages[key].image_128_url = `${prefix}/128x128.webp`;
5051
pkgs.packages[key].image_512_url = `${prefix}/512x512.webp`;
5152
}

electron/libs/tea-dir.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from "path";
33
import { app } from "electron";
44
import log from "./logger";
55
import { defaultImgUrl, type InstalledPackage } from "../../svelte/src/libs/types";
6+
import { GUIBaseURL } from "../../svelte/src/libs/constants";
67
import { mkdirp } from "mkdirp";
78
import fetch from "node-fetch";
89
import { SemVer, semver } from "@teaxyz/lib";
@@ -195,7 +196,7 @@ async function downloadImage(url: string, imagePath: string): Promise<void> {
195196

196197
export async function cacheImage(url: string): Promise<string> {
197198
const imageFolder = path.join(getGuiPath(), "cached_images");
198-
let pkgFilePath = url.split("gui.tea.xyz")[1];
199+
let pkgFilePath = url.split(GUIBaseURL)[1] ?? "";
199200
//unfortunately we have prod in image url so strip it if it's present
200201
if (pkgFilePath.startsWith("/prod")) {
201202
pkgFilePath = pkgFilePath.replace("/prod", "");

electron/libs/v1-client.ts

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export async function getHeaders(path: string, session: Session) {
9393

9494
export async function syncLogsAt(prefix: string) {
9595
const logDir = path.join(app.getPath("home"), "Library/Logs/tea");
96-
// ['/Users/neil/Library/Logs/tea/main.log']
9796
const logFiles = await deepReadDir({ dir: logDir });
9897
const files = logFiles.map((p) => {
9998
const paths = p.split("/");

icon.png

-122 KB
Loading

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "tea",
3-
"version": "0.2.57",
2+
"name": "ossapp",
3+
"version": "0.3.0",
44
"private": true,
5-
"description": "tea gui app",
6-
"author": "tea.xyz",
5+
"description": "The Open Source App Store",
6+
"author": "pkgx inc. <[email protected]>",
77
"main": "electron/dist/electron.cjs",
88
"type": "module",
99
"scripts": {
@@ -145,6 +145,7 @@
145145
"xterm-addon-fit": "^0.7.0",
146146
"yaml": "^2.2.1"
147147
},
148-
"homepage": "https://tea.xyz",
149-
"repository": "https://github.com/teaxyz/gui.git"
148+
"homepage": "https://pkgx.app",
149+
"repository": "https://github.com/pkgxdev/ossapp.git",
150+
"tea": "node^18.16 npm^9.7.2 python^3.11 xc make"
150151
}

svelte/src/components/packages/packages.svelte

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
[SideMenuOptions.new_packages]: (pkg: GUIPackage) => {
5252
return moment(pkg.created_at).isAfter(moment().subtract(15, "days"));
5353
},
54-
[SideMenuOptions.made_by_tea]: (pkg: GUIPackage) => pkg.full_name.includes("tea.xyz"),
5554
[SideMenuOptions.local]: (pkg: GUIPackage) => !!pkg.is_local
5655
};
5756

svelte/src/components/profile-banner/profile-banner.svelte

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { authStore } from "$libs/stores";
44
55
const { user } = authStore;
6-
// const authPage = `http://localhost:3000/v1/auth/user?device_id=${authStore.deviceId}`; // https://app.tea.xyz/v1/auth/user?device_id=device_id
76
</script>
87

98
{#if $user}

svelte/src/components/settings-menu/settings-menu.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
>
3838
<button
3939
class="outline-gray hover:bg-gray h-7 w-full p-1 text-left outline-1 hover:bg-opacity-25 hover:outline"
40-
on:click={() => shellOpenExternal("https://docs.tea.xyz")}
40+
on:click={() => shellOpenExternal("https://docs.pkgx.dev")}
4141
>
4242
docs
4343
</button>

svelte/src/components/side-menu/side-menu.svelte

-6
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@
7373
on:click={() => goto(`/?tab=${SideMenuOptions.recently_updated}`)}
7474
/>
7575
<hr />
76-
<MenuButton
77-
label={$t("tags.made_by_tea").toLowerCase()}
78-
icon="tea-logo-iconasset-1"
79-
active={activeOption === SideMenuOptions.made_by_tea}
80-
on:click={() => goto(`/?tab=${SideMenuOptions.made_by_tea}`)}
81-
/>
8276
{#if hasLocalPackages}
8377
<MenuButton
8478
label={$t("tags.local_packages").toLowerCase()}

svelte/src/components/top-bar/login-button.svelte

+2-29
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,10 @@
11
<script lang="ts">
22
import { authStore } from "$libs/stores";
3-
import { getSession } from "@native";
4-
import { getBaseURL } from "$libs/v1-client";
5-
import { shellOpenExternal, pollDeviceSession } from "@native";
63
import mouseLeaveDelay from "$components/lib/mouse-leave-delay";
74
const { user } = authStore;
85
9-
$: authenticating = false;
10-
116
$: isLogoutOpen = false;
127
13-
const openGithub = async () => {
14-
if (!authenticating) {
15-
authenticating = true;
16-
try {
17-
const session = await getSession();
18-
19-
if (session && session.device_id) {
20-
const baseUrl = await getBaseURL();
21-
shellOpenExternal(`${baseUrl}/v1/auth/user?device_id=${session.device_id}`);
22-
pollDeviceSession();
23-
} else {
24-
throw new Error("possible no internet connection");
25-
}
26-
} catch (error) {
27-
console.error(error);
28-
} finally {
29-
authenticating = false;
30-
}
31-
}
32-
isLogoutOpen = false;
33-
};
34-
358
const logout = () => authStore.clearSession();
369
3710
const preventDoubleClick = (evt: MouseEvent) => evt.stopPropagation();
@@ -66,14 +39,14 @@
6639
</div>
6740
</div>
6841
{:else}
69-
<button
42+
<!-- <button
7043
class="border-gray text-gray h-[28px] w-[120px] rounded-sm border px-1 text-sm transition-all hover:bg-[#e1e1e1] hover:text-black"
7144
class:animate-pulse={authenticating}
7245
on:click={openGithub}
7346
on:dblclick={preventDoubleClick}
7447
>
7548
log in
76-
</button>
49+
</button> -->
7750
{/if}
7851

7952
<style>

svelte/src/components/top-bar/top-bar.svelte

+23-9
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,19 @@
1212
let { nextPath, prevPath } = navStore;
1313
1414
let dev = false;
15+
1516
onMount(async () => {
1617
dev = await isDev();
1718
});
19+
20+
let imgsrc = "Default";
21+
22+
function hover() {
23+
imgsrc = "Hover";
24+
}
25+
function mouseout() {
26+
imgsrc = "Default";
27+
}
1828
</script>
1929

2030
<header
@@ -25,7 +35,13 @@
2535
<ul class="text-gray flex h-10 items-center gap-1 pl-20 align-middle leading-10">
2636
<a href="/?tab=discover" data-testid="home-button">
2737
<div class="home-btn w-12 text-center text-2xl">
28-
<i class="icon-tea-logo-iconasset-1" />
38+
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
39+
<img
40+
src="/images/home-btn/State={imgsrc}.svg"
41+
alt="home"
42+
on:mouseover={hover}
43+
on:mouseout={mouseout}
44+
/>
2945
</div>
3046
</a>
3147
<p class="text-gray px-2">{dev ? "dev" : "beta"}</p>
@@ -76,18 +92,16 @@
7692
width: 46px;
7793
line-height: 46px;
7894
padding-left: 3px;
79-
background-size: cover;
80-
background-position: center center;
81-
background-image: url("/images/gradient-bg.png");
82-
color: #222222;
83-
}
84-
85-
.home-btn:hover {
86-
color: white;
8795
}
8896
p {
8997
font-size: 10px;
9098
}
99+
.home-btn img {
100+
display: inline;
101+
}
102+
.home-btn img:hover {
103+
display: inline;
104+
}
91105
92106
.home-btn:active {
93107
color: #222222;

svelte/src/libs/constants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const GUIBaseURL = "gui.pkgx.dev";

svelte/src/libs/packages/pkg-utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import log from "$libs/logger";
22
import { PackageStates, type GUIPackage } from "$libs/types";
33
import SemVer from "@teaxyz/lib/semver";
44
import { t } from "$libs/translations";
5+
import { GUIBaseURL } from "$libs/constants";
56

67
// Find a list of available versions for a package based on the bottles
78
export const findAvailableVersions = (pkg: Pick<GUIPackage, "bottles" | "version">) => {
@@ -100,7 +101,7 @@ export const newLocalPackage = (
100101
installed_versions: string[],
101102
dev: boolean
102103
): GUIPackage => {
103-
const prefix = `https://gui.tea.xyz/${dev ? "dev" : "prod"}/localplaceholder`;
104+
const prefix = `https://${GUIBaseURL}/${dev ? "dev" : "prod"}/localplaceholder`;
104105

105106
return {
106107
full_name: full_name,

svelte/src/libs/repo.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Contributor, GUIPackage, Package } from "$libs/types";
33
import yaml from "js-yaml";
44
import { isDev } from "@native";
55
import log from "./logger";
6+
import { GUIBaseURL } from "./constants";
67
export async function getPackageYaml(pkgYamlUrl: string) {
78
const url = pkgYamlUrl.replace("/github.com", "/raw.githubusercontent.com").replace("/blob", "");
89

@@ -20,7 +21,7 @@ export async function getReadme(
2021
let data = "";
2122
try {
2223
const stage = (await isDev()) ? "dev" : "prod";
23-
const reqHTML = await axios.get(`https://gui.tea.xyz/${stage}/${pkg.full_name!}/readme.html`);
24+
const reqHTML = await axios.get(`https://${GUIBaseURL}/${stage}/${pkg.full_name!}/readme.html`);
2425
if (reqHTML.status === 200 && reqHTML.data) {
2526
return {
2627
data: reqHTML.data,

0 commit comments

Comments
 (0)