Skip to content

Commit caec2cf

Browse files
authored
Build, Style, & Typescript Hotfix (#42)
* Update absolute import paths to relative for better typescript support. Update styles for better experience using grids. Update build to ignore all test files * move all tests into separate folder at root level and update import paths to stop after foundations directory to ensure index files are covered by tests * Update grid image to reflect updated CSS
1 parent f8f9f91 commit caec2cf

35 files changed

Lines changed: 75 additions & 60 deletions
Lines changed: 2 additions & 2 deletions
Loading

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.preferences.importModuleSpecifier": "relative"
3+
}

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ module.exports = {
1616
statements: 100,
1717
},
1818
},
19-
testMatch: ['**/__tests__/**/*.test.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
19+
testMatch: ['**/test/**/*.test.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
2020
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
2121
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
],
2323
"scripts": {
2424
"start": "tsdx watch",
25-
"build": "tsdx build && yarn build-styles",
25+
"build": "tsdx build --tsconfig ./tsconfig.json && yarn build-styles",
2626
"heroku-postbuild": "build-storybook",
2727
"test": "tsdx test --passWithNoTests",
2828
"test:ci-local-config": "circleci config process .circleci/config.yml > process.yml",

sass/foundations/layout.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ $justification: flex-start, flex-end, center, stretch, space-between, space-arou
136136
}
137137
.grid {
138138
display: grid;
139+
height: 100%;
140+
width: 100%;
139141
$grid: &;
140142
@include align-self-and-items;
141143

@@ -148,8 +150,8 @@ $justification: flex-start, flex-end, center, stretch, space-between, space-arou
148150
&--hbf {
149151
grid-template-columns: 1fr;
150152
grid-template-rows:
151-
minmax(min-content, 1fr) minmax(min-content, auto)
152-
minmax(min-content, 1fr);
153+
minmax(min-content, max-content) minmax(min-content, auto)
154+
minmax(min-content, max-content);
153155
grid-template-areas: 'header' 'body' 'footer';
154156
#{$grid}-header {
155157
grid-area: header;

src/_stories/foundations/color-story-components.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
2-
import { Box, Column, Row } from 'foundations/layout';
3-
import { COLOR } from 'foundations/colors';
4-
import { Story, ColorStack, TRenderColorShade } from '_stories/story-components';
2+
import { COLOR, Box, Column, Row } from '../../foundations';
3+
import { Story, ColorStack, TRenderColorShade } from '../story-components';
54

65
const renderColorShade: TRenderColorShade = ({ colorShade }) => (
76
<Box bg={colorShade} />

src/_stories/foundations/layout/layout-story-components.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import React from 'react';
2-
import { Flex as Fx, Fonts, Column, Grid as Gd, HBFGrid } from 'foundations';
32
import { IKeyedObject } from '../../../utilities';
43
import {
4+
Fonts,
5+
Flex as Fx,
6+
Column,
7+
Grid as Gd,
8+
HBFGrid,
9+
} from '../../../foundations';
10+
import {
11+
TRenderColorShade,
512
Story,
6-
ColorStack,
713
FloatingPropTable,
8-
TRenderColorShade,
9-
} from '_stories/story-components';
14+
ColorStack,
15+
} from '../../story-components';
1016

1117
const sizeMap = {
1218
'0': '0;',
@@ -47,7 +53,7 @@ const renderBgColorShade: TRenderColorShade = ({ shade, colorShade }) => (
4753
</Fonts.Body>
4854
</>
4955
);
50-
const renderBcColorShade: TRenderColorShade = ({ shade, colorShade }) => (
56+
const renderBcColorShade: TRenderColorShade = ({ colorShade }) => (
5157
<>
5258
<Fonts.Body weight="bold">{colorShade}</Fonts.Body>
5359
<Fx flex="grow" />

src/_stories/foundations/typography-story-components.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import { Fonts } from 'foundations';
3-
import { Story, FloatingPropTable } from '_stories/story-components';
2+
import { Fonts } from '../../foundations';
3+
import { Story, FloatingPropTable } from '../story-components';
44

55
const type = {
66
display: '',

src/_stories/story-components/color-stack.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { FC } from 'react';
2-
import { Row, Fonts, SHADE, Flex } from 'foundations';
3-
import { TColorShade } from 'foundations/colors';
42
import { isNullOrUndefined } from '../../utilities';
3+
import { Fonts, SHADE, TColorShade, Row, Flex } from '../../foundations';
54

65
export interface IRenderColorShade {
76
color: string;

src/_stories/story-components/floating-card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { FC } from 'react';
2-
import { IDefaultProps } from 'types';
3-
import { Flex } from 'foundations';
2+
import { Flex } from '../../foundations';
3+
import { IDefaultProps } from '../../types';
44

55
export const FloatingCard: FC<IDefaultProps> = ({ children }) => (
66
<Flex bg="grey-1">

0 commit comments

Comments
 (0)