Skip to content

Commit

Permalink
Fix: Exported TypeScript typings (#1550)
Browse files Browse the repository at this point in the history
  • Loading branch information
Barthélémy Ledoux committed Mar 11, 2020
1 parent b0d334a commit b409045
Show file tree
Hide file tree
Showing 139 changed files with 12,847 additions and 7,047 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Expand Up @@ -5,6 +5,7 @@ examples/*/styleguide/*
# TODO: remove this next line and fix all errors
examples/styled-components
lib/*
src/typings/dependencies/*
coverage/*
travis_phantomjs/*
# When ESlint looks at imports in .d.ts files,
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Expand Up @@ -15,7 +15,7 @@ module.exports = {
plugins: ['@babel/plugin-proposal-class-properties'],
overrides: [
{
include: ['src/bin', 'src/loaders', 'src/scripts', 'src/share'],
include: ['src/bin', 'src/loaders', 'src/scripts', 'src/share', 'src/typings'],
exclude: ['src/loaders/utils/client'],
presets: [
[
Expand Down
19,046 changes: 12,364 additions & 6,682 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@vxna/mini-html-webpack-template": "^1.0.0",
"acorn": "~6.4.0",
"acorn": "^6.4.1",
"acorn-jsx": "^5.1.0",
"ast-types": "~0.13.2",
"buble": "0.19.8",
Expand Down Expand Up @@ -98,10 +98,10 @@
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.4",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/preset-env": "^7.6.3",
"@babel/preset-env": "^7.8.4",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.6.3",
"@babel/preset-typescript": "^7.6.0",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"@testing-library/jest-dom": "^4.2.3",
"@testing-library/react": "^9.3.0",
"@types/buble": "^0.19.2",
Expand All @@ -111,7 +111,7 @@
"@types/escodegen": "0.0.6",
"@types/estree": "^0.0.39",
"@types/hash-sum": "^1.0.0",
"@types/jest": "^24.0.21",
"@types/jest": "^25.1.4",
"@types/keymirror": "^0.1.1",
"@types/loader-utils": "^1.1.3",
"@types/lodash": "^4.14.144",
Expand All @@ -127,8 +127,8 @@
"@typescript-eslint/eslint-plugin": "^2.6.0",
"@typescript-eslint/parser": "^2.6.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.1.0",
"babel-loader": "^8.0.6",
"cheerio": "^1.0.0-rc.3",
"css-loader": "^3.2.0",
Expand All @@ -147,20 +147,20 @@
"eslint-plugin-react": "^7.16.0",
"file-loader": "^4.2.0",
"husky": "^3.0.9",
"jest": "^24.9.0",
"jest": "^25.1.0",
"jest-serializer-html": "^7.0.0",
"keymirror": "^0.1.1",
"lint-staged": "^9.4.2",
"memfs": "~2.15.5",
"prettier": "1.18.2",
"prettier": "1.19.1",
"raf": "^3.4.1",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-test-renderer": "^16.13.0",
"strip-shebang": "^1.0.2",
"style-loader": "^1.0.0",
"tapable": "^1.1.3",
"typescript": "^3.6.4",
"typescript": "^3.8.3",
"url-loader": "^2.2.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9"
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Argument/ArgumentRenderer.tsx
Expand Up @@ -5,6 +5,7 @@ import Markdown from 'rsg-components/Markdown';
import Name from 'rsg-components/Name';
import Type from 'rsg-components/Type';
import Group from 'react-group';
import * as Rsg from '../../../typings';

export const styles = ({ space }: Rsg.Theme) => ({
block: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Arguments/ArgumentsRenderer.tsx
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import Argument, { ArgumentProps } from 'rsg-components/Argument';
import Heading from 'rsg-components/Heading';
import * as Rsg from '../../../typings';

export const styles = ({ space }: Rsg.Theme) => ({
root: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Code/CodeRenderer.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

const styles = ({ fontFamily }: Rsg.Theme) => ({
code: {
Expand Down
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import ComponentsListRenderer from 'rsg-components/ComponentsList/ComponentsListRenderer';
import getUrl from '../../utils/getUrl';
import * as Rsg from '../../../typings';

interface ComponentsListProps {
items: Rsg.TOCItem[];
Expand Down
Expand Up @@ -4,6 +4,7 @@ import cx from 'clsx';
import Link from 'rsg-components/Link';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import { useStyleGuideContext } from 'rsg-components/Context';
import * as Rsg from '../../../typings';

const styles = ({ color, fontFamily, fontSize, space, mq }: Rsg.Theme) => ({
list: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Context/Context.ts
@@ -1,4 +1,5 @@
import React from 'react';
import * as Rsg from '../../../typings';

const StyleGuideContext = React.createContext<StyleGuideContextContents>({
codeRevision: 0,
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Editor/Editor.tsx
Expand Up @@ -9,6 +9,7 @@ import 'prismjs/components/prism-javascript';
import 'prismjs/components/prism-jsx';
import { space } from '../../styles/theme';
import prismTheme from '../../styles/prismTheme';
import * as Rsg from '../../../typings';

const highlight = (code: string) => prismHighlight(code, languages.jsx, 'jsx');

Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Error/ErrorRenderer.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

const styles = ({ fontFamily, fontSize, color, space }: Rsg.Theme) => ({
root: {
Expand Down
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import Markdown from 'rsg-components/Markdown';
import { DOCS_DOCUMENTING } from '../../../scripts/consts';
import * as Rsg from '../../../typings';

const styles = ({ fontFamily, fontSize, color }: Rsg.Theme) => ({
button: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Examples/Examples.spec.tsx
Expand Up @@ -4,6 +4,7 @@ import Examples from '.';
import Context from '../Context';
import slots from '../slots';
import { DisplayModes } from '../../consts';
import * as Rsg from '../../../typings';

const evalInContext = (a: string): (() => any) =>
// eslint-disable-next-line no-new-func
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Examples/Examples.tsx
Expand Up @@ -4,6 +4,7 @@ import Playground from 'rsg-components/Playground';
import Markdown from 'rsg-components/Markdown';
import ExamplesRenderer from 'rsg-components/Examples/ExamplesRenderer';
import { useStyleGuideContext } from 'rsg-components/Context';
import * as Rsg from '../../../typings';

export interface ExamplesRenderer {
examples: Rsg.Example[];
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Heading/HeadingRenderer.tsx
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import cx from 'clsx';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

const styles = ({ color, fontFamily, fontSize }: Rsg.Theme) => ({
heading: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Link/LinkRenderer.tsx
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import cx from 'clsx';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

const styles = ({ color }: Rsg.Theme) => ({
link: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Logo/LogoRenderer.tsx
@@ -1,5 +1,6 @@
import React from 'react';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

const styles = ({ color, fontFamily, fontSize }: Rsg.Theme) => ({
logo: {
Expand Down
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import cx from 'clsx';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../../typings';

const styles = ({ space, color, fontSize, fontFamily }: Rsg.Theme) => ({
blockquote: {
Expand Down
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../../typings';

const styles = ({ space, color, fontSize, fontFamily }: Rsg.Theme) => ({
details: {
Expand Down
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../../typings';

const styles = ({ space, color, fontSize, fontFamily }: Rsg.Theme) => ({
summary: {
Expand Down
2 changes: 1 addition & 1 deletion src/client/rsg-components/Markdown/Hr/HrRenderer.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../../typings';

const styles = ({ space, color }: Rsg.Theme) => ({
hr: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Markdown/List/ListRenderer.tsx
Expand Up @@ -2,6 +2,7 @@ import React, { cloneElement, Children } from 'react';
import PropTypes from 'prop-types';
import cx from 'clsx';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../../typings';

const styles = ({ space, color, fontFamily }: Rsg.Theme) => ({
list: {
Expand Down
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import Heading from 'rsg-components/Heading';
import * as Rsg from '../../../../typings';

const styles = ({ space }: Rsg.Theme) => ({
spacing: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Markdown/Pre/PreRenderer.tsx
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import cx from 'clsx';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import prismTheme from '../../../styles/prismTheme';
import * as Rsg from '../../../../typings';

const styles = ({ space, color, fontSize, fontFamily, borderRadius }: Rsg.Theme) => ({
pre: {
Expand Down
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../../typings';

const styles = ({ space, color, fontSize, fontFamily }: Rsg.Theme) => ({
td: {
Expand Down
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../../typings';

const styles = ({ color }: Rsg.Theme) => ({
thead: {
Expand Down
2 changes: 1 addition & 1 deletion src/client/rsg-components/Markdown/Table/TableRenderer.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../../typings';

const styles = ({ space }: Rsg.Theme) => ({
table: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Message/MessageRenderer.tsx
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import Markdown from 'rsg-components/Markdown';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

const styles = ({ space }: Rsg.Theme) => ({
root: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Name/NameRenderer.tsx
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import cx from 'clsx';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

export const styles = ({ fontFamily, fontSize, color }: Rsg.Theme) => ({
name: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/NotFound/NotFoundRenderer.tsx
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import Markdown from 'rsg-components/Markdown';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

const styles = ({ maxWidth }: Rsg.Theme) => ({
root: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Para/ParaRenderer.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

export const styles = ({ space, color, fontFamily }: Rsg.Theme) => ({
para: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Pathline/PathlineRenderer.tsx
Expand Up @@ -3,6 +3,7 @@ import copy from 'clipboard-copy';
import { MdContentCopy } from 'react-icons/md';
import ToolbarButton from 'rsg-components/ToolbarButton';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

export const styles = ({ space, fontFamily, fontSize, color }: Rsg.Theme) => ({
pathline: {
Expand Down
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import cx from 'clsx';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

export const styles = ({ space, color, borderRadius }: Rsg.Theme) => ({
root: {
Expand Down
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

const styles = ({ fontFamily, fontSize, color }: Rsg.Theme) => ({
root: {
Expand Down
Expand Up @@ -4,6 +4,7 @@ import ReactComponent from './ReactComponent';
import slots from '../slots';
import Context from '../Context';
import { DisplayModes } from '../../consts';
import * as Rsg from '../../../typings';

const context = {
config: {
Expand Down
Expand Up @@ -10,6 +10,7 @@ import Context from 'rsg-components/Context';
import ExamplePlaceholderDefault from 'rsg-components/ExamplePlaceholder';
import { DOCS_TAB_USAGE } from '../slots';
import { DisplayModes, UsageModes } from '../../consts';
import * as Rsg from '../../../typings';

const ExamplePlaceholder =
process.env.STYLEGUIDIST_ENV !== 'production' ? ExamplePlaceholderDefault : () => <div />;
Expand Down
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import Pathline from 'rsg-components/Pathline';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

const styles = ({ color, fontSize, space }: Rsg.Theme) => ({
root: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Ribbon/RibbonRenderer.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

export const styles = ({ color, space, fontSize, fontFamily }: Rsg.Theme) => ({
root: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Section/Section.tsx
Expand Up @@ -6,6 +6,7 @@ import Sections from 'rsg-components/Sections';
import SectionRenderer from 'rsg-components/Section/SectionRenderer';
import { useStyleGuideContext } from 'rsg-components/Context';
import { DisplayModes } from '../../consts';
import * as Rsg from '../../../typings';

const Section: React.FunctionComponent<{
section: Rsg.Section;
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Section/SectionRenderer.tsx
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import SectionHeading from 'rsg-components/SectionHeading';
import Markdown from 'rsg-components/Markdown';
import * as Rsg from '../../../typings';

const styles = ({ space }: Rsg.Theme) => ({
root: {
Expand Down
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import cx from 'clsx';
import Heading from 'rsg-components/Heading';
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
import * as Rsg from '../../../typings';

const styles = ({ color, space }: Rsg.Theme) => ({
wrapper: {
Expand Down
1 change: 1 addition & 0 deletions src/client/rsg-components/Sections/Sections.tsx
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import Section from 'rsg-components/Section';
import SectionsRenderer from 'rsg-components/Sections/SectionsRenderer';
import * as Rsg from '../../../typings';

const Sections: React.FunctionComponent<{
sections: Rsg.Section[];
Expand Down

0 comments on commit b409045

Please sign in to comment.