From 7c6fa9101637cb4cbe3bec8958a273aa071905a1 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Tue, 19 Nov 2024 14:15:11 -0800 Subject: [PATCH] Fix copyfiles for docsite (#1321) --- .github/workflows/build-helper.yml | 32 ------------------- Taskfile.yml | 9 +++--- electron-builder.config.cjs | 8 ----- .../app/notification/notificationbubbles.tsx | 5 ++- 4 files changed, 7 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build-helper.yml b/.github/workflows/build-helper.yml index 0ab3c5d81..a38ea73d5 100644 --- a/.github/workflows/build-helper.yml +++ b/.github/workflows/build-helper.yml @@ -12,33 +12,8 @@ on: env: GO_VERSION: "1.22" NODE_VERSION: 22 - STATIC_DOCSITE_PATH: docsite jobs: - build-docsite: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: ${{env.NODE_VERSION}} - - name: Install Yarn - run: | - corepack enable - yarn install - - name: Install Task - uses: arduino/setup-task@v2 - with: - version: 3.x - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Build embedded docsite - run: task docsite:build:embedded - - name: Upload Build Artifact - uses: actions/upload-artifact@v4 - with: - name: docsite - path: docsite build-app: - needs: build-docsite outputs: version: ${{ steps.set-version.outputs.WAVETERM_VERSION }} strategy: @@ -131,19 +106,12 @@ jobs: smctl windows certsync shell: cmd - - name: Download embedded docsite - uses: actions/download-artifact@v4 - with: - name: docsite - path: ${{env.STATIC_DOCSITE_PATH}} - # Build and upload packages - name: Build (Linux) if: matrix.platform == 'linux' run: task package env: USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one. - STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}} SNAPCRAFT_BUILD_ENVIRONMENT: host - name: Build (Darwin) if: matrix.platform == 'darwin' diff --git a/Taskfile.yml b/Taskfile.yml index 99fa57b11..1f4ae791c 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -77,17 +77,17 @@ tasks: - storybook:build docsite:build:embedded: - desc: Build the embedded docsite and copy it to ./docsite + desc: Build the embedded docsite and copy it to dist/docsite sources: - "docs/*" - "docs/src/**/*" - "docs/docs/**/*" - "docs/static/**/*" generates: - - "docsite/**/*" + - "dist/docsite/**/*" cmds: - cd docs && yarn build-embedded - - task: copyfiles:'docs/build':'../docsite' + - task: copyfiles:'docs/build':'dist/docsite' deps: - yarn @@ -99,6 +99,7 @@ tasks: - yarn build:prod && yarn electron-builder -c electron-builder.config.cjs -p never deps: - yarn + - docsite:build:embedded - build:backend build:backend: @@ -350,4 +351,4 @@ tasks: copyfiles:*:*: desc: Recursively copy directory and its contents. internal: true - cmd: '{{if eq OS "windows"}}powershell Copy-Item -Recurse -Force -Path {{index .MATCH 0}} -Destination {{index .MATCH 1}}{{else}}cp -r {{index .MATCH 0}} {{index .MATCH 1}}{{end}}' + cmd: '{{if eq OS "windows"}}powershell Copy-Item -Recurse -Force -Path {{index .MATCH 0}} -Destination {{index .MATCH 1}}{{else}}mkdir -p "$(dirname {{index .MATCH 1}})" && cp -r {{index .MATCH 0}} {{index .MATCH 1}}{{end}}' diff --git a/electron-builder.config.cjs b/electron-builder.config.cjs index 5017ba87c..35cc31946 100644 --- a/electron-builder.config.cjs +++ b/electron-builder.config.cjs @@ -109,14 +109,6 @@ const config = { provider: "generic", url: "https://dl.waveterm.dev/releases-w2", }, - beforePack: () => { - const staticSourcePath = process.env.STATIC_DOCSITE_PATH; - const staticDestPath = "dist/docsite"; - if (staticSourcePath) { - console.log(`Static docsite path is specified, copying from "${staticSourcePath}" to "${staticDestPath}"`); - fs.cpSync(staticSourcePath, staticDestPath, { recursive: true }); - } - }, afterPack: (context) => { // This is a workaround to restore file permissions to the wavesrv binaries on macOS after packaging the universal binary. if (context.electronPlatformName === "darwin" && context.arch === Arch.universal) { diff --git a/frontend/app/notification/notificationbubbles.tsx b/frontend/app/notification/notificationbubbles.tsx index 159703c18..8b18af102 100644 --- a/frontend/app/notification/notificationbubbles.tsx +++ b/frontend/app/notification/notificationbubbles.tsx @@ -3,14 +3,13 @@ import { atoms } from "@/store/global"; import { FloatingPortal, useFloating, useInteractions } from "@floating-ui/react"; +import clsx from "clsx"; import { useAtomValue } from "jotai"; import { useEffect, useState } from "react"; +import "./notificationbubbles.less"; import { NotificationItem } from "./notificationitem"; import { useNotification } from "./usenotification"; -import clsx from "clsx"; -import "./notificationBubbles.less"; - const NotificationBubbles = () => { const { notifications,