Skip to content

Commit

Permalink
fix(token-contrast-checker): fixing the build, also adding it to CI (#…
Browse files Browse the repository at this point in the history
…2453)

* fix(token-contrast-checker): fix build errors on eslint

* chore: add a command to build token-contrast-checker from root

* chore: update codesandbox ci with 2 more environments and fix warns

* fix: codesandbox ci.json now auto-generates correctly

* chore: eslint fixes
  • Loading branch information
TheSisb committed Jun 8, 2022
1 parent 8263d8a commit 0a7fcd4
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .codesandbox/ci.json
@@ -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
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
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
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
@@ -0,0 +1,4 @@
{
"root": true,
"parser": "@typescript-eslint/parser"
}
1 change: 0 additions & 1 deletion packages/paste-token-contrast-checker/src/App.tsx
Expand Up @@ -27,5 +27,4 @@ const App: React.FC = ({children}) => {
);
};

// eslint-disable-next-line import/no-default-export
export default App;
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
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
Expand Up @@ -15,5 +15,4 @@ const reportWebVitals = (onPerfEntry?: ReportHandler): void => {
}
};

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

0 comments on commit 0a7fcd4

Please sign in to comment.