Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(token-contrast-checker): fixing the build, also adding it to CI #2453

Merged
merged 6 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"buildCommand": "build",
"node": "12",
"node": "16",
"packages": [
"/packages/paste-icons",
"/packages/paste-core/core-bundle",
Expand Down Expand Up @@ -77,6 +77,7 @@
"/packages/paste-utils"
],
"sandboxes": [
"/packages/paste-nextjs-template"
"/packages/paste-nextjs-template",
"/packages/paste-token-contrast-checker"
]
}
1 change: 1 addition & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {
'packages/paste-nextjs-template/**/*',
'packages/paste-website/**/*',
'packages/paste-cra-template/template/**/*',
'packages/paste-token-contrast-checker/**/*',
'**/__tests__/**',
],
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"build:website": "yarn workspace @twilio-paste/website build",
"build:theme-designer": "yarn workspace @twilio-paste/theme-designer build",
"build:nextjs-template": "yarn workspace @twilio-paste/nextjs-template build",
"build:contrast-checking": "yarn workspace @twilio-paste/token-contrast-checker build",
"build:props": "lerna run build:props --ignore @twilio-paste/website --concurrency 2",
"pre-push": "concurrently \"yarn:lint\" \"yarn:test\" \"yarn:prettier\" \"yarn:type-check\"",
"prerelease": "yarn build && yarn lint && yarn test",
Expand Down
4 changes: 2 additions & 2 deletions packages/paste-core/core-bundle/tools/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const BLOCKLIST = [

const BASE_CODESANDBOX_CI = {
buildCommand: 'build',
node: '12',
node: '16',
packages: ['/packages/paste-icons', '/packages/paste-core/core-bundle'],
sandboxes: ['/packages/paste-nextjs-template'],
sandboxes: ['/packages/paste-nextjs-template', '/packages/paste-token-contrast-checker'],
};

const PACKAGES_ROOT_PATH = join(__dirname, '../../../..');
Expand Down
4 changes: 4 additions & 0 deletions packages/paste-token-contrast-checker/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"root": true,
"parser": "@typescript-eslint/parser"
}
1 change: 0 additions & 1 deletion packages/paste-token-contrast-checker/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ const App: React.FC = ({children}) => {
);
};

// eslint-disable-next-line import/no-default-export
export default App;
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const SideBar: React.FC = () => {
{textContrastRating.map((rating) => {
return (
<TokenPairRating
key={`text-${rating.background}-${rating.foreground}`}
contrast={rating.contrast}
background={rating.background}
foreground={rating.foreground}
Expand All @@ -78,6 +79,7 @@ export const SideBar: React.FC = () => {
{uiControlContrastRating.map((rating) => {
return (
<TokenPairRating
key={`control-${rating.background}-${rating.foreground}`}
contrast={rating.contrast}
background={rating.background}
foreground={rating.foreground}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export const ThemeSelector: React.FC<ThemeSelectorProps> = ({onChange, themes, v
<Label htmlFor={selectID}>Selected Theme</Label>
<Select id={selectID} value={value} onChange={onChange}>
{themes.map((themeName) => {
return <Option value={ThemeVariants[themeName]}>{ThemeVariants[themeName]}</Option>;
return (
<Option key={themeName} value={ThemeVariants[themeName]}>
{ThemeVariants[themeName]}
</Option>
);
})}
</Select>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ const reportWebVitals = (onPerfEntry?: ReportHandler): void => {
}
};

// eslint-disable-next-line import/no-default-export
export default reportWebVitals;