Skip to content

Commit

Permalink
chore: Release v0.2.8-beta.0 (#2246)
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod authored Dec 19, 2024
2 parents 91724cd + 626db9a commit e00d952
Show file tree
Hide file tree
Showing 87 changed files with 1,011 additions and 497 deletions.
75 changes: 0 additions & 75 deletions .github/workflows/build-render.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ jobs:
KEYCHAIN_PATH: ${{ runner.temp }}/app-signing.keychain-db
run: npm exec turbo run //#build:macos

- name: Build Renderer
if: matrix.os == 'ubuntu-latest'
run: pnpm build:render
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

- name: Upload file
uses: actions/upload-artifact@v4
env:
Expand All @@ -133,6 +139,8 @@ jobs:
out/make/**/*.exe
out/make/**/*.AppImage
out/make/**/*.yml
dist/manifest.yml
dist/*.tar.gz
retention-days: 90

- name: Upload file (arm64.dmg)
Expand All @@ -157,6 +165,8 @@ jobs:
out/make/**/*.exe
out/make/**/*.AppImage
out/make/**/*.yml
dist/manifest.yml
dist/*.tar.gz
- run: npx changelogithub
if: github.ref_type == 'tag' || github.event.inputs.tag_version != ''
Expand All @@ -182,3 +192,5 @@ jobs:
out/make/**/*.exe
out/make/**/*.AppImage
out/make/**/*.yml
dist/manifest.yml
dist/*.tar.gz
22 changes: 21 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ If you prefer to develop in Electron, follow these steps:
pnpm run dev
```

> **Tip:** If you encounter login issues, copy the `better-auth.session_token` from your browser's cookies into the app.
> **Tip:** If you encounter login issues, copy the `__Secure-better-auth.session_token` from your browser's cookies into the app.
## Contribution Guidelines

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pnpm run dev
Since it is not very convenient to develop in Electron, the first way to develop and contribute is recommended at this stage.

> [!TIP]
> If you can't log in to the app, copy the `better-auth.session_token` in the cookie from your browser into the app.
> If you can't log in to the app, copy the `__Secure-better-auth.session_token` in the cookie from your browser into the app.
## 📝 License

Expand Down
3 changes: 2 additions & 1 deletion apps/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@openpanel/web": "1.0.1",
"@sentry/electron": "5.7.0",
"builder-util-runtime": "9.2.10",
"cookie-es": "^1.2.2",
"dompurify": "~3.2.2",
"electron-context-menu": "4.0.4",
"electron-log": "5.2.4",
Expand All @@ -41,7 +42,7 @@
"font-list": "1.5.1",
"i18next": "^24.0.5",
"js-yaml": "4.1.0",
"linkedom": "^0.18.5",
"linkedom": "^0.18.6",
"lowdb": "7.0.1",
"msedge-tts": "1.3.4",
"node-machine-id": "1.1.12",
Expand Down
23 changes: 14 additions & 9 deletions apps/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { callWindowExpose } from "@follow/shared/bridge"
import { APP_PROTOCOL } from "@follow/shared/constants"
import { env } from "@follow/shared/env"
import { imageRefererMatches, selfRefererMatches } from "@follow/shared/image"
import { parse } from "cookie-es"
import { app, BrowserWindow, session } from "electron"
import type { Cookie } from "electron/main"
import squirrelStartup from "electron-squirrel-startup"
Expand Down Expand Up @@ -194,16 +195,20 @@ function bootstrap() {

if (ck && apiURL) {
setBetterAuthSessionCookie(ck)
const cookie = atob(ck)
mainWindow.webContents.session.cookies.set({
url: apiURL,
name: cookie.split("=")[0],
value: cookie.split("=")[1],
secure: true,
httpOnly: true,
domain: new URL(apiURL).hostname,
sameSite: "no_restriction",
const cookie = parse(atob(ck))
Object.keys(cookie).forEach((name) => {
const value = cookie[name]
mainWindow.webContents.session.cookies.set({
url: apiURL,
name,
value,
secure: true,
httpOnly: true,
domain: new URL(apiURL).hostname,
sameSite: "no_restriction",
})
})

userId && (await callWindowExpose(mainWindow).clearIfLoginOtherAccount(userId))
mainWindow.reload()

Expand Down
1 change: 0 additions & 1 deletion apps/main/src/tipc/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/require-await */
import fs from "node:fs"
import fsp from "node:fs/promises"
import path from "node:path"
Expand Down
40 changes: 40 additions & 0 deletions apps/mobile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

app-example
ios
android
1 change: 0 additions & 1 deletion apps/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
"@follow/hooks": "workspace:*",
"@follow/logger": "workspace:*",
"@follow/models": "workspace:*",
"@follow/shared": "workspace:*",
"@follow/types": "workspace:*",
"@follow/utils": "workspace:*",
"@hono/node-server": "1.13.7",
Expand Down
2 changes: 1 addition & 1 deletion apps/renderer/src/atoms/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createAtomHooks } from "~/lib/jotai"

export type UpdaterStatus = "ready"
export type UpdaterStatusAtom = {
type: "app" | "renderer"
type: "app" | "renderer" | "pwa"
status: UpdaterStatus
} | null
export const [, , useUpdaterStatus, , getUpdaterStatus, setUpdaterStatus] = createAtomHooks(
Expand Down
3 changes: 2 additions & 1 deletion apps/renderer/src/components/common/Motion.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MotionProps } from "framer-motion"
import type { MotionProps, TargetAndTransition } from "framer-motion"
import { m as M } from "framer-motion"
import { createElement, forwardRef } from "react"

Expand All @@ -19,6 +19,7 @@ export const m: typeof M = new Proxy(M, {
if (props.exit) {
nextProps.exit = {
opacity: 0,
transition: (props.exit as TargetAndTransition).transition,
}
}

Expand Down
32 changes: 5 additions & 27 deletions apps/renderer/src/components/common/ReloadPrompt.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useEffect } from "react"
import { toast } from "sonner"
import { useRegisterSW } from "virtual:pwa-register/react"

import { setUpdaterStatus } from "~/atoms/updater"

// check for updates every hour
const period = 60 * 60 * 1000

export function ReloadPrompt() {
const {
// offlineReady: [offlineReady, setOfflineReady],
needRefresh: [needRefresh],
updateServiceWorker,
} = useRegisterSW({
Expand All @@ -24,33 +24,11 @@ export function ReloadPrompt() {
},
})

// const close = useCallback(() => {
// setOfflineReady(false)
// setNeedRefresh(false)
// }, [setNeedRefresh, setOfflineReady])

// useEffect(() => {
// if (offlineReady) {
// toast.info("App is ready to work offline", {
// action: {
// label: "Close",
// onClick: close,
// },
// duration: Infinity,
// })
// }
// }, [offlineReady, close])

useEffect(() => {
if (needRefresh) {
toast.info("New version available", {
action: {
label: "Refresh",
onClick: () => {
updateServiceWorker(true)
},
},
duration: Infinity,
setUpdaterStatus({
type: "pwa",
status: "ready",
})
}
}, [needRefresh, updateServiceWorker])
Expand Down
28 changes: 28 additions & 0 deletions apps/renderer/src/components/ui/button/command-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { ActionButtonProps } from "@follow/components/ui/button/action-button.js"
import { ActionButton } from "@follow/components/ui/button/action-button.js"
import { forwardRef } from "react"

import { useCommand } from "~/modules/command/hooks/use-command"
import type { FollowCommandId } from "~/modules/command/types"

export interface CommandActionButtonProps extends ActionButtonProps {
commandId: FollowCommandId
onClick: () => void
}
export const CommandActionButton = forwardRef<HTMLButtonElement, CommandActionButtonProps>(
(props, ref) => {
const command = useCommand(props.commandId)
if (!command) return null
const { icon, label } = command

return (
<ActionButton
ref={ref}
{...props}
icon={icon}
onClick={props.onClick}
tooltip={label.title}
/>
)
},
)
24 changes: 10 additions & 14 deletions apps/renderer/src/components/ux/transition/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ const createIconTransition =
exit={exit}
/>
) : (
cloneElement(icon1, {
className: cn(icon1ClassName, className),
key: "1",
initial,
animate,
exit,
})
<m.span key="1" initial={initial} animate={animate} exit={exit}>
{cloneElement(icon1, {
className: cn(icon1ClassName, className),
})}
</m.span>
)
) : typeof icon2 === "string" ? (
<m.i
Expand All @@ -61,13 +59,11 @@ const createIconTransition =
exit={exit}
/>
) : (
cloneElement(icon2, {
className: cn(icon2ClassName, className),
key: "2",
initial,
animate,
exit,
})
<m.span key="2" initial={initial} animate={animate} exit={exit}>
{cloneElement(icon2, {
className: cn(icon2ClassName, className),
})}
</m.span>
)}
</AnimatePresence>
)
Expand Down
Loading

0 comments on commit e00d952

Please sign in to comment.