refactor: new project struct (#8199)
packages/frontend/web -> packages/frontend/apps/web packages/frontend/mobile -> packages/frontend/apps/mobile packages/frontend/electron -> packages/frontend/apps/electron
@@ -43,7 +43,9 @@ const allPackages = [
|
|||||||
'packages/backend/server',
|
'packages/backend/server',
|
||||||
'packages/frontend/component',
|
'packages/frontend/component',
|
||||||
'packages/frontend/core',
|
'packages/frontend/core',
|
||||||
'packages/frontend/electron',
|
'packages/frontend/apps/electron',
|
||||||
|
'packages/frontend/apps/web',
|
||||||
|
'packages/frontend/apps/mobile',
|
||||||
'packages/frontend/graphql',
|
'packages/frontend/graphql',
|
||||||
'packages/frontend/i18n',
|
'packages/frontend/i18n',
|
||||||
'packages/frontend/native',
|
'packages/frontend/native',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
FROM openresty/openresty:1.25.3.2-0-buster
|
FROM openresty/openresty:1.25.3.2-0-buster
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY ./packages/frontend/web/dist ./dist
|
COPY ./packages/frontend/apps/web/dist ./dist
|
||||||
COPY ./packages/frontend/admin/dist ./admin
|
COPY ./packages/frontend/admin/dist ./admin
|
||||||
COPY ./packages/frontend/mobile/dist ./mobile
|
COPY ./packages/frontend/apps/mobile/dist ./mobile
|
||||||
COPY ./.github/deployment/front/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
|
COPY ./.github/deployment/front/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
|
||||||
COPY ./.github/deployment/front/affine.nginx.conf /etc/nginx/conf.d/affine.nginx.conf
|
COPY ./.github/deployment/front/affine.nginx.conf /etc/nginx/conf.d/affine.nginx.conf
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
FROM node:20-bookworm-slim
|
FROM node:20-bookworm-slim
|
||||||
|
|
||||||
COPY ./packages/backend/server /app
|
COPY ./packages/backend/server /app
|
||||||
COPY ./packages/frontend/web/dist /app/static
|
COPY ./packages/frontend/apps/web/dist /app/static
|
||||||
COPY ./packages/frontend/admin/dist /app/static/admin
|
COPY ./packages/frontend/admin/dist /app/static/admin
|
||||||
COPY ./packages/frontend/mobile/dist /app/static/mobile
|
COPY ./packages/frontend/apps/mobile/dist /app/static/mobile
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ app:core:
|
|||||||
app:electron:
|
app:electron:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/frontend/electron/**/*'
|
- 'packages/frontend/apps/electron/**/*'
|
||||||
|
|
||||||
app:server:
|
app:server:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: web
|
name: web
|
||||||
path: ./packages/frontend/web/dist
|
path: ./packages/frontend/apps/web/dist
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build-admin:
|
build-admin:
|
||||||
@@ -132,7 +132,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: mobile
|
name: mobile
|
||||||
path: ./packages/frontend/mobile/dist
|
path: ./packages/frontend/apps/mobile/dist
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build-web-selfhost:
|
build-web-selfhost:
|
||||||
@@ -159,7 +159,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: selfhost-web
|
name: selfhost-web
|
||||||
path: ./packages/frontend/web/dist
|
path: ./packages/frontend/apps/web/dist
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build-mobile-selfhost:
|
build-mobile-selfhost:
|
||||||
@@ -184,7 +184,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: selfhost-mobile
|
name: selfhost-mobile
|
||||||
path: ./packages/frontend/mobile/dist
|
path: ./packages/frontend/apps/mobile/dist
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
build-admin-selfhost:
|
build-admin-selfhost:
|
||||||
@@ -320,13 +320,13 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: web
|
name: web
|
||||||
path: ./packages/frontend/web/dist
|
path: ./packages/frontend/apps/web/dist
|
||||||
|
|
||||||
- name: Download mobile artifact
|
- name: Download mobile artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: mobile
|
name: mobile
|
||||||
path: ./packages/frontend/mobile/dist
|
path: ./packages/frontend/apps/mobile/dist
|
||||||
|
|
||||||
- name: Download admin artifact
|
- name: Download admin artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@@ -338,13 +338,13 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: selfhost-web
|
name: selfhost-web
|
||||||
path: ./packages/frontend/web/dist/selfhost
|
path: ./packages/frontend/apps/web/dist/selfhost
|
||||||
|
|
||||||
- name: Download selfhost mobile artifact
|
- name: Download selfhost mobile artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: selfhost-mobile
|
name: selfhost-mobile
|
||||||
path: ./packages/frontend/mobile/dist/selfhost
|
path: ./packages/frontend/apps/mobile/dist/selfhost
|
||||||
|
|
||||||
- name: Download selfhost admin artifact
|
- name: Download selfhost admin artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DISTRIBUTION: desktop
|
DISTRIBUTION: desktop
|
||||||
- name: zip web
|
- name: zip web
|
||||||
run: tar -czf dist.tar.gz --directory=packages/frontend/electron/renderer/dist .
|
run: tar -czf dist.tar.gz --directory=packages/frontend/apps/electron/renderer/dist .
|
||||||
- name: Upload web artifact
|
- name: Upload web artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -554,7 +554,7 @@ jobs:
|
|||||||
- name: Download web artifact
|
- name: Download web artifact
|
||||||
uses: ./.github/actions/download-web
|
uses: ./.github/actions/download-web
|
||||||
with:
|
with:
|
||||||
path: packages/frontend/electron/resources/web-static
|
path: packages/frontend/apps/electron/resources/web-static
|
||||||
|
|
||||||
- name: Build Desktop Layers
|
- name: Build Desktop Layers
|
||||||
run: yarn workspace @affine/electron build
|
run: yarn workspace @affine/electron build
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: web
|
name: web
|
||||||
path: packages/frontend/electron/resources/web-static
|
path: packages/frontend/apps/electron/resources/web-static
|
||||||
|
|
||||||
make-distribution:
|
make-distribution:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -119,7 +119,7 @@ jobs:
|
|||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: web
|
name: web
|
||||||
path: packages/frontend/electron/resources/web-static
|
path: packages/frontend/apps/electron/resources/web-static
|
||||||
|
|
||||||
- name: Build Desktop Layers
|
- name: Build Desktop Layers
|
||||||
run: yarn workspace @affine/electron build
|
run: yarn workspace @affine/electron build
|
||||||
@@ -146,20 +146,20 @@ jobs:
|
|||||||
- name: signing DMG
|
- name: signing DMG
|
||||||
if: ${{ matrix.spec.platform == 'darwin' }}
|
if: ${{ matrix.spec.platform == 'darwin' }}
|
||||||
run: |
|
run: |
|
||||||
codesign --force --sign "Developer ID Application: TOEVERYTHING PTE. LTD." packages/frontend/electron/out/${{ env.BUILD_TYPE }}/make/AFFiNE.dmg
|
codesign --force --sign "Developer ID Application: TOEVERYTHING PTE. LTD." packages/frontend/apps/electron/out/${{ env.BUILD_TYPE }}/make/AFFiNE.dmg
|
||||||
|
|
||||||
- name: Save artifacts (mac)
|
- name: Save artifacts (mac)
|
||||||
if: ${{ matrix.spec.platform == 'darwin' }}
|
if: ${{ matrix.spec.platform == 'darwin' }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p builds
|
mkdir -p builds
|
||||||
mv packages/frontend/electron/out/*/make/*.dmg ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.dmg
|
mv packages/frontend/apps/electron/out/*/make/*.dmg ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.dmg
|
||||||
mv packages/frontend/electron/out/*/make/zip/darwin/${{ matrix.spec.arch }}/*.zip ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.zip
|
mv packages/frontend/apps/electron/out/*/make/zip/darwin/${{ matrix.spec.arch }}/*.zip ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.zip
|
||||||
- name: Save artifacts (linux)
|
- name: Save artifacts (linux)
|
||||||
if: ${{ matrix.spec.platform == 'linux' }}
|
if: ${{ matrix.spec.platform == 'linux' }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p builds
|
mkdir -p builds
|
||||||
mv packages/frontend/electron/out/*/make/zip/linux/x64/*.zip ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.zip
|
mv packages/frontend/apps/electron/out/*/make/zip/linux/x64/*.zip ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.zip
|
||||||
mv packages/frontend/electron/out/*/make/*.AppImage ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.appimage
|
mv packages/frontend/apps/electron/out/*/make/*.AppImage ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.appimage
|
||||||
|
|
||||||
- uses: actions/attest-build-provenance@v1
|
- uses: actions/attest-build-provenance@v1
|
||||||
if: ${{ matrix.spec.platform == 'darwin' }}
|
if: ${{ matrix.spec.platform == 'darwin' }}
|
||||||
@@ -221,7 +221,7 @@ jobs:
|
|||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: web
|
name: web
|
||||||
path: packages/frontend/electron/resources/web-static
|
path: packages/frontend/apps/electron/resources/web-static
|
||||||
|
|
||||||
- name: Build Desktop Layers
|
- name: Build Desktop Layers
|
||||||
run: yarn workspace @affine/electron build
|
run: yarn workspace @affine/electron build
|
||||||
@@ -235,12 +235,12 @@ jobs:
|
|||||||
- name: get all files to be signed
|
- name: get all files to be signed
|
||||||
id: get_files_to_be_signed
|
id: get_files_to_be_signed
|
||||||
run: |
|
run: |
|
||||||
Set-Variable -Name FILES_TO_BE_SIGNED -Value ((Get-ChildItem -Path packages/frontend/electron/out -Recurse -File | Where-Object { $_.Extension -in @(".exe", ".node", ".dll", ".msi") } | ForEach-Object { '"' + $_.FullName.Replace((Get-Location).Path + '\packages\frontend\electron\out\', '') + '"' }) -join ' ')
|
Set-Variable -Name FILES_TO_BE_SIGNED -Value ((Get-ChildItem -Path packages/frontend/apps/electron/out -Recurse -File | Where-Object { $_.Extension -in @(".exe", ".node", ".dll", ".msi") } | ForEach-Object { '"' + $_.FullName.Replace((Get-Location).Path + '\packages\frontend\electron\out\', '') + '"' }) -join ' ')
|
||||||
"FILES_TO_BE_SIGNED=$FILES_TO_BE_SIGNED" >> $env:GITHUB_OUTPUT
|
"FILES_TO_BE_SIGNED=$FILES_TO_BE_SIGNED" >> $env:GITHUB_OUTPUT
|
||||||
echo $FILES_TO_BE_SIGNED
|
echo $FILES_TO_BE_SIGNED
|
||||||
|
|
||||||
- name: Zip artifacts for faster upload
|
- name: Zip artifacts for faster upload
|
||||||
run: Compress-Archive -CompressionLevel Fastest -Path packages/frontend/electron/out/* -DestinationPath archive.zip
|
run: Compress-Archive -CompressionLevel Fastest -Path packages/frontend/apps/electron/out/* -DestinationPath archive.zip
|
||||||
|
|
||||||
- name: Save packaged artifacts for signing
|
- name: Save packaged artifacts for signing
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -287,7 +287,7 @@ jobs:
|
|||||||
name: signed-packaged-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}
|
name: signed-packaged-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}
|
||||||
path: .
|
path: .
|
||||||
- name: unzip file
|
- name: unzip file
|
||||||
run: Expand-Archive -Path signed.zip -DestinationPath packages/frontend/electron/out
|
run: Expand-Archive -Path signed.zip -DestinationPath packages/frontend/apps/electron/out
|
||||||
|
|
||||||
- name: Make squirrel.windows installer
|
- name: Make squirrel.windows installer
|
||||||
run: yarn workspace @affine/electron make-squirrel --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
|
run: yarn workspace @affine/electron make-squirrel --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
|
||||||
@@ -296,12 +296,12 @@ jobs:
|
|||||||
run: yarn workspace @affine/electron make-nsis --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
|
run: yarn workspace @affine/electron make-nsis --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
|
||||||
|
|
||||||
- name: Zip artifacts for faster upload
|
- name: Zip artifacts for faster upload
|
||||||
run: Compress-Archive -CompressionLevel Fastest -Path packages/frontend/electron/out/${{ env.BUILD_TYPE }}/make/* -DestinationPath archive.zip
|
run: Compress-Archive -CompressionLevel Fastest -Path packages/frontend/apps/electron/out/${{ env.BUILD_TYPE }}/make/* -DestinationPath archive.zip
|
||||||
|
|
||||||
- name: get all files to be signed
|
- name: get all files to be signed
|
||||||
id: get_files_to_be_signed
|
id: get_files_to_be_signed
|
||||||
run: |
|
run: |
|
||||||
Set-Variable -Name FILES_TO_BE_SIGNED -Value ((Get-ChildItem -Path packages/frontend/electron/out/${{ env.BUILD_TYPE }}/make -Recurse -File | Where-Object { $_.Extension -in @(".exe", ".node", ".dll", ".msi") } | ForEach-Object { '"' + $_.FullName.Replace((Get-Location).Path + '\packages\frontend\electron\out\${{ env.BUILD_TYPE }}\make\', '') + '"' }) -join ' ')
|
Set-Variable -Name FILES_TO_BE_SIGNED -Value ((Get-ChildItem -Path packages/frontend/apps/electron/out/${{ env.BUILD_TYPE }}/make -Recurse -File | Where-Object { $_.Extension -in @(".exe", ".node", ".dll", ".msi") } | ForEach-Object { '"' + $_.FullName.Replace((Get-Location).Path + '\packages\frontend\electron\out\${{ env.BUILD_TYPE }}\make\', '') + '"' }) -join ' ')
|
||||||
"FILES_TO_BE_SIGNED=$FILES_TO_BE_SIGNED" >> $env:GITHUB_OUTPUT
|
"FILES_TO_BE_SIGNED=$FILES_TO_BE_SIGNED" >> $env:GITHUB_OUTPUT
|
||||||
echo $FILES_TO_BE_SIGNED
|
echo $FILES_TO_BE_SIGNED
|
||||||
|
|
||||||
@@ -335,14 +335,14 @@ jobs:
|
|||||||
name: signed-installer-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}
|
name: signed-installer-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}
|
||||||
path: .
|
path: .
|
||||||
- name: unzip file
|
- name: unzip file
|
||||||
run: Expand-Archive -Path signed.zip -DestinationPath packages/frontend/electron/out/${{ env.BUILD_TYPE }}/make
|
run: Expand-Archive -Path signed.zip -DestinationPath packages/frontend/apps/electron/out/${{ env.BUILD_TYPE }}/make
|
||||||
|
|
||||||
- name: Save artifacts
|
- name: Save artifacts
|
||||||
run: |
|
run: |
|
||||||
mkdir -p builds
|
mkdir -p builds
|
||||||
mv packages/frontend/electron/out/*/make/zip/win32/x64/AFFiNE*-win32-x64-*.zip ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.zip
|
mv packages/frontend/apps/electron/out/*/make/zip/win32/x64/AFFiNE*-win32-x64-*.zip ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.zip
|
||||||
mv packages/frontend/electron/out/*/make/squirrel.windows/x64/*.exe ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.exe
|
mv packages/frontend/apps/electron/out/*/make/squirrel.windows/x64/*.exe ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.exe
|
||||||
mv packages/frontend/electron/out/*/make/nsis.windows/x64/*.exe ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.nsis.exe
|
mv packages/frontend/apps/electron/out/*/make/nsis.windows/x64/*.exe ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.nsis.exe
|
||||||
|
|
||||||
- uses: actions/attest-build-provenance@v1
|
- uses: actions/attest-build-provenance@v1
|
||||||
with:
|
with:
|
||||||
@@ -394,7 +394,7 @@ jobs:
|
|||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Generate Release yml
|
- name: Generate Release yml
|
||||||
run: |
|
run: |
|
||||||
node ./packages/frontend/electron/scripts/generate-yml.js
|
node ./packages/frontend/apps/electron/scripts/generate-yml.js
|
||||||
env:
|
env:
|
||||||
RELEASE_VERSION: ${{ needs.before-make.outputs.RELEASE_VERSION }}
|
RELEASE_VERSION: ${{ needs.before-make.outputs.RELEASE_VERSION }}
|
||||||
- name: Create Release Draft
|
- name: Create Release Draft
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"workspaces": [
|
"workspaces": [
|
||||||
".",
|
".",
|
||||||
"packages/*/*",
|
"packages/*/*",
|
||||||
|
"packages/frontend/apps/*",
|
||||||
"tools/*",
|
"tools/*",
|
||||||
"docs/reference",
|
"docs/reference",
|
||||||
"tools/@types/*",
|
"tools/@types/*",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ yarn install
|
|||||||
yarn workspace @affine/native build
|
yarn workspace @affine/native build
|
||||||
yarn dev
|
yarn dev
|
||||||
|
|
||||||
# in packages/frontend/electron
|
# in packages/frontend/apps/electron
|
||||||
yarn generate-assets
|
yarn generate-assets
|
||||||
yarn dev # or yarn prod for production build
|
yarn dev # or yarn prod for production build
|
||||||
```
|
```
|
||||||
@@ -61,7 +61,6 @@
|
|||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
"glob": "^11.0.0",
|
"glob": "^11.0.0",
|
||||||
"jotai": "^2.8.0",
|
"jotai": "^2.8.0",
|
||||||
"jotai-devtools": "^0.10.0",
|
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"nanoid": "^5.0.7",
|
"nanoid": "^5.0.7",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
"name": "@affine/electron",
|
"name": "@affine/electron",
|
||||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"root": "packages/frontend/electron",
|
"root": "packages/frontend/apps/electron",
|
||||||
"sourceRoot": "packages/frontend/electron/src",
|
"sourceRoot": "packages/frontend/apps/electron/src",
|
||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "nx:run-script",
|
"executor": "nx:run-script",
|
||||||
@@ -30,8 +30,7 @@ import {
|
|||||||
getCurrentStore,
|
getCurrentStore,
|
||||||
LifecycleService,
|
LifecycleService,
|
||||||
} from '@toeverything/infra';
|
} from '@toeverything/infra';
|
||||||
import type { PropsWithChildren, ReactElement } from 'react';
|
import { Suspense } from 'react';
|
||||||
import { lazy, Suspense } from 'react';
|
|
||||||
import { RouterProvider } from 'react-router-dom';
|
import { RouterProvider } from 'react-router-dom';
|
||||||
|
|
||||||
const desktopWhiteList = [
|
const desktopWhiteList = [
|
||||||
@@ -55,19 +54,6 @@ if (
|
|||||||
const performanceI18nLogger = performanceLogger.namespace('i18n');
|
const performanceI18nLogger = performanceLogger.namespace('i18n');
|
||||||
const cache = createEmotionCache();
|
const cache = createEmotionCache();
|
||||||
|
|
||||||
const DevTools = lazy(() =>
|
|
||||||
import('jotai-devtools').then(m => ({ default: m.DevTools }))
|
|
||||||
);
|
|
||||||
|
|
||||||
const DebugProvider = ({ children }: PropsWithChildren): ReactElement => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Suspense>{process.env.DEBUG_JOTAI === 'true' && <DevTools />}</Suspense>
|
|
||||||
{children}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const future = {
|
const future = {
|
||||||
v7_startTransition: true,
|
v7_startTransition: true,
|
||||||
} as const;
|
} as const;
|
||||||
@@ -115,19 +101,17 @@ export function App() {
|
|||||||
<AffineContext store={getCurrentStore()}>
|
<AffineContext store={getCurrentStore()}>
|
||||||
<Telemetry />
|
<Telemetry />
|
||||||
<CustomThemeModifier />
|
<CustomThemeModifier />
|
||||||
<DebugProvider>
|
<GlobalLoading />
|
||||||
<GlobalLoading />
|
<RouterProvider
|
||||||
<RouterProvider
|
fallbackElement={<AppFallback />}
|
||||||
fallbackElement={<AppFallback />}
|
router={router}
|
||||||
router={router}
|
future={future}
|
||||||
future={future}
|
/>
|
||||||
/>
|
{environment.isWindows && (
|
||||||
{environment.isWindows && (
|
<div style={{ position: 'fixed', right: 0, top: 0, zIndex: 5 }}>
|
||||||
<div style={{ position: 'fixed', right: 0, top: 0, zIndex: 5 }}>
|
<WindowsAppControls />
|
||||||
<WindowsAppControls />
|
</div>
|
||||||
</div>
|
)}
|
||||||
)}
|
|
||||||
</DebugProvider>
|
|
||||||
</AffineContext>
|
</AffineContext>
|
||||||
</CacheProvider>
|
</CacheProvider>
|
||||||
</FrameworkRoot>
|
</FrameworkRoot>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../../../tsconfig.json",
|
"extends": "../../../../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
@@ -13,16 +13,16 @@
|
|||||||
},
|
},
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"path": "../../../common/env"
|
"path": "../../../../common/env"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "../../core"
|
"path": "../../../core"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "../../component"
|
"path": "../../../component"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "../../../common/infra"
|
"path": "../../../../common/infra"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"include": ["."],
|
"include": ["."],
|
||||||
|
Before Width: | Height: | Size: 249 KiB After Width: | Height: | Size: 249 KiB |
|
Before Width: | Height: | Size: 195 KiB After Width: | Height: | Size: 195 KiB |
|
Before Width: | Height: | Size: 761 KiB After Width: | Height: | Size: 761 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 805 KiB After Width: | Height: | Size: 805 KiB |