Skip to content

Commit a7aa565

Browse files
committed
Merge tag 'v2.16.1' of github.com:salesforce-ux/design-system-internal
Accommodates addition of CODEOWNERS file 2.16.1
2 parents 2708297 + bde3ce6 commit a7aa565

File tree

384 files changed

+99932
-57002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+99932
-57002
lines changed

.circleci/config.yml

Lines changed: 119 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
version: 2.1
66

77
orbs:
8-
node: circleci/node@4.0.1
8+
node: circleci/node@4.3.0
99
heroku: circleci/[email protected]
10-
aws-s3: circleci/[email protected]
1110
browser-tools: circleci/[email protected]
1211

1312
executors:
@@ -37,9 +36,15 @@ commands:
3736
name: 'Decompress design-tokens'
3837
command: 'tar -xvf workspace/design-tokens.tar'
3938

39+
set-github-pr-number:
40+
description: 'Set Github pull-request number environment variable'
41+
steps:
42+
- run: echo 'export PR_NUMBER=$(cat workspace/gh-pr-num.txt)' >> $BASH_ENV
43+
4044
set-heroku-app-name:
4145
description: 'Set Heroku app name environment variable'
4246
steps:
47+
- set-github-pr-number
4348
# if on default branch without a tag
4449
# then publish to UPCOMING
4550
#
@@ -58,26 +63,32 @@ commands:
5863
if [[ "${CIRCLE_BRANCH}" = "${CURRENT_DEFAULT_BRANCH}" ]] ; then
5964
echo "Publishing to UPCOMING..."
6065
echo 'export HEROKU_APP_NAME=${HEROKU_APP_UPCOMING}' >> $BASH_ENV
66+
echo 'export HEROKU_RELEASE_STORYBOOK_APP_NAME=storybook-upcoming' >> $BASH_ENV
6167
elif [[ ${CIRCLE_TAG} =~ ^v[0-9]+\.[0-9]+\.[0-9]+-.+$ ]] ; then
6268
echo "Publishing to CORE-MAIN..."
6369
echo 'export HEROKU_APP_NAME=${HEROKU_APP_CORE_MAIN}' >> $BASH_ENV
70+
echo 'export HEROKU_RELEASE_STORYBOOK_APP_NAME=storybook-core-main' >> $BASH_ENV
6471
elif [[ ${CIRCLE_TAG} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then
6572
echo "Publishing to CORE-PATCH..."
6673
echo 'export HEROKU_APP_NAME=${HEROKU_APP_CORE_PATCH}' >> $BASH_ENV
74+
echo 'export HEROKU_RELEASE_STORYBOOK_APP_NAME=storybook-core-patch' >> $BASH_ENV
6775
else
6876
echo "Publishing to pull-request review app..."
69-
echo 'export HEROKU_APP_NAME=slds-review-site-pr-${CIRCLE_PULL_REQUEST##*/}' >> $BASH_ENV
77+
echo 'export HEROKU_APP_NAME=slds-review-site-pr-${PR_NUMBER}' >> $BASH_ENV
78+
echo 'export HEROKU_RELEASE_STORYBOOK_APP_NAME=true' >> $BASH_ENV
7079
fi
71-
echo 'export HEROKU_RELEASE_STORYBOOK_APP_NAME=${HEROKU_APP_NAME}' >> $BASH_ENV
7280
source $BASH_ENV
7381
echo $HEROKU_APP_NAME > workspace/heroku-app-name.txt
7482
echo $HEROKU_RELEASE_STORYBOOK_APP_NAME > workspace/heroku-release-storybook-app-name.txt
7583
84+
- run: printenv | sort
85+
7686
- run:
7787
name: Show HEROKU_APP_NAME value
7888
command: |
89+
echo "gh-pr-num.txt = $(cat workspace/gh-pr-num.txt)"
7990
echo
80-
echo "CIRCLE_PULL_REQUEST = ${CIRCLE_PULL_REQUEST}"
91+
echo "PR_NUMBER = ${PR_NUMBER}"
8192
echo
8293
echo "=============================="
8394
cat workspace/heroku-app-name.txt
@@ -92,6 +103,7 @@ commands:
92103
- attach_workspace:
93104
at: workspace
94105

106+
- node/install-npm
95107
- vrt-set-env-vars
96108
- add-applitools
97109
- node/install-packages
@@ -105,15 +117,17 @@ commands:
105117
vrt-set-env-vars:
106118
description: 'Set VRT environment variables'
107119
steps:
120+
- set-github-pr-number
121+
- run: printenv | sort
122+
108123
- run:
109124
name: 'Set environment variables'
110125
command: |
111126
echo 'export APPLITOOLS_BATCH_ID=${CIRCLE_SHA1}' >> $BASH_ENV
112-
echo 'export APPLITOOLS_BATCH_NAME="PR #${CIRCLE_PULL_REQUEST##*/} (${CIRCLE_USERNAME})"' >> $BASH_ENV
113-
echo 'export PR_NUMBER=${CIRCLE_PULL_REQUEST##*/}' >> $BASH_ENV
127+
echo 'export APPLITOOLS_BATCH_NAME="PR #${PR_NUMBER} (${CIRCLE_USERNAME})"' >> $BASH_ENV
114128
echo 'export APPLITOOLS_DONT_CLOSE_BATCHES="true"' >> $BASH_ENV
115129
echo 'export APPLITOOLS_BATCH_NOTIFY="true"' >> $BASH_ENV
116-
echo 'export REVIEW_APP_NAME=slds-storybook-pr-${CIRCLE_PULL_REQUEST##*/}' >> $BASH_ENV
130+
echo 'export REVIEW_APP_NAME=slds-storybook-pr-${PR_NUMBER}' >> $BASH_ENV
117131
118132
vrt-close-batch:
119133
description: 'Notify Applitools that tests have completed'
@@ -161,8 +175,8 @@ commands:
161175
command: 'curl --connect-timeout 2 --max-time 2 --retry 50 --retry-delay 0 --retry-max-time 300 --retry-connrefused --ipv4 -q "http://localhost:8080"'
162176

163177
jobs:
164-
# Build SLDS styles
165-
prepare:
178+
# Init bits & bobs subsequent jobs require
179+
init:
166180
executor: slds-executor
167181
resource_class: small
168182

@@ -171,6 +185,40 @@ jobs:
171185
- run: mkdir -p workspace
172186
- install-gh-cli
173187

188+
- run:
189+
name: Get Github pull-request number
190+
command: |
191+
set +e
192+
gh pr view --json number,state,title,url > gh-pull-data.json
193+
for ((x=0 ; x<5 ; x++)) ; do
194+
if [ -z $(cat gh-pull-data.json | jq -r '.number') ] ; then
195+
gh pr view --json number,state,title,url > gh-pull-data.json
196+
else
197+
echo "» Pull-request #"$(cat gh-pull-data.json | jq -r '.number')
198+
break
199+
fi
200+
done
201+
echo
202+
echo "=== Github pull-request API results ==="
203+
cat gh-pull-data.json
204+
echo "---------------------------------------"
205+
cat gh-pull-data.json | jq -r '.number' > workspace/gh-pr-num.txt && cat workspace/gh-pr-num.txt
206+
207+
- run:
208+
name: Verify Github pull-request number
209+
command: |
210+
echo "» Branch: "${CIRCLE_BRANCH}
211+
echo
212+
if [[ ${CIRCLE_BRANCH} =~ ^[0-9]{3}-(summer|spring|winter)-[0-9]{2}$ || -n ${CIRCLE_TAG} ]] ; then
213+
echo "» Does not require a pull-request number"
214+
else
215+
if [ -z $(cat workspace/gh-pr-num.txt) ] ; then
216+
echo "» No pull-request number found!"
217+
echo "» Please try running this CI workflow again."
218+
exit 1
219+
fi
220+
fi
221+
174222
- run:
175223
name: Retrieve Github deployments
176224
command: |
@@ -184,8 +232,25 @@ jobs:
184232
gh api ${STATUS_URL} -f state=in_progress -H "Accept: application/vnd.github.flash-preview+json"
185233
done
186234
235+
- persist_to_workspace:
236+
root: workspace
237+
paths:
238+
- gh-deployments.json
239+
- gh-pr-num.txt
240+
241+
# Build SLDS styles
242+
prepare:
243+
executor: slds-executor
244+
resource_class: small
245+
246+
steps:
247+
- checkout
248+
- attach_workspace:
249+
at: workspace
250+
187251
- set-heroku-app-name
188252

253+
- node/install-npm
189254
- node/install-packages
190255

191256
# Gulp tasks (need to clean-up and not run through `npm run`)
@@ -212,7 +277,6 @@ jobs:
212277
- metadata.tar
213278
- heroku-app-name.txt
214279
- heroku-release-storybook-app-name.txt
215-
- gh-deployments.json
216280

217281
# Build SLDS .dist
218282
framework-build:
@@ -236,6 +300,7 @@ jobs:
236300
name: 'Decompress metadata'
237301
command: 'tar -xvf workspace/metadata.tar'
238302

303+
- node/install-npm
239304
- node/install-packages
240305

241306
- run:
@@ -249,24 +314,43 @@ jobs:
249314
tar -cvf workspace/design-system-dist.tar .dist/
250315
cd .dist && zip -r dist . && mv dist.zip ../workspace/ && cd ..
251316
252-
- aws-s3/copy:
253-
from: workspace/dist.zip
254-
to: 's3://sldsbuilds/design-system/${CIRCLE_SHA1}/'
255-
256317
- persist_to_workspace:
257318
root: workspace
258319
paths:
259320
- design-system-dist.tar
260321
- dist.zip
261322

262-
# Publish to S3 & trigger database update
323+
# Publish artifact & trigger database update
263324
populate-database:
264325
executor: slds-executor
265326
resource_class: small
266327

267328
steps:
268329
- checkout
269330

331+
- attach_workspace:
332+
at: workspace
333+
334+
- install-gh-cli
335+
336+
- run:
337+
name: 'Github: attach artifact to release'
338+
command: |
339+
export VERSION_FROM_TAG=$([[ ${CIRCLE_TAG} =~ ^v.* ]] && echo ${CIRCLE_TAG:1:20} || echo ${CIRCLE_TAG})
340+
export VERSION_FROM_PACKAGE=$(cat package.json | jq -r .version)
341+
342+
gh release view v${VERSION_FROM_TAG} | grep v${VERSION_FROM_TAG}
343+
344+
if [ $? -eq 0 ]; then
345+
cp workspace/dist.zip workspace/slds-v${VERSION_FROM_TAG}.zip
346+
echo "=============================="
347+
echo "» Attaching artifact to release v${VERSION_FROM_TAG}"
348+
gh release upload v${VERSION_FROM_TAG} workspace/slds-v${VERSION_FROM_TAG}.zip#"SLDS v${VERSION_FROM_TAG}" --clobber
349+
else
350+
echo "=============================="
351+
echo "» ERROR: release v${VERSION_FROM_TAG} not found on Github"
352+
fi
353+
270354
- run:
271355
name: Trigger database update via API
272356
command: |
@@ -275,11 +359,11 @@ jobs:
275359
export VERSION_FROM_PACKAGE=$(cat package.json | jq -r .version)
276360
curl --location --request PATCH 'https://api.lightningdesignsystem.com/v1/release' \
277361
--header 'Content-Type: application/json' \
278-
--header 'Authorization: Bearer ${DSE_API_RELEASE_TOKEN}' \
362+
--header 'Authorization: Bearer '"$DSE_API_RELEASE_TOKEN"'' \
279363
--data-raw '{
280-
"sha": "${CIRCLE_SHA1}",
281-
"version": "${VERSION_FROM_TAG}",
282-
"salesforce_version": "${SALESFORCE_VERSION}"
364+
"sha": "'"$CIRCLE_SHA1"'",
365+
"version":"'"$VERSION_FROM_TAG"'",
366+
"salesforce_version": "'"$SALESFORCE_VERSION"'"
283367
}'
284368
285369
# Build static Storybook
@@ -292,6 +376,7 @@ jobs:
292376
- attach_workspace:
293377
at: workspace
294378
- copy-tokens-from-workspace
379+
- node/install-npm
295380
- node/install-packages
296381

297382
- run:
@@ -383,6 +468,7 @@ jobs:
383468
mkdir -p .slds
384469
tar -xvf workspace/design-system-dist.tar --directory .slds
385470
471+
- node/install-npm
386472
- node/install-packages
387473

388474
- run:
@@ -473,11 +559,18 @@ workflows:
473559
version: 2
474560
CI:
475561
jobs:
562+
- init:
563+
context: ux-eng-keys
564+
filters:
565+
tags:
566+
only: /.*/
476567
- prepare:
477568
context: ux-eng-keys
478569
filters:
479570
tags:
480571
only: /.*/
572+
requires:
573+
- init
481574
- build-storybook:
482575
context: ux-eng-keys
483576
# do not run for future version tags (X.X.X-*)
@@ -520,18 +613,24 @@ workflows:
520613
filters:
521614
branches:
522615
ignore: /^\d{3}-(summer|spring|winter)-\d{2}$/
616+
requires:
617+
- init
523618
- vrt-mobile:
524619
context: ux-eng-keys
525620
# do not run for main version branches
526621
filters:
527622
branches:
528623
ignore: /^\d{3}-(summer|spring|winter)-\d{2}$/
624+
requires:
625+
- init
529626
- vrt-legacy:
530627
context: ux-eng-keys
531628
# do not run for main version branches
532629
filters:
533630
branches:
534631
ignore: /^\d{3}-(summer|spring|winter)-\d{2}$/
632+
requires:
633+
- init
535634
- vrt-close:
536635
context: ux-eng-keys
537636
requires:

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for npm
4+
- package-ecosystem: "npm"
5+
# Look for `package.json` and `lock` files in the `root` directory
6+
directory: "/"
7+
# Check the npm registry for updates every day (weekdays)
8+
schedule:
9+
interval: "weekly"

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
!/.circleci
2323
!/.npmrc
2424
!/.nvmrc
25+
!/.snyk
2526

2627
# Add a .gitkeep file in an empty
2728
# directory to check it in the repository
@@ -64,3 +65,7 @@ coverage
6465
# Local postcss packages
6566
install-postcss.sh
6667
applitools.*.local.js
68+
69+
__release
70+
71+
*.bak

0 commit comments

Comments
 (0)