From ef6fa911eb4f13c0b79cd2945f880e14e41a5f26 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Tue, 19 Feb 2019 09:40:41 -0800 Subject: [PATCH 1/2] ci: "publish" + "deploy" need "npm install" --- .github/main.workflow | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/main.workflow b/.github/main.workflow index 378547f3d40..3f89bf354f6 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -27,11 +27,13 @@ action "npm test" { action "deploy" { uses = "primer/deploy@v2.0.0" + needs = ["npm install"] secrets = ["GITHUB_TOKEN", "NOW_TOKEN"] } action "publish" { uses = "primer/publish@master" + needs = ["npm install"] secrets = [ "GITHUB_TOKEN", "NPM_AUTH_TOKEN", From 9f2ed11edc123e3788a6c62550f62b4a2cf1d576 Mon Sep 17 00:00:00 2001 From: Cole Bemis Date: Tue, 19 Feb 2019 15:00:20 -0800 Subject: [PATCH 2/2] dry up constants.js --- src/constants.js | 74 ++++++++---------------------------------------- 1 file changed, 12 insertions(+), 62 deletions(-) diff --git a/src/constants.js b/src/constants.js index ff3d18e5a15..82dbf84d14f 100644 --- a/src/constants.js +++ b/src/constants.js @@ -4,68 +4,6 @@ import theme from './theme' export const get = key => themeGet(key, getKey(theme, key)) -export const COMMON = compose( - styles.color, - styles.space -) - -export const BORDER = compose( - styles.borders, - styles.borderColor, - styles.boxShadow, - styles.borderRadius -) - -export const TYPOGRAPHY = compose( - styles.fontFamily, - styles.fontSize, - styles.fontStyle, - styles.fontWeight, - styles.lineHeight, - styles.textAlign -) - -export const LAYOUT = compose( - styles.display, - styles.size, - styles.width, - styles.height, - styles.minWidth, - styles.minHeight, - styles.maxWidth, - styles.maxHeight, - styles.overflow, - styles.verticalAlign -) - -export const POSITION = compose( - styles.position, - styles.zIndex, - styles.top, - styles.right, - styles.bottom, - styles.left -) - -export const FLEX_CONTAINER = compose( - styles.flexBasis, - styles.flexDirection, - styles.flexWrap, - styles.alignContent, - styles.alignItems, - styles.justifyContent, - styles.justifyItems, - styles.order -) - -export const FLEX_ITEM = compose( - styles.flex, - styles.justifySelf, - styles.alignSelf -) - -// These lists are just used to generate docs - export const COMMON_LIST = ['color', 'space'] export const BORDER_LIST = ['borders', 'borderColor', 'boxShadow', 'borderRadius'] @@ -123,4 +61,16 @@ export const FLEX_ITEM_LIST = [ 'alignSelf' ] +export const COMMON = composeList(COMMON_LIST) +export const BORDER = composeList(BORDER_LIST) +export const TYPOGRAPHY = composeList(TYPOGRAPHY_LIST) +export const LAYOUT = composeList(LAYOUT_LIST) +export const POSITION = composeList(POSITION_LIST) +export const FLEX_CONTAINER = composeList(FLEX_CONTAINER_LIST) +export const FLEX_ITEM = composeList(FLEX_ITEM_LIST) + +function composeList(list) { + return compose(...list.map(name => styles[name])) +} + export const Base = ({is: Tag = 'div', theme, ...rest}) =>