Skip to content

Commit 24f8b77

Browse files
nmergetmfranzke
andauthored
WIP: feat: disabled Canvas/Docs in panel for storybook (#6)
* feat: disabled Canvas/Docs in panel for storybook and rearranged components Co-authored-by: Maximilian Franzke <[email protected]>
1 parent b9fa179 commit 24f8b77

File tree

222 files changed

+36598
-20141
lines changed

Some content is hidden

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

222 files changed

+36598
-20141
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: 'Cancel Workflow'
3+
description: 'Cancel this workflow on failure'
4+
inputs:
5+
token:
6+
description: 'A Github PAT'
7+
required: true
8+
runs:
9+
using: 'composite'
10+
steps:
11+
- run: |
12+
gh api \
13+
--method POST \
14+
-H "Accept: application/vnd.github+json" \
15+
/repos/db-ui/elements/actions/runs/${{ github.run_id }}/cancel
16+
shell: bash
17+
env:
18+
GH_TOKEN: ${{ inputs.token }}

.github/workflows/00-init.yml

+6
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ jobs:
2424
uses: bahmutov/npm-install@v1
2525
with:
2626
install-command: npm ci --ignore-scripts
27+
28+
- name: 💀 Killing me softly
29+
uses: ./.github/actions/cancel-workflow
30+
if: failure()
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Install Cypress
3+
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
install-cypress:
9+
name: Install Cypress
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: ⬇ Checkout repo
13+
uses: actions/checkout@v3
14+
15+
- name: 💻 Install dependencies
16+
uses: cypress-io/github-action@v4
17+
with:
18+
working-directory: e2e
19+
runTests: false
20+
21+
- name: 💀 Killing me softly
22+
uses: ./.github/actions/cancel-workflow
23+
if: failure()
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/00-scan-secrets.yml

+8
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@ jobs:
1111
uses: actions/checkout@v3
1212
with:
1313
fetch-depth: 0
14+
1415
- name: ↔ Extract branch name
1516
shell: bash
1617
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
1718
id: extract_branch
19+
1820
- name: 🐷 TruffleHog OSS
1921
uses: trufflesecurity/[email protected]
2022
with:
2123
path: ./
2224
base: ${{ steps.extract_branch.outputs.branch }}
2325
head: HEAD
26+
27+
- name: 💀 Killing me softly
28+
uses: ./.github/actions/cancel-workflow
29+
if: failure()
30+
with:
31+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/01-build-all.yml

+6
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ jobs:
2525
with:
2626
name: build
2727
path: out
28+
29+
- name: 💀 Killing me softly
30+
uses: ./.github/actions/cancel-workflow
31+
if: failure()
32+
with:
33+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/01-build-showcases.yml

+6
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,9 @@ jobs:
6363
with:
6464
name: showcase-${{ matrix.showcases }}
6565
path: showcase/${{ matrix.showcases }}-showcase/dist
66+
67+
- name: 💀 Killing me softly
68+
uses: ./.github/actions/cancel-workflow
69+
if: failure()
70+
with:
71+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/01-build-stencil-targets.yml

+6
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ jobs:
5252
with:
5353
name: output-target-${{ matrix.themes }}-${{ steps.path.outputs.framework }}
5454
path: packages/db-ui-elements-${{ steps.path.outputs.framework }}
55+
56+
- name: 💀 Killing me softly
57+
uses: ./.github/actions/cancel-workflow
58+
if: failure()
59+
with:
60+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/01-build-storybook.yml

+6
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,9 @@ jobs:
6666
with:
6767
name: build
6868
path: out
69+
70+
- name: 💀 Killing me softly
71+
uses: ./.github/actions/cancel-workflow
72+
if: failure()
73+
with:
74+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/01-get-publish-version.yml

+6
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,9 @@ jobs:
6868
env:
6969
VALID_SEMVER_VERSION: ${{ steps.getVersion.outputs.version }}
7070
run: echo "$VALID_SEMVER_VERSION"
71+
72+
- name: 💀 Killing me softly
73+
uses: ./.github/actions/cancel-workflow
74+
if: failure()
75+
with:
76+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/01-test.yml

+6
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ jobs:
1717

1818
- name: 🔬 Run unit/snapshot tests
1919
run: npm test
20+
21+
- name: 💀 Killing me softly
22+
uses: ./.github/actions/cancel-workflow
23+
if: failure()
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/01-validate.yml

+6
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ jobs:
2222
npm run lint:eslint
2323
npm run lint:stylelint
2424
npm run lint:markdownlint
25+
26+
- name: 💀 Killing me softly
27+
uses: ./.github/actions/cancel-workflow
28+
if: failure()
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/02-cypress.yml

+27-4
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,47 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
containers: [areas, components, elements, showcases]
13+
containers:
14+
[
15+
00-0-intro,
16+
01-0-layout,
17+
02-0-navigation,
18+
02-1-navigation,
19+
03-0-action,
20+
04-0-data-display,
21+
04-1-data-display,
22+
05-0-data-input,
23+
05-1-data-input,
24+
06-0-feedback,
25+
07-0-utility,
26+
99-0-showcases,
27+
99-1-showcases
28+
]
1429
steps:
1530
- name: ⬇ Checkout repo
1631
uses: actions/checkout@v3
1732

18-
- name: 🔄 Init Cache
19-
uses: ./.github/actions/npm-cache
20-
2133
- name: ⬇ Download build
2234
uses: ./.github/actions/download-tar-artifact
2335
with:
2436
name: build
2537
path: out
2638

39+
- name: ➡ Move out in e2e
40+
run: mv out e2e
41+
2742
- name: 🧪 Cypress run
2843
# Install NPM dependencies and run all Cypress tests
2944
uses: cypress-io/github-action@v4
3045
with:
46+
working-directory: e2e
3147
start: npx [email protected] out
3248
wait-on: 'http://localhost:8080'
3349
wait-on-timeout: 120
3450
config: pageLoadTimeout=100000,baseUrl=http://localhost:8080
3551
browser: chrome
3652
spec: cypress/integration/${{ matrix.containers }}/*.js
53+
ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}'
3754

3855
- name: 🛗 Upload Artifacts
3956
uses: actions/upload-artifact@v2
@@ -51,3 +68,9 @@ jobs:
5168
with:
5269
name: cypress-videos
5370
path: e2e/cypress/videos
71+
72+
- name: 💀 Killing me softly
73+
uses: ./.github/actions/cancel-workflow
74+
if: failure()
75+
with:
76+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/03-changelog.yml

+6
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ jobs:
3434
body: process.env.CHANGELOG_TEXT
3535
})
3636
console.log("CHANGELOG TEXT:", process.env.CHANGELOG_TEXT)
37+
38+
- name: 💀 Killing me softly
39+
uses: ./.github/actions/cancel-workflow
40+
if: failure()
41+
with:
42+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/03-deploy-gh-pages.yml

+6
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,9 @@ jobs:
7878
fi
7979
echo "URL: $URL"
8080
echo "### GH-Pages URL :rocket: <br> <br> $URL" >> $GITHUB_STEP_SUMMARY
81+
82+
- name: 💀 Killing me softly
83+
uses: ./.github/actions/cancel-workflow
84+
if: failure()
85+
with:
86+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/03-publish-packages.yml

+6
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,9 @@ jobs:
104104
with:
105105
name: package-${{ matrix.themes }}-v-elements
106106
path: db-ui-v-elements${{ steps.getPkgTheme.outputs.pkgTheme }}-${{ inputs.version }}.tgz
107+
108+
- name: 💀 Killing me softly
109+
uses: ./.github/actions/cancel-workflow
110+
if: failure()
111+
with:
112+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/default.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ jobs:
1515
scan-secrets:
1616
uses: ./.github/workflows/00-scan-secrets.yml
1717

18+
install-cypress:
19+
uses: ./.github/workflows/00-install-cypress.yml
20+
1821
test:
1922
uses: ./.github/workflows/01-test.yml
2023
needs: [init]
@@ -42,7 +45,7 @@ jobs:
4245

4346
cypress:
4447
uses: ./.github/workflows/02-cypress.yml
45-
needs: [build-storybook]
48+
needs: [install-cypress, build-storybook]
4649

4750
deploy:
4851
uses: ./.github/workflows/03-deploy-gh-pages.yml

.gitignore

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ UserInterfaceState.xcuserstate
3535
packages/db-ui-poc-react/.env
3636

3737
# Cypress
38-
cypress/videos/*
39-
cypress/screenshots/*
40-
cypress/results/*
41-
cypress/snapshots/actual
42-
cypress/snapshots/diff
38+
e2e/cypress/videos/*
39+
e2e/cypress/screenshots/*
40+
e2e/cypress/results/*
41+
e2e/cypress/snapshots/actual
42+
e2e/cypress/snapshots/diff
4343

4444

4545
coverage/

.storybook/main.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ module.exports = {
33
'../packages/db-ui-elements-stencil/src/**/*.stories.@(js|jsx|ts|tsx|mdx)'
44
],
55
addons: [
6-
'@storybook/addon-essentials',
6+
{
7+
name: '@storybook/addon-essentials',
8+
options: {
9+
backgrounds: false,
10+
measure: false,
11+
outline: false
12+
}
13+
},
714
{
815
name: '@storybook/addon-docs',
916
options: { transcludeMarkdown: true }

.storybook/preview.js

+15-12
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,26 @@ defineCustomElements();
66
export const parameters = {
77
actions: { argTypesRegex: '^on[A-Z].*' },
88
layout: 'centered',
9-
controls: {
10-
expanded: true,
11-
hideNoControlsWarning: true
9+
controls: { expanded: true, hideNoControlsWarning: true },
10+
previewTabs: {
11+
'storybook/docs/panel': { hidden: true },
12+
canvas: { hidden: true }
1213
},
14+
viewMode: 'story',
1315
options: {
1416
storySort: {
1517
method: 'alphabetical',
1618
order: [
17-
'Intro',
18-
['Welcome', 'Getting Started'],
19-
'Base',
20-
['Colors', 'Color Preview'],
21-
'Elements',
22-
'Components',
23-
'Areas',
24-
'Development',
25-
'Other'
19+
'00-Intro',
20+
['Welcome', 'Getting Started', 'Frameworks', 'Showcases'],
21+
'01-Layout',
22+
'02-Navigation',
23+
'03-Action',
24+
'04-Data-Display',
25+
'05-Data-Input',
26+
'06-Feedback',
27+
'07-Utility',
28+
'99-Development'
2629
]
2730
}
2831
}

cypress/integration/other/welcome-story.spec.js

-42
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

cypress.json e2e/cypress.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"baseUrl": "http://localhost:6006",
44
"reporter": "junit",
55
"reporterOptions": {
6-
"mochaFile": "cypress/results/output-[hash].xml"
6+
"mochaFile": "./cypress/results/output-[hash].xml"
77
},
88
"experimentalStudio": true,
99
"viewportWidth": 1920,
File renamed without changes.

0 commit comments

Comments
 (0)