Skip to content

Commit b927eb2

Browse files
committed
Add top-level JS files for importmap compatibility
1 parent 9ff4f36 commit b927eb2

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.github/workflows/cdn-deploy.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ jobs:
184184
gsub(/LIT_VERSION/, version);
185185
print
186186
}' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/lit-redirect.html.template > cdn/lit/index.html
187+
188+
# Create JavaScript redirect file for importmap compatibility
189+
awk -v version="$LIT_VERSION" '{
190+
gsub(/\${VERSION}/, version);
191+
print
192+
}' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/package-root-js.template > cdn/lit/index.js
187193
188194
# Get Lit dependencies using the script
189195
echo "Processing Lit dependencies..."
@@ -219,6 +225,12 @@ jobs:
219225
gsub(/\${PACKAGE_NAME}/, pkgname);
220226
print
221227
}' scripts/helpers/latest-redirect.html.template > "cdn/$dep/index.html"
228+
229+
# Create JavaScript redirect file for importmap compatibility
230+
awk -v version="$DEP_VERSION" '{
231+
gsub(/\${VERSION}/, version);
232+
print
233+
}' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/package-root-js.template > "cdn/$dep/index.js"
222234
fi
223235
done
224236
@@ -300,6 +312,12 @@ jobs:
300312
gsub(/\${PACKAGE_NAME}/, pkgname);
301313
print
302314
}' scripts/helpers/latest-redirect.html.template > cdn/@semantic-ui/core/index.html
315+
316+
# Create JavaScript redirect file for importmap compatibility
317+
awk -v version="$CORE_VERSION" '{
318+
gsub(/\${VERSION}/, version);
319+
print
320+
}' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/package-root-js.template > cdn/@semantic-ui/core/index.js
303321
304322
# Create redirects for each package
305323
cd packages
@@ -316,6 +334,12 @@ jobs:
316334
gsub(/\${PACKAGE_NAME}/, pkgname);
317335
print
318336
}' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/latest-redirect.html.template > "../cdn/@semantic-ui/$package_name/index.html"
337+
338+
# Create JavaScript redirect file for importmap compatibility
339+
awk -v version="$pkg_version" '{
340+
gsub(/\${VERSION}/, version);
341+
print
342+
}' $GITHUB_WORKSPACE/scripts/assets/templates/cdn/package-root-js.template > "../cdn/@semantic-ui/$package_name/index.js"
319343
done
320344
cd ..
321345
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Redirect to the latest version
2+
// This file is designed to work with import maps
3+
export * from './${VERSION}/index.js';

0 commit comments

Comments
 (0)