Skip to content

Commit 12ad858

Browse files
committed
refactor: add top level resolve symlinks script
1 parent b7e4c38 commit 12ad858

File tree

6 files changed

+25
-179
lines changed

6 files changed

+25
-179
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,7 @@ jobs:
183183
run: pnpm turbo run build --filter='!./workbench/*'
184184

185185
- name: Resolve symlinks
186-
run: |
187-
if [ -f "workbench/${{ matrix.app.name }}/resolve-symlinks.sh" ]; then
188-
cd workbench/${{ matrix.app.name }} && ./resolve-symlinks.sh
189-
fi
186+
run: ./scripts/resolve-symlinks.sh workbench/${{ matrix.app.name }}
190187

191188
- name: Run E2E Tests
192189
run: cd workbench/${{ matrix.app.name }} && pnpm dev & echo "starting tests in 10 seconds" && sleep 10 && pnpm vitest run packages/core/e2e/dev.test.ts && pnpm run test:e2e

workbench/nextjs-webpack/resolve-symlinks.sh renamed to scripts/resolve-symlinks.sh

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
#!/bin/bash
22
set -e
33

4-
# Script to recursively resolve all symlinks in the app directory
5-
# This is needed for CI where Next.js dev mode doesn't work well with symlinks
4+
# Script to recursively resolve all symlinks in a workbench directory
5+
# This is needed for CI where dev mode doesn't work well with symlinks
6+
#
7+
# Usage: ./scripts/resolve-symlinks.sh <workbench-directory>
8+
# Example: ./scripts/resolve-symlinks.sh workbench/nextjs-turbopack
9+
10+
# Check if directory argument is provided
11+
if [ -z "$1" ]; then
12+
echo "Error: No directory specified"
13+
echo "Usage: $0 <workbench-directory>"
14+
exit 1
15+
fi
16+
17+
TARGET_DIR="$1"
18+
19+
# Check if directory exists
20+
if [ ! -d "$TARGET_DIR" ]; then
21+
echo "Error: Directory '$TARGET_DIR' does not exist"
22+
exit 1
23+
fi
624

725
# Only run in CI
826
if [ -z "$CI" ]; then
@@ -11,6 +29,9 @@ if [ -z "$CI" ]; then
1129
exit 1
1230
fi
1331

32+
echo "Resolving symlinks in $TARGET_DIR..."
33+
cd "$TARGET_DIR"
34+
1435
echo "Resolving symlinked files in workflows directory..."
1536

1637
# Special handling for workflows directory if it's a symlink
@@ -84,4 +105,4 @@ git ls-files -z --cached --others --exclude-standard | xargs -0 -I {} sh -c 'tes
84105
fi
85106
done
86107

87-
echo "All symlinks resolved successfully!"
108+
echo "All symlinks resolved successfully in $TARGET_DIR!"

workbench/nextjs-turbopack/resolve-symlinks.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

workbench/nitro-v3/resolve-symlinks.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

workbench/nuxt/resolve-symlinks.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

workbench/sveltekit/resolve-symlinks.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)