Skip to content

Commit 7a5d337

Browse files
committed
fix: install plugin from tarball when yalc fails
Problem: Yalc link was broken but package.json still referenced it, causing Strapi to fail loading the plugin. Solution: When yalc fails, create a tarball of the built plugin and install it as a real dependency using 'yarn add'. This guarantees the plugin is in node_modules where Strapi can find it. Workflow: - Try yalc (fast if it works) - If yalc fails → pack plugin + install tarball (reliable) - Tests can now load the plugin successfully
1 parent 59ec98c commit 7a5d337

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ jobs:
4545
4646
# Check if yalc succeeded
4747
if [ ! -d "playground/.yalc/strapi-plugin-config-sync" ]; then
48-
echo "Yalc failed, using yarn link as fallback"
49-
# Use yarn link instead
50-
yarn link
48+
echo "Yalc failed, installing from tarball as fallback"
49+
# Create tarball and install it
50+
yarn pack --filename plugin.tgz
5151
cd playground
52-
yarn link strapi-plugin-config-sync
52+
# Remove yalc link from package.json and install from tarball
53+
npm pkg delete dependencies.strapi-plugin-config-sync
54+
yarn add ../plugin.tgz
55+
else
56+
cd playground
57+
yarn install --unsafe-perm
5358
fi
54-
- name: Install dependencies playground
55-
run: cd playground && yarn install --unsafe-perm
5659
- name: Build playground
5760
run: yarn playground:build
5861
# - name: Run unit tests

0 commit comments

Comments
 (0)