From 9ef096fd9cca048cdda31d41f113650e2c6a25a3 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 11 Sep 2024 13:42:29 -0300 Subject: [PATCH 1/3] chore: publish preview github pages (#33248) --- .github/workflows/ci-preview.yml | 44 +++++++++++++++++++++++ .gitignore | 2 ++ _templates/package/new/package.json.ejs.t | 1 + apps/uikit-playground/package.json | 3 +- turbo.json | 8 +++++ 5 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-preview.yml diff --git a/.github/workflows/ci-preview.yml b/.github/workflows/ci-preview.yml new file mode 100644 index 000000000000..18b4b0bef373 --- /dev/null +++ b/.github/workflows/ci-preview.yml @@ -0,0 +1,44 @@ +# .github/workflows/ci-preview.yml +name: Deploy PR previews +concurrency: preview-${{ github.ref }} +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed + push: + branches: + - main + - master + - develop +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: rharkor/caching-for-turbo@v1.5 + if: github.event.action != 'closed' + + - name: Setup NodeJS + uses: ./.github/actions/setup-node + if: github.event.action != 'closed' + with: + node-version: 14.21.3 + cache-modules: true + install: true + + - name: Build + if: github.event.action != 'closed' + run: | + yarn turbo run build-preview + yarn turbo run .:build-preview-move + + - uses: rossjrw/pr-preview-action@v1 + with: + source-dir: .preview + preview-branch: gh-pages + umbrella-dir: pr-preview + action: auto diff --git a/.gitignore b/.gitignore index 4e6e4bb29da9..dbad2c29a22c 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,8 @@ yarn-error.log* .history .envrc +.preview + *.sublime-workspace **/.vim/ diff --git a/_templates/package/new/package.json.ejs.t b/_templates/package/new/package.json.ejs.t index 6bee52f55927..b2827ee3fb89 100644 --- a/_templates/package/new/package.json.ejs.t +++ b/_templates/package/new/package.json.ejs.t @@ -19,6 +19,7 @@ to: packages/<%= name %>/package.json "test": "jest", "build": "rm -rf dist && tsc -p tsconfig.json", "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput" + "build-preview": "mkdir -p ../../.preview && cp -r ./dist ../../.preview/<%= name.toLowerCase() %>" }, "main": "./dist/index.js", "typings": "./dist/index.d.ts", diff --git a/apps/uikit-playground/package.json b/apps/uikit-playground/package.json index d309c2d54599..233e71b719e5 100644 --- a/apps/uikit-playground/package.json +++ b/apps/uikit-playground/package.json @@ -5,7 +5,8 @@ "type": "module", "scripts": { "dev": "vite", - "build": "tsc && vite build", + "build-preview": "tsc && vite build", + ".:build-preview-move": "mkdir -p ../../.preview/ && cp -r ./dist ../../.preview/uikit-playground", "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview" }, diff --git a/turbo.json b/turbo.json index 7ce868eb3707..0ae903f9250d 100644 --- a/turbo.json +++ b/turbo.json @@ -2,6 +2,14 @@ "$schema": "https://turborepo.org/schema.json", "globalDependencies": ["tsconfig.base.json", "tsconfig.base.server.json", "tsconfig.base.client.json"], "tasks": { + "build-preview": { + "dependsOn": ["^build"], + "outputs": ["storybook-static/**", ".storybook/**", "dist/**"] + }, + ".:build-preview-move": { + "dependsOn": ["^build-preview"], + "cache": false + }, "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] From fa8ac7aeaf5403720c2004cbae93a2ef3df51b78 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Wed, 11 Sep 2024 15:22:23 -0300 Subject: [PATCH 2/3] fix: Infinite loading when uploading a private app (#33181) --- .changeset/wet-hats-walk.md | 5 +++++ .../client/views/marketplace/hooks/useInstallApp.tsx | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/wet-hats-walk.md diff --git a/.changeset/wet-hats-walk.md b/.changeset/wet-hats-walk.md new file mode 100644 index 000000000000..4c3565e75523 --- /dev/null +++ b/.changeset/wet-hats-walk.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed issue that caused an infinite loading state when uploading a private app to Rocket.Chat diff --git a/apps/meteor/client/views/marketplace/hooks/useInstallApp.tsx b/apps/meteor/client/views/marketplace/hooks/useInstallApp.tsx index f10d3e989e0a..3b784e24c375 100644 --- a/apps/meteor/client/views/marketplace/hooks/useInstallApp.tsx +++ b/apps/meteor/client/views/marketplace/hooks/useInstallApp.tsx @@ -114,8 +114,11 @@ export const useInstallApp = (file: File, url: string): { install: () => void; i }; const extractManifestFromAppFile = async (appFile: File) => { - const manifest = await getManifestFromZippedApp(appFile); - return manifest; + try { + return getManifestFromZippedApp(appFile); + } catch (error) { + handleInstallError(error as Error); + } }; const install = async () => { @@ -158,6 +161,7 @@ export const useInstallApp = (file: File, url: string): { install: () => void; i handleEnableUnlimitedApps={() => { openExternalLink(manageSubscriptionUrl); setModal(null); + setInstalling(false); }} />, ); From cfc84ab29f8304e56858309e7ed14291f246634b Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 11 Sep 2024 17:35:47 -0300 Subject: [PATCH 3/3] chore: add index to preview page (#33261) Co-authored-by: Diego Sampaio --- ...iew.yml => ci-deploy-gh-pages-preview.yml} | 7 +--- .github/workflows/ci-deploy-gh-pages.yml | 38 +++++++++++++++++++ 2 files changed, 40 insertions(+), 5 deletions(-) rename .github/workflows/{ci-preview.yml => ci-deploy-gh-pages-preview.yml} (91%) create mode 100644 .github/workflows/ci-deploy-gh-pages.yml diff --git a/.github/workflows/ci-preview.yml b/.github/workflows/ci-deploy-gh-pages-preview.yml similarity index 91% rename from .github/workflows/ci-preview.yml rename to .github/workflows/ci-deploy-gh-pages-preview.yml index 18b4b0bef373..17f247ddad94 100644 --- a/.github/workflows/ci-preview.yml +++ b/.github/workflows/ci-deploy-gh-pages-preview.yml @@ -8,11 +8,7 @@ on: - reopened - synchronize - closed - push: - branches: - - main - - master - - develop + jobs: deploy-preview: runs-on: ubuntu-latest @@ -35,6 +31,7 @@ jobs: run: | yarn turbo run build-preview yarn turbo run .:build-preview-move + npx indexifier .preview --html --extensions .html > .preview/index.html - uses: rossjrw/pr-preview-action@v1 with: diff --git a/.github/workflows/ci-deploy-gh-pages.yml b/.github/workflows/ci-deploy-gh-pages.yml new file mode 100644 index 000000000000..b381e05ae5d8 --- /dev/null +++ b/.github/workflows/ci-deploy-gh-pages.yml @@ -0,0 +1,38 @@ +# .github/workflows/ci-preview-deploy.yml +name: Deploy GitHub Pages +concurrency: preview-deploy-${{ github.ref }} +on: + push: + branches: + - main + - master + - develop +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: rharkor/caching-for-turbo@v1.5 + + - name: Setup NodeJS + uses: ./.github/actions/setup-node + with: + node-version: 14.21.3 + cache-modules: true + install: true + + - name: Build + run: | + yarn turbo run build-preview + yarn turbo run .:build-preview-move + npx indexifier .preview --html --extensions .html > .preview/index.html + mv .preview ${{ github.ref_name }} + mkdir .preview + mv ${{ github.ref_name }} .preview + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: .preview + keep_files: true