diff --git a/.github/workflows/build-sign-notarize.yml b/.github/workflows/build-sign-notarize.yml index 7166242..be23de3 100644 --- a/.github/workflows/build-sign-notarize.yml +++ b/.github/workflows/build-sign-notarize.yml @@ -29,6 +29,8 @@ jobs: is-updated: ${{ steps.check_version.outputs.updated }} steps: - uses: teaxyz/setup@v0 + with: + version: 0.35.7 - uses: actions/checkout@v3 with: fetch-depth: 5 @@ -69,7 +71,7 @@ jobs: steps: - uses: teaxyz/setup@v0 with: - version: 0.31.2 + version: 0.35.7 - uses: actions/checkout@v3 - name: cache node_modules build @@ -164,7 +166,7 @@ jobs: steps: - uses: teaxyz/setup@v0 with: - version: 0.31.2 + version: 0.35.7 - uses: actions/checkout@v3 - run: rm -rf ./*.{dmg,zip} || true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a64b216..f5e5b0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,16 +45,26 @@ jobs: no preview or changes related to UI test: needs: changes - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: teaxyz/setup@v0 with: - version: 0.31.2 + version: 0.35.7 - uses: actions/checkout@v3 + # - name: cache node_modules build + # uses: actions/cache@v3 + # with: + # key: test-ubuntu + # path: | + # ./pnpm + # ./.pnpm-store + # ./node_modules + # ./modules/desktop/node_modules + # ./modules/ui/node_modules - name: cache node_modules build uses: actions/cache@v3 with: - key: test-ubuntu + key: test-mac path: | ./pnpm ./.pnpm-store @@ -84,7 +94,7 @@ jobs: steps: - uses: teaxyz/setup@v0 with: - version: 0.31.2 + version: 0.35.7 - uses: actions/checkout@v3 - name: cache node_modules build uses: actions/cache@v3 @@ -105,21 +115,26 @@ jobs: env: CSC_IDENTITY_AUTO_DISCOVERY: "false" MAC_BUILD_TARGET: "dir" + - name: setup dev + run: | + mkdir -p /Users/runner/.tea/tea.xyz/gui + touch /Users/runner/.tea/tea.xyz/gui/dev - name: e2e test run: tea -E xc e2e build_svelte: needs: changes - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: teaxyz/setup@v0 with: - version: 0.31.2 + version: 0.35.7 - uses: actions/checkout@v3 - name: cache node_modules build uses: actions/cache@v3 with: - key: ubuntu-latest-pnpm + # key: ubuntu-latest-pnpm + key: mac-latest-pnpm path: | ./pnpm ./.pnpm-store @@ -129,7 +144,8 @@ jobs: - name: cache electron build uses: actions/cache@v3 with: - key: ubuntu-latest-electron + key: mac-latest-electron + # key: ubuntu-latest-electron path: | ./modules/desktop/.svelte-kit ./modules/desktop/build diff --git a/README.md b/README.md index d833517..da00615 100644 --- a/README.md +++ b/README.md @@ -182,10 +182,10 @@ tea gh release create "v$V" | Project | Version | |-----------------------------------|-----------| -| nodejs.org | =18.15.0 | -| pnpm.io | =7.18.2 | -| xcfile.dev | >=0.0.110 | -| python.org | ^3.10 | +| nodejs.org | =18.16.0 | +| pnpm.io | =7.33.1 | +| xcfile.dev | >=0.4.1 | +| python.org | ^3.11 | [`tea/cli`]: https://github.com/teaxyz/cli [`xc`]: https://xcfile.dev diff --git a/modules/desktop/electron/libs/auth.ts b/modules/desktop/electron/libs/auth.ts index 2ea1691..b0c38cb 100644 --- a/modules/desktop/electron/libs/auth.ts +++ b/modules/desktop/electron/libs/auth.ts @@ -9,6 +9,7 @@ import get from "./v1-client"; import { DeviceAuth } from "../../src/libs/types"; import { notifyMainWindow } from "../electron"; import { InitWatcher } from "./initialize"; +import { baseURL } from "./v1-client"; const sessionFilePath = path.join(getTeaPath(), "tea.xyz/gui/tmp.dat"); const sessionFolder = path.join(getTeaPath(), "tea.xyz/gui"); @@ -75,7 +76,7 @@ let deviceIdRetryCount = 0; async function getDeviceId() { let deviceId = ""; try { - const req = await axios.get<{ deviceId: string }>("https://api.tea.xyz/v1/auth/registerDevice"); + const req = await axios.get<{ deviceId: string }>(`${baseURL}/v1/auth/registerDevice`); deviceId = req.data.deviceId; } catch (error) { log.error(error); diff --git a/modules/desktop/electron/libs/v1-client.ts b/modules/desktop/electron/libs/v1-client.ts index 8974438..98d7898 100644 --- a/modules/desktop/electron/libs/v1-client.ts +++ b/modules/desktop/electron/libs/v1-client.ts @@ -7,10 +7,11 @@ import { createReadStream, statSync } from "fs"; import { deepReadDir } from "./tea-dir"; import fetch from "node-fetch"; import { hooks } from "@teaxyz/lib"; +import { isDev } from "./auto-updater"; import { readSessionData, type Session } from "./auth"; -const base = "https://api.tea.xyz"; +export const baseURL = isDev() ? "https://app.dev.tea.xyz" : "https://app.tea.xyz"; const publicHeader = { Authorization: "public" }; export async function get(urlPath: string) { try { @@ -22,7 +23,7 @@ export async function get(urlPath: string) { ? await getHeaders(`GET/${urlPath}`, session) : publicHeader; - const url = new URL(path.join("v1", urlPath), base).toString(); + const url = new URL(path.join("v1", urlPath), baseURL).toString(); // TODO: add headers const req = await axios.request({ method: "GET", @@ -49,7 +50,7 @@ export async function post(urlPath: string, data: { [key: string]: any }) { ? await getHeaders(`GET/${urlPath}`, session) : publicHeader; - const url = new URL(path.join("v1", urlPath), base).toString(); + const url = new URL(path.join("v1", urlPath), baseURL).toString(); const req = await axios.request({ method: "POST", url, diff --git a/modules/desktop/package.json b/modules/desktop/package.json index cbaaee3..64960e4 100644 --- a/modules/desktop/package.json +++ b/modules/desktop/package.json @@ -1,6 +1,6 @@ { "name": "tea", - "version": "0.2.24", + "version": "0.2.25", "private": true, "description": "tea gui app", "author": "tea.xyz", @@ -83,6 +83,8 @@ }, "type": "module", "dependencies": { + "@deno/shim-crypto": "^0.3.1", + "@deno/shim-deno": "^0.16.1", "@electron/asar": "^3.2.3", "@sentry/browser": "^7.49.0", "@sentry/electron": "^4.4.0", @@ -107,19 +109,23 @@ "electron-vite": "^1.0.18", "electron-window-state": "^5.0.3", "fuse.js": "^6.6.2", + "is-what": "^4.1.15", "js-yaml": "^4.1.0", + "koffi": "^2.4.2", "lodash": "^4.17.21", "lorem-ipsum": "^2.0.8", "mixpanel-browser": "^2.45.0", "mkdirp": "^2.1.3", "moment": "^2.29.4", "mousetrap": "^1.6.5", + "outdent": "^0.8.0", "pushy-electron": "^1.0.11", "renderer": "link:@types/electron/renderer", "svelte-infinite-scroll": "^2.0.1", "svelte-markdown": "^0.2.3", "svelte-watch-resize": "^1.0.3", "sveltekit-i18n": "^2.2.2", + "undici": "^5.22.1", "upath": "^2.0.1", "vite-plugin-static-copy": "^0.13.1", "yaml": "^2.2.1" diff --git a/modules/desktop/src/components/profile-banner/profile-banner.svelte b/modules/desktop/src/components/profile-banner/profile-banner.svelte index f6c1370..e0de03b 100644 --- a/modules/desktop/src/components/profile-banner/profile-banner.svelte +++ b/modules/desktop/src/components/profile-banner/profile-banner.svelte @@ -3,7 +3,7 @@ import { authStore } from "$libs/stores"; const { user } = authStore; - // const authPage = `http://localhost:3000/v1/auth/user?device_id=${authStore.deviceId}`; // https://api.tea.xyz/v1/auth/user?device_id=device_id + // const authPage = `http://localhost:3000/v1/auth/user?device_id=${authStore.deviceId}`; // https://app.tea.xyz/v1/auth/user?device_id=device_id {#if $user} diff --git a/modules/desktop/src/components/top-bar/login-button.svelte b/modules/desktop/src/components/top-bar/login-button.svelte index 7cd7e66..c6d7695 100644 --- a/modules/desktop/src/components/top-bar/login-button.svelte +++ b/modules/desktop/src/components/top-bar/login-button.svelte @@ -1,7 +1,7 @@