Skip to content

Commit

Permalink
fix: add regex for typescript support loader
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsson committed Dec 27, 2019
1 parent bddf534 commit 77d85c6
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 18 deletions.
3 changes: 2 additions & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@papyrum/cli": "^1.0.1-alpha.0"
"@papyrum/cli": "^1.0.1-alpha.0",
"@papyrum/ui-docs": "^1.0.1-alpha.0"
}
}
7 changes: 0 additions & 7 deletions examples/typescript/src/Button.js

This file was deleted.

8 changes: 6 additions & 2 deletions examples/typescript/src/Button.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
---
route: /
status: ready
---

import{ Button } from './Button';
import { Props } from '@papyrum/ui-docs';
import { Button } from './Button';

# Button

<Button>My Button</Button>
<Button>My Button</Button>

<Props of={Button} />
7 changes: 6 additions & 1 deletion examples/typescript/src/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import * as React from 'react';
import p from 'prop-types';

interface Props {
variants: any;
}

export const Button: React.FC<Props> = ({ children }) => {
return <button>{children}</button>
return <button>{children}</button>
};

Button.propTypes = {
primary: p.bool
};
4 changes: 2 additions & 2 deletions packages/papyrum-cli/src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import * as chokidar from 'chokidar';
export const dev = async (argv) => {
await init(argv);
server(argv);
const watch = chokidar.watch(['**/*.mdx', '**/*.{js,jsx,mjs}'], {
const watch = chokidar.watch(['**/*.mdx', '**/*.{ts,tsx,js,jsx,}'], {
ignored: 'node_modules'
});
watch.on('change', async (path) => {
await init(argv);
});
}
};
2 changes: 1 addition & 1 deletion packages/papyrum-core/src/webpack/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const getConfigBabel = argv => {
};

export const babel = argv => ({
test: argv.typescript ? /\.(ts|tsx)$/ : /\.(js|jsx)$/,
test: /\.(ts|tsx|js|jsx)$/,
exclude: /node_modules/,
use: [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/papyrum-ui-docs/src/components/Props/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const Prop = styled.div`
`;

export const Wrapper = styled.div`
margin: 0 0 40px;
margin: 20px 0 40px;
border: 1px solid ${props => props.theme.colors.gray};
background-color: ${props => props.theme.colors.grayLight};
border-radius: 5px;
Expand Down
1 change: 1 addition & 0 deletions packages/papyrum-ui/src/components/Blockquote/styled.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styled from 'styled-components';

export const Blockquote = styled.div`
margin: 20px 0 40px;
border-left: 5px solid ${props => props.theme.colors.gray};
padding-left: 20px;
box-sizing: border-box;
Expand Down
5 changes: 2 additions & 3 deletions packages/papyrum-ui/src/components/Table/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import styled from 'styled-components';

export const Table = styled.table`
border-collapse: collapse;
font-size: 16px;
margin: 0 0 40px;
font-size: 18px;
margin: 20px 0 40px;
`;

export const TableRow = styled.tr`
Expand All @@ -17,7 +17,6 @@ export const TableTd = styled.td`
`;

export const TableTh = styled.th`
font-size: 18px;
color: ${props => props.theme.colors.darkGray};
background-color: ${props => props.theme.colors.grayLight};
border: 1px solid ${props => props.theme.colors.gray};
Expand Down

0 comments on commit 77d85c6

Please sign in to comment.