-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
to make it easier for cdns like unpkg to work with RHDS, we copy the lightdom css files into the root, avoiding the need to load assets from `@rhds/elements/elements`
- Loading branch information
1 parent
cb71745
commit 319778f
Showing
4 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
"@rhds/elements": patch | ||
--- | ||
Copies lightdom CSS files into the package root, making it easier to use RHDS with CDNS like UNPKG. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ test-results.xml | |
rhds.min.js | ||
*LEGAL.txt | ||
*.tgz | ||
# copied lightdom shims | ||
rh-* | ||
|
||
# e2e | ||
test-results | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { cp, mkdir } from 'node:fs/promises'; | ||
import { dirname } from 'node:path'; | ||
import { glob } from 'glob'; | ||
import chalk from 'chalk' | ||
|
||
for (const srcFile of await glob([ | ||
'elements/*/*-lightdom.css', | ||
'elements/*/*-shim.css', | ||
])) { | ||
const destFile = srcFile.replace('elements/', ''); | ||
await mkdir(dirname(destFile)); | ||
await cp(srcFile, destFile); | ||
console.log(`${chalk.blue`Copied`} ${srcFile} to ${destFile}`); | ||
} |