Skip to content

Commit 9576e44

Browse files
authored
Internalize @microsoft/fast-components (#80)
* WIP first build * Fix storybook set up * Fix skeleton * Fix disclosure story * Fix picker story * Fix design system provider * Fix theme handling * Finalize storybook * Switch to new accentColor for lab connection * Prettify * Lint the code * Convert test to jest test * Fix playwright tests * Format the tests * Set up concurrency limit of github workflows * More auto format * Undo styling change following integration * Fix visual tests * Update most snapshots * Update tabs vertical snapshots * Wrap as react components the new ones * Apply license header * Add the new components to the lab demo * Tune ref snapshots * Add `errorColor` * Revert "Tune ref snapshots" This reverts commit 72219a3.
1 parent 7d078b2 commit 9576e44

File tree

828 files changed

+9678
-1908
lines changed

Some content is hidden

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

828 files changed

+9678
-1908
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: main
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build:
1115
runs-on: ubuntu-latest

.github/workflows/check-release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
pull_request:
66
branches: ["*"]
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
check_release:
1014
runs-on: ubuntu-latest

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: main
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
test:
1115
runs-on: ubuntu-latest

.github/workflows/docs-cd.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
deploy-docs:
1014
runs-on: ubuntu-latest

.github/workflows/visual-test.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ on:
66
pull_request:
77
branches: main
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
visual-test:
1115
runs-on: ubuntu-latest
1216
timeout-minutes: 60
17+
env:
18+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
19+
1320
steps:
1421
- name: Checkout 🛎️
1522
uses: actions/checkout@v3
@@ -21,7 +28,8 @@ jobs:
2128

2229
- name: Get yarn cache directory path
2330
id: yarn-cache-dir-path
24-
run: echo "::set-output name=dir::$(yarn cache dir)"
31+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
32+
2533
- name: Setup yarn cache
2634
uses: actions/cache@v3
2735
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -32,8 +40,17 @@ jobs:
3240
yarn-
3341
3442
- name: Install Dependencies 📥
43+
env:
44+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
3545
run: yarn install
3646

47+
- name: Set up browser cache
48+
uses: actions/cache@v3
49+
with:
50+
path: |
51+
${{ github.workspace }}/pw-browsers
52+
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
53+
3754
- name: Install Playwright Browsers
3855
run: yarn run playwright install --with-deps
3956
working-directory: packages/components
@@ -55,4 +72,4 @@ jobs:
5572
name: jupyter-ui-test
5673
path: |
5774
packages/components/test-assets/
58-
packages/components/tests-out/**/*-snapshots/*
75+
packages/components/src/**/*-snapshots/*

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,31 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2525
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2626
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
---
30+
31+
This project code source is modified from `@microsoft/fast-components` licensed under
32+
33+
FAST - https://www.fast.design/
34+
35+
MIT License
36+
37+
Copyright (c) Microsoft Corporation. All rights reserved.
38+
39+
Permission is hereby granted, free of charge, to any person obtaining a copy
40+
of this software and associated documentation files (the "Software"), to deal
41+
in the Software without restriction, including without limitation the rights
42+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
43+
copies of the Software, and to permit persons to whom the Software is
44+
furnished to do so, subject to the following conditions:
45+
46+
The above copyright notice and this permission notice shall be included in all
47+
copies or substantial portions of the Software.
48+
49+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
50+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
51+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
52+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
53+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
54+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
55+
SOFTWARE

packages/components/.babelrc.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
"@babel/preset-env",
66
{
77
"targets": {
8-
"chrome": 100
8+
"node": "current"
99
}
1010
}
11-
],
12-
"@babel/preset-typescript"
11+
]
1312
],
1413
"plugins": []
1514
}
File renamed without changes.

packages/components/.storybook/main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { dirname, join } from 'path';
22
import remarkGfm from 'remark-gfm';
3+
const ResolveTypescriptPlugin = require('resolve-typescript-plugin');
34

45
module.exports = {
56
stories: [
@@ -24,6 +25,10 @@ module.exports = {
2425
getAbsolutePath('@storybook/addon-a11y')
2526
],
2627
webpackFinal: async config => {
28+
if (!config.resolve.plugins) {
29+
config.resolve.plugins = [];
30+
}
31+
config.resolve.plugins.push(new ResolveTypescriptPlugin());
2732
config.module.rules.push(
2833
{
2934
test: /\.ts$/,

packages/components/.storybook/preview.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import * as JupyterComponents from '../src/index-rollup';
2-
// import type {Preview} from '@storybook/web-components';
32
import { themes } from '@storybook/theming';
3+
import { withTheme } from '../src/utilities/storybook';
44

5+
// Ensure the components are not tree shaked.
56
JupyterComponents;
67

78
const parameters = {
@@ -50,7 +51,8 @@ const globalTypes = {
5051

5152
const preview = {
5253
parameters,
53-
globalTypes
54+
globalTypes,
55+
decorators: [withTheme]
5456
};
5557

5658
export default preview;

0 commit comments

Comments
 (0)