From b7881700180b70c9b49301b2ab342d31ce92c818 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 3 Jun 2024 21:14:56 +0100 Subject: [PATCH 1/2] ci: use commit hash at time of release triggger --- .github/workflows/release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 7c0bbc3a86..5f128f7df6 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: - ref: refs/pull/${{ github.event.issue.number }}/merge + ref: ${{ github.event.issue.pull_request.head.sha }} fetch-depth: 0 - run: corepack enable From b6d797591d4702af354d4f8f59b601bac53dc7e0 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 3 Jun 2024 21:15:54 +0100 Subject: [PATCH 2/2] build(ui-templates): directly copy templates on build (#27430) --- packages/nuxt/.gitignore | 6 ++++++ packages/nuxt/src/app/components/error-404.vue | 1 - packages/nuxt/src/app/components/error-500.vue | 1 - packages/nuxt/src/app/components/error-dev.vue | 1 - packages/nuxt/src/app/components/welcome.vue | 1 - packages/nuxt/src/core/runtime/nitro/error-500.ts | 1 - packages/nuxt/src/core/runtime/nitro/error-dev.ts | 1 - packages/ui-templates/lib/render.ts | 10 ++++++++++ 8 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 packages/nuxt/.gitignore delete mode 120000 packages/nuxt/src/app/components/error-404.vue delete mode 120000 packages/nuxt/src/app/components/error-500.vue delete mode 120000 packages/nuxt/src/app/components/error-dev.vue delete mode 120000 packages/nuxt/src/app/components/welcome.vue delete mode 120000 packages/nuxt/src/core/runtime/nitro/error-500.ts delete mode 120000 packages/nuxt/src/core/runtime/nitro/error-dev.ts diff --git a/packages/nuxt/.gitignore b/packages/nuxt/.gitignore new file mode 100644 index 0000000000..95c0486757 --- /dev/null +++ b/packages/nuxt/.gitignore @@ -0,0 +1,6 @@ +src/app/components/error-404.vue +src/app/components/error-500.vue +src/app/components/error-dev.vue +src/app/components/welcome.vue +src/core/runtime/nitro/error-500.ts +src/core/runtime/nitro/error-dev.ts diff --git a/packages/nuxt/src/app/components/error-404.vue b/packages/nuxt/src/app/components/error-404.vue deleted file mode 120000 index c2b73ea4bf..0000000000 --- a/packages/nuxt/src/app/components/error-404.vue +++ /dev/null @@ -1 +0,0 @@ -../../../../ui-templates/dist/templates/error-404.vue \ No newline at end of file diff --git a/packages/nuxt/src/app/components/error-500.vue b/packages/nuxt/src/app/components/error-500.vue deleted file mode 120000 index 8d3d1c8b9d..0000000000 --- a/packages/nuxt/src/app/components/error-500.vue +++ /dev/null @@ -1 +0,0 @@ -../../../../ui-templates/dist/templates/error-500.vue \ No newline at end of file diff --git a/packages/nuxt/src/app/components/error-dev.vue b/packages/nuxt/src/app/components/error-dev.vue deleted file mode 120000 index b793df3c2f..0000000000 --- a/packages/nuxt/src/app/components/error-dev.vue +++ /dev/null @@ -1 +0,0 @@ -../../../../ui-templates/dist/templates/error-dev.vue \ No newline at end of file diff --git a/packages/nuxt/src/app/components/welcome.vue b/packages/nuxt/src/app/components/welcome.vue deleted file mode 120000 index e2e9ab51e4..0000000000 --- a/packages/nuxt/src/app/components/welcome.vue +++ /dev/null @@ -1 +0,0 @@ -../../../../ui-templates/dist/templates/welcome.vue \ No newline at end of file diff --git a/packages/nuxt/src/core/runtime/nitro/error-500.ts b/packages/nuxt/src/core/runtime/nitro/error-500.ts deleted file mode 120000 index 7c4f86d19f..0000000000 --- a/packages/nuxt/src/core/runtime/nitro/error-500.ts +++ /dev/null @@ -1 +0,0 @@ -../../../../../ui-templates/dist/templates/error-500.ts \ No newline at end of file diff --git a/packages/nuxt/src/core/runtime/nitro/error-dev.ts b/packages/nuxt/src/core/runtime/nitro/error-dev.ts deleted file mode 120000 index b14fdaa625..0000000000 --- a/packages/nuxt/src/core/runtime/nitro/error-dev.ts +++ /dev/null @@ -1 +0,0 @@ -../../../../../ui-templates/dist/templates/error-dev.ts \ No newline at end of file diff --git a/packages/ui-templates/lib/render.ts b/packages/ui-templates/lib/render.ts index 34ba7c189c..27f0c3bf4a 100644 --- a/packages/ui-templates/lib/render.ts +++ b/packages/ui-templates/lib/render.ts @@ -1,5 +1,6 @@ import { fileURLToPath } from 'node:url' import { readFileSync, rmdirSync, unlinkSync, writeFileSync } from 'node:fs' +import { copyFile } from 'node:fs/promises' import { basename, dirname, join, resolve } from 'pathe' import type { Plugin } from 'vite' // @ts-expect-error https://github.com/GoogleChromeLabs/critters/pull/151 @@ -167,6 +168,15 @@ export const RenderPlugin = () => { unlinkSync(fileName) rmdirSync(dirname(fileName)) } + + // we manually copy files across rather than using symbolic links for better windows support + const nuxtRoot = r('../nuxt') + for (const file of ['error-404.vue', 'error-500.vue', 'error-dev.vue', 'welcome.vue']) { + await copyFile(r(`dist/templates/${file}`), join(nuxtRoot, 'src/app/components', file)) + } + for (const file of ['error-500.ts', 'error-dev.ts']) { + await copyFile(r(`dist/templates/${file}`), join(nuxtRoot, 'src/core/runtime/nitro', file)) + } }, } }