Skip to content

Commit

Permalink
fix: self-host vendor assets instead of using a CDN
Browse files Browse the repository at this point in the history
  • Loading branch information
amtrack committed Jul 2, 2024
1 parent 7584d5d commit 117e359
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 4 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
"author": "Matthias Rolke <[email protected]>",
"license": "MIT",
"devDependencies": {
"@salesforce-ux/design-system": "2.24.5",
"gridjs": "6.2.0",
"p-limit": "5.0.0",
"serve": "14.2.3"
},
"scripts": {
"build:vendor": "bash scripts/build.sh",
"build": "./scripts/get-plugins.js && ./scripts/add-github-repo-infos.js && ./scripts/get-commands.js && ./scripts/meta.js && ./scripts/minify.js",
"develop": "serve ./site",
"start": "serve ./site"
Expand Down
7 changes: 7 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -eo pipefail

cp node_modules/@salesforce-ux/design-system/assets/styles/salesforce-lightning-design-system.min.css site/vendor/
cp node_modules/@salesforce-ux/design-system/assets/icons/utility-sprite/svg/symbols.svg site/vendor/
cp node_modules/gridjs/dist/gridjs.module.js site/vendor/
2 changes: 1 addition & 1 deletion site/components/faq.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ customElements.define(
class="slds-accordion__summary-action-icon slds-button__icon slds-button__icon_left"
aria-hidden="true"
>
<use xlink:href="./symbols.svg#switch"></use></svg
<use xlink:href="./vendor/symbols.svg#switch"></use></svg
>` + summary.innerHTML;
summary.classList.add("slds-accordion__summary-heading");
}
Expand Down
4 changes: 2 additions & 2 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="description" content="" />
<link
href="https://unpkg.com/@salesforce-ux/[email protected]/assets/styles/salesforce-lightning-design-system.min.css"
href="./vendor/salesforce-lightning-design-system.min.css"
rel="stylesheet"
/>
<link href="./grid.css" rel="stylesheet" />
Expand Down Expand Up @@ -182,7 +182,7 @@ <h2 class="slds-m-bottom_small">FAQ</h2>
class="slds-icon slds-icon_small slds-icon-text-default"
aria-hidden="true"
>
<use xlink:href="./symbols.svg#info"></use>
<use xlink:href="./vendor/symbols.svg#info"></use>
</svg>
<span class="slds-assistive-text">information</span>
</span>
Expand Down
2 changes: 1 addition & 1 deletion site/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, Grid } from "https://unpkg.com/gridjs@6.2.0?module";
import { html, Grid } from "./vendor/gridjs.module.js";

const defaultGridSettings = {
sort: true,
Expand Down
2 changes: 2 additions & 0 deletions site/vendor/gridjs.module.js

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions site/vendor/salesforce-lightning-design-system.min.css

Large diffs are not rendered by default.

File renamed without changes
17 changes: 17 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# yarn lockfile v1


"@salesforce-ux/[email protected]":
version "2.24.5"
resolved "https://registry.yarnpkg.com/@salesforce-ux/design-system/-/design-system-2.24.5.tgz#d8dc0b480e0ebba420b046719286cc936ce02aa4"
integrity sha512-dyZU4BoeDiqBhOmsQnoOJd16eJCjuTlHtDsfciMqt4i9LVgk7bBRuL72M+xZxAvmUA8ZUcQZHHeg2l90wNE+FQ==

"@zeit/[email protected]":
version "2.36.0"
resolved "https://registry.yarnpkg.com/@zeit/schemas/-/schemas-2.36.0.tgz#7a1b53f4091e18d0b404873ea3e3c83589c765f2"
Expand Down Expand Up @@ -250,6 +255,13 @@ get-stream@^6.0.0:
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"
integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==

[email protected]:
version "6.2.0"
resolved "https://registry.yarnpkg.com/gridjs/-/gridjs-6.2.0.tgz#c04008d43e8426298a04ef8637cde1e787138514"
integrity sha512-EAGGfHjyEXWh12Txs6DjTGnWTo226wbowtMrLI+yNZQaJpvs0m7yDcyM7r+D4RA7rZQVj/cfmwEaRz/rlxg8LA==
dependencies:
preact "^10.11.3"

has-flag@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
Expand Down Expand Up @@ -399,6 +411,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.2.1.tgz#90b617025a16381a879bc82a38d4e8bdeb2bcf45"
integrity sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==

preact@^10.11.3:
version "10.22.1"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.22.1.tgz#6a3589973fe0c6e53211091607d31f4b7b27334d"
integrity sha512-jRYbDDgMpIb5LHq3hkI0bbl+l/TQ9UnkdQ0ww+lp+4MMOdqaUYdFc5qeyP+IV8FAd/2Em7drVPeKdQxsiWCf/A==

punycode@^1.3.2:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
Expand Down

0 comments on commit 117e359

Please sign in to comment.