chore: desktop dir (#2924)
* chore: desktop dir * chore: desktop src and configs * chore: auto-fix linting and formatting issues * fix: path * fix: path * fix: path * fix: path * fix * fix * fix * test * test * test * test * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix --------- Co-authored-by: DIYgod <8266075+DIYgod@users.noreply.github.com>
This commit is contained in:
parent
8f422af1c1
commit
8b07a9a573
14
.env.example
14
.env.example
|
|
@ -1,14 +0,0 @@
|
|||
VITE_WEB_URL=http://localhost:5173
|
||||
VITE_API_URL=http://localhost:3000
|
||||
VITE_IMGPROXY_URL=http://localhost:2873
|
||||
VITE_SENTRY_DSN=
|
||||
VITE_BUILD_TYPE=production
|
||||
VITE_INBOXES_EMAIL=@follow.re
|
||||
VITE_OPENPANEL_CLIENT_ID=
|
||||
VITE_OPENPANEL_API_URL=
|
||||
|
||||
EXPO_PUBLIC_API_URL=https://api.follow.is
|
||||
EXPO_PUBLIC_OPENPANEL_CLIENT_ID=
|
||||
EXPO_PUBLIC_OPENPANEL_API_URL=
|
||||
|
||||
VITE_EDITOR=cursor
|
||||
|
|
@ -42,4 +42,4 @@ jobs:
|
|||
run: pnpm install
|
||||
- name: Build web and SSR server
|
||||
run: |
|
||||
npm exec turbo run //#build:web @follow/server#build
|
||||
npm exec turbo run @follow/desktop#build:web @follow/server#build
|
||||
|
|
|
|||
|
|
@ -122,10 +122,12 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: pnpm i
|
||||
- name: Update main hash
|
||||
run: pnpm update:main-hash
|
||||
run: |
|
||||
cd apps/desktop
|
||||
pnpm update:main-hash
|
||||
- name: Build
|
||||
if: matrix.os != 'macos-latest'
|
||||
run: npm exec turbo run //#build
|
||||
run: pnpm build:electron
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
|
||||
|
|
@ -141,7 +143,7 @@ jobs:
|
|||
with:
|
||||
max_attempts: 3
|
||||
timeout_minutes: 10
|
||||
command: npm exec turbo run //#build:macos
|
||||
command: pnpm build:macos
|
||||
|
||||
- name: Build (Mac App Store)
|
||||
if: matrix.os == 'macos-latest' && github.event.inputs.mas == 'true'
|
||||
|
|
@ -150,7 +152,7 @@ jobs:
|
|||
OSX_SIGN_IDENTITY: ${{ secrets.OSX_SIGN_IDENTITY_MAS }}
|
||||
OSX_SIGN_PROVISIONING_PROFILE_PATH: ${{ runner.temp }}/build_pp.provisionprofile
|
||||
BUILD_VERSION: ${{ github.event.inputs.build_version }}
|
||||
run: npm exec turbo run //#build:mas
|
||||
run: pnpm build:mas
|
||||
|
||||
- name: Build Renderer
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
|
|
@ -166,14 +168,14 @@ jobs:
|
|||
with:
|
||||
name: ${{ matrix.os }}
|
||||
path: |
|
||||
out/make/**/*.dmg
|
||||
out/make/**/*.zip
|
||||
out/make/**/*.exe
|
||||
out/make/**/*.AppImage
|
||||
out/make/**/*.yml
|
||||
out/make/**/*.pkg
|
||||
dist/manifest.yml
|
||||
dist/*.tar.gz
|
||||
apps/desktop/out/make/**/*.dmg
|
||||
apps/desktop/out/make/**/*.zip
|
||||
apps/desktop/out/make/**/*.exe
|
||||
apps/desktop/out/make/**/*.AppImage
|
||||
apps/desktop/out/make/**/*.yml
|
||||
apps/desktop/out/make/**/*.pkg
|
||||
apps/desktop/dist/manifest.yml
|
||||
apps/desktop/dist/*.tar.gz
|
||||
retention-days: 90
|
||||
|
||||
- name: Upload file (arm64.dmg)
|
||||
|
|
@ -184,7 +186,7 @@ jobs:
|
|||
with:
|
||||
name: macos-arm64-dmg
|
||||
path: |
|
||||
out/make/**/*arm64.dmg
|
||||
apps/desktop/out/make/**/*arm64.dmg
|
||||
retention-days: 90
|
||||
|
||||
- name: Upload file (pkg)
|
||||
|
|
@ -204,13 +206,13 @@ jobs:
|
|||
uses: actions/attest-build-provenance@v1
|
||||
with:
|
||||
subject-path: |
|
||||
out/make/**/*.dmg
|
||||
out/make/**/*.zip
|
||||
out/make/**/*.exe
|
||||
out/make/**/*.AppImage
|
||||
out/make/**/*.yml
|
||||
dist/manifest.yml
|
||||
dist/*.tar.gz
|
||||
apps/desktop/out/make/**/*.dmg
|
||||
apps/desktop/out/make/**/*.zip
|
||||
apps/desktop/out/make/**/*.exe
|
||||
apps/desktop/out/make/**/*.AppImage
|
||||
apps/desktop/out/make/**/*.yml
|
||||
apps/desktop/dist/manifest.yml
|
||||
apps/desktop/dist/*.tar.gz
|
||||
|
||||
- run: npx changelogithub
|
||||
if: github.ref_type == 'tag' || github.event.inputs.tag_version == 'true'
|
||||
|
|
@ -231,10 +233,10 @@ jobs:
|
|||
prerelease: true
|
||||
tag_name: v${{ steps.version.outputs.APP_VERSION }}
|
||||
files: |
|
||||
out/make/**/*.dmg
|
||||
out/make/**/*.zip
|
||||
out/make/**/*.exe
|
||||
out/make/**/*.AppImage
|
||||
out/make/**/*.yml
|
||||
dist/manifest.yml
|
||||
dist/*.tar.gz
|
||||
apps/desktop/out/make/**/*.dmg
|
||||
apps/desktop/out/make/**/*.zip
|
||||
apps/desktop/out/make/**/*.exe
|
||||
apps/desktop/out/make/**/*.AppImage
|
||||
apps/desktop/out/make/**/*.yml
|
||||
apps/desktop/dist/manifest.yml
|
||||
apps/desktop/dist/*.tar.gz
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ vite.config.*.mjs
|
|||
.generated
|
||||
.turbo
|
||||
|
||||
apps/renderer/dev-dist
|
||||
apps/desktop/src/renderer/dev-dist
|
||||
tsconfig.tsbuildinfo
|
||||
|
||||
apps/mobile/ios
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@
|
|||
],
|
||||
"tailwindCSS.experimental.configFile": {
|
||||
"apps/mobile/tailwind.config.ts": "apps/mobile/**",
|
||||
"apps/server/tailwind.config.ts": "apps/server/**",
|
||||
"tailwind.config.ts": ["!apps/mobile/**", "!apps/server/**", "**"]
|
||||
"apps/desktop/src/server/tailwind.config.ts": "apps/desktop/src/server/**",
|
||||
"tailwind.config.ts": ["!apps/mobile/**", "!apps/desktop/src/server/**", "**"]
|
||||
},
|
||||
"typescript.tsserver.maxTsServerMemory": 8096,
|
||||
"typescript.tsserver.nodePath": "node",
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@ export default {
|
|||
|
||||
plugins: [...viteRenderBaseConfig.plugins, createPlatformSpecificImportPlugin("electron")],
|
||||
|
||||
root: resolve(root, "apps/renderer"),
|
||||
root: resolve(root, "src/renderer"),
|
||||
build: {
|
||||
outDir: resolve(root, "dist/renderer"),
|
||||
sourcemap: !!process.env.CI,
|
||||
target: "esnext",
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: resolve(root, "apps/renderer/index.html"),
|
||||
main: resolve(root, "src/renderer/index.html"),
|
||||
},
|
||||
},
|
||||
minify: true,
|
||||
|
|
@ -7,12 +7,12 @@ import react from "@vitejs/plugin-react"
|
|||
import { prerelease } from "semver"
|
||||
import type { UserConfig } from "vite"
|
||||
|
||||
import { getGitHash } from "../../../scripts/lib"
|
||||
import { astPlugin } from "../plugins/vite/ast"
|
||||
import { circularImportRefreshPlugin } from "../plugins/vite/hmr"
|
||||
import { customI18nHmrPlugin } from "../plugins/vite/i18n-hmr"
|
||||
import { localesPlugin } from "../plugins/vite/locales"
|
||||
import i18nCompleteness from "../plugins/vite/utils/i18n-completeness"
|
||||
import { getGitHash } from "../scripts/lib"
|
||||
|
||||
const pkgDir = resolve(dirname(fileURLToPath(import.meta.url)), "..")
|
||||
const pkg = JSON.parse(readFileSync(resolve(pkgDir, "./package.json"), "utf8"))
|
||||
|
|
@ -33,10 +33,10 @@ const changelogFile = getChangelogFileContent()
|
|||
export const viteRenderBaseConfig = {
|
||||
resolve: {
|
||||
alias: {
|
||||
"~": resolve("apps/renderer/src"),
|
||||
"~": resolve("src/renderer/src"),
|
||||
"@pkg": resolve("package.json"),
|
||||
"@locales": resolve("locales"),
|
||||
"@follow/electron-main": resolve("apps/main/src"),
|
||||
"@follow/electron-main": resolve("src/main/src"),
|
||||
},
|
||||
},
|
||||
base: "/",
|
||||
|
|
@ -81,7 +81,7 @@ export const viteRenderBaseConfig = {
|
|||
],
|
||||
define: {
|
||||
APP_VERSION: JSON.stringify(pkg.version),
|
||||
APP_NAME: JSON.stringify(pkg.name),
|
||||
APP_NAME: JSON.stringify(pkg.productName),
|
||||
APP_DEV_CWD: JSON.stringify(process.cwd()),
|
||||
|
||||
GIT_COMMIT_SHA: JSON.stringify(process.env.VERCEL_GIT_COMMIT_SHA || getGitHash()),
|
||||
|
|
@ -2,17 +2,17 @@ import { resolve } from "node:path"
|
|||
|
||||
import { defineConfig } from "electron-vite"
|
||||
|
||||
import { getGitHash } from "../../scripts/lib"
|
||||
import { viteRenderBaseConfig } from "./configs/vite.render.config"
|
||||
import { cleanupUnnecessaryFilesPlugin } from "./plugins/vite/cleanup"
|
||||
import { createPlatformSpecificImportPlugin } from "./plugins/vite/specific-import"
|
||||
import { getGitHash } from "./scripts/lib"
|
||||
|
||||
export default defineConfig({
|
||||
main: {
|
||||
build: {
|
||||
outDir: "dist/main",
|
||||
lib: {
|
||||
entry: "./apps/main/src/index.ts",
|
||||
entry: "./src/main/src/index.ts",
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
|
|
@ -20,7 +20,7 @@ export default defineConfig({
|
|||
"@shared": resolve("packages/shared/src"),
|
||||
"@pkg": resolve("./package.json"),
|
||||
"@locales": resolve("./locales"),
|
||||
"~": resolve("./apps/main/src"),
|
||||
"~": resolve("./src/main/src"),
|
||||
},
|
||||
},
|
||||
define: {
|
||||
|
|
@ -32,7 +32,7 @@ export default defineConfig({
|
|||
build: {
|
||||
outDir: "dist/preload",
|
||||
lib: {
|
||||
entry: "./apps/main/preload/index.ts",
|
||||
entry: "./src/main/preload/index.ts",
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
|
|
@ -45,14 +45,14 @@ export default defineConfig({
|
|||
renderer: {
|
||||
...viteRenderBaseConfig,
|
||||
|
||||
root: "apps/renderer",
|
||||
root: "src/renderer",
|
||||
build: {
|
||||
outDir: "dist/renderer",
|
||||
sourcemap: !!process.env.CI,
|
||||
target: "esnext",
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: resolve("./apps/renderer/index.html"),
|
||||
main: resolve("./src/renderer/index.html"),
|
||||
},
|
||||
},
|
||||
minify: true,
|
||||
|
|
@ -74,7 +74,7 @@ async function cleanSources(buildPath, _electronVersion, platform, _arch, callba
|
|||
return
|
||||
}
|
||||
return cp(
|
||||
path.join(process.cwd(), "node_modules", item),
|
||||
path.join(process.cwd(), "../../node_modules", item),
|
||||
path.join(buildPath, "node_modules", item),
|
||||
{
|
||||
recursive: true,
|
||||
|
|
@ -241,7 +241,7 @@ const config: ForgeConfig = {
|
|||
result.artifacts = result.artifacts.map((artifact) => {
|
||||
if (artifactRegex.test(artifact)) {
|
||||
const newArtifact = `${path.dirname(artifact)}/${
|
||||
result.packageJSON.name
|
||||
result.packageJSON.productName
|
||||
}-${result.packageJSON.version}-${
|
||||
platformNamesMap[result.platform]
|
||||
}-${result.arch}${path.extname(artifact)}`
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue