diff --git a/examples/monorepo/README.md b/examples/monorepo/README.md new file mode 100644 index 000000000..628b7c2d5 --- /dev/null +++ b/examples/monorepo/README.md @@ -0,0 +1,38 @@ +# Docz Gatsby Mono Repo Example + +This example shows you how you can use docz as a [Gatsby Theme](https://www.gatsbyjs.org/blog/2018-11-11-introducing-gatsby-themes/) inside your project as part of a monorepo. + + +## Using `create-docz-app` + +```sh +npx create-docz-app docz-app-monorepo --example monorepo +# or +yarn create docz-app docz-app-monorepo --example monorepo +``` + +## Download + +```sh +curl https://codeload.github.com/pedronauck/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/monorepo +mv monorepo docz-monorepo-example +cd docz-monorepo-example +``` + +## Setup + +```sh +yarn # npm i +``` + +## Start developing + +```sh +yarn dev # npm run dev +``` + +## Build + +```sh +yarn build # npm run build +``` diff --git a/examples/monorepo/lerna.json b/examples/monorepo/lerna.json new file mode 100644 index 000000000..0ffae62a1 --- /dev/null +++ b/examples/monorepo/lerna.json @@ -0,0 +1,5 @@ +{ + "lerna": "3.16.4", + "packages": ["packages/*"], + "version": "1.0.0" +} diff --git a/examples/monorepo/package.json b/examples/monorepo/package.json new file mode 100644 index 000000000..0c5fdc03d --- /dev/null +++ b/examples/monorepo/package.json @@ -0,0 +1,21 @@ +{ + "private": true, + "workspaces": [ + "packages/my-super-special-button", + "packages/docs-site" + ], + "name": "docz-gatsby-monorepo", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "build": "lerna run build", + "dev": "lerna run dev" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "lerna": "^3.16.4" + } +} diff --git a/examples/monorepo/packages/docs-site/.gitignore b/examples/monorepo/packages/docs-site/.gitignore new file mode 100644 index 000000000..39e9c0056 --- /dev/null +++ b/examples/monorepo/packages/docs-site/.gitignore @@ -0,0 +1,5 @@ +# gatsby files +.cache/ +public + +node_modules diff --git a/examples/monorepo/packages/docs-site/CHANGELOG.md b/examples/monorepo/packages/docs-site/CHANGELOG.md new file mode 100644 index 000000000..bcc79d726 --- /dev/null +++ b/examples/monorepo/packages/docs-site/CHANGELOG.md @@ -0,0 +1,147 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [2.0.0-rc.6](https://github.com/pedronauck/docz/compare/v2.0.0-rc.1...v2.0.0-rc.6) (2019-08-29) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +# [2.0.0-rc.2](https://github.com/pedronauck/docz/compare/v2.0.0-rc.1...v2.0.0-rc.2) (2019-08-28) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +# [2.0.0-rc.1](https://github.com/pedronauck/docz/compare/v1.2.0...v2.0.0-rc.1) (2019-07-18) + + +### Bug Fixes + +* bump version ([a346b59](https://github.com/pedronauck/docz/commit/a346b59)) + + +### Features + +* a lot of improvements ([64f75da](https://github.com/pedronauck/docz/commit/64f75da)) +* add new Playground component ([7bf03b2](https://github.com/pedronauck/docz/commit/7bf03b2)) +* **gatsby-theme-docz:** add new Props component ([8eb780d](https://github.com/pedronauck/docz/commit/8eb780d)) +* add typescript support (need fix) ([13947f9](https://github.com/pedronauck/docz/commit/13947f9)) +* docz running using gatsby under the hood ([10ffd48](https://github.com/pedronauck/docz/commit/10ffd48)) + + + + + +# [1.2.0](https://github.com/pedronauck/docz/compare/v1.1.0...v1.2.0) (2019-05-08) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +# [1.1.0](https://github.com/pedronauck/docz/compare/v1.0.4...v1.1.0) (2019-05-01) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +## [1.0.4](https://github.com/pedronauck/docz/compare/v1.0.3...v1.0.4) (2019-04-18) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +## [1.0.3](https://github.com/pedronauck/docz/compare/v1.0.2...v1.0.3) (2019-04-15) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +## [1.0.2](https://github.com/pedronauck/docz/compare/v1.0.1...v1.0.2) (2019-04-15) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +## [1.0.1](https://github.com/pedronauck/docz/compare/v1.0.0...v1.0.1) (2019-04-14) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +# [1.0.0](https://github.com/pedronauck/docz/compare/v1.0.0-rc.8...v1.0.0) (2019-04-11) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +# [1.0.0-rc.4](https://github.com/pedronauck/docz/compare/v1.0.0-rc.3...v1.0.0-rc.4) (2019-03-29) + + +### Bug Fixes + +* add missing dependency on examples ([af8ec2d](https://github.com/pedronauck/docz/commit/af8ec2d)) + + + + + +# [1.0.0-rc.3](https://github.com/pedronauck/docz/compare/v1.0.0-rc.2...v1.0.0-rc.3) (2019-03-21) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +# [1.0.0-beta.0](https://github.com/pedronauck/docz/compare/v1.0.0-alpha.1...v1.0.0-beta.0) (2019-03-19) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +# [1.0.0-alpha.1](https://github.com/pedronauck/docz/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2019-03-19) + +**Note:** Version bump only for package docz-example-gatsby + + + + + +# [1.0.0-alpha.0](https://github.com/pedronauck/docz/compare/v0.13.5...v1.0.0-alpha.0) (2019-03-19) + + +### Bug Fixes + +* gatsby theme fixes ([dcc5f19](https://github.com/pedronauck/docz/commit/dcc5f19)) +* **gatsby-theme-docz:** add specific nodes for entries ([26f7f90](https://github.com/pedronauck/docz/commit/26f7f90)) +* **gatsby-theme-docz:** add ssr support for styled-components ([b490010](https://github.com/pedronauck/docz/commit/b490010)) +* define right internal dependencies version ([30a91b4](https://github.com/pedronauck/docz/commit/30a91b4)) + + +### Features + +* add initial gatsby integration ([#630](https://github.com/pedronauck/docz/issues/630)) ([70d40cc](https://github.com/pedronauck/docz/commit/70d40cc)), closes [#609](https://github.com/pedronauck/docz/issues/609) +* new Props component ([80451b1](https://github.com/pedronauck/docz/commit/80451b1)) diff --git a/examples/monorepo/packages/docs-site/README.md b/examples/monorepo/packages/docs-site/README.md new file mode 100644 index 000000000..47e797ae0 --- /dev/null +++ b/examples/monorepo/packages/docs-site/README.md @@ -0,0 +1,38 @@ +# Docz Gatsby Example + +This example shows you how you can use docz as a [Gatsby Theme](https://www.gatsbyjs.org/blog/2018-11-11-introducing-gatsby-themes/) inside your project. + + +## Using `create-docz-app` + +```sh +npx create-docz-app docz-app-gatsby --example gatsby +# or +yarn create docz-app docz-app-gatsby --example gatsby +``` + +## Download + +```sh +curl https://codeload.github.com/pedronauck/docz/tar.gz/master | tar -xz --strip=2 docz-master/examples/gatsby +mv gatsby docz-gatsby-example +cd docz-gatsby-example +``` + +## Setup + +```sh +yarn # npm i +``` + +## Start developing + +```sh +yarn dev # npm run dev +``` + +## Build + +```sh +yarn build # npm run build +``` diff --git a/examples/monorepo/packages/docs-site/doczrc.js b/examples/monorepo/packages/docs-site/doczrc.js new file mode 100644 index 000000000..404ff5523 --- /dev/null +++ b/examples/monorepo/packages/docs-site/doczrc.js @@ -0,0 +1,3 @@ +export default { + menu: ['Home', 'Components'], +} diff --git a/examples/monorepo/packages/docs-site/gatsby-config.js b/examples/monorepo/packages/docs-site/gatsby-config.js new file mode 100644 index 000000000..6f31bb845 --- /dev/null +++ b/examples/monorepo/packages/docs-site/gatsby-config.js @@ -0,0 +1,9 @@ +module.exports = { + plugins: [ + 'gatsby-theme-docz', + `gatsby-transformer-sharp`, + // this (optional) plugin enables Progressive Web App + Offline functionality + // To learn more, visit: https://gatsby.dev/offline + // `gatsby-plugin-offline`, + ], +} diff --git a/examples/monorepo/packages/docs-site/package.json b/examples/monorepo/packages/docs-site/package.json new file mode 100644 index 000000000..5c91e7313 --- /dev/null +++ b/examples/monorepo/packages/docs-site/package.json @@ -0,0 +1,35 @@ +{ + "name": "docz-example-gatsby-monorepo", + "description": "Example of how to integrate docz with gatsby as a theme in a monorepo", + "version": "2.0.0-rc.6", + "keywords": [ + "gatsby", + "docz" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/pedronauck/docz/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/pedronauck/docz.git" + }, + "scripts": { + "dev": "gatsby develop", + "build": "gatsby build", + "serve": "gatsby serve" + }, + "dependencies": { + "gatsby": "^2.13.73", + "gatsby-plugin-offline": "^2.2.7", + "gatsby-plugin-sharp": "^2.2.18", + "gatsby-theme-docz": "2.0.0-rc.6", + "gatsby-transformer-sharp": "^2.2.7", + "my-super-special-button": "0.1.0", + "prop-types": "^15.7.2", + "react": "^16.9.0", + "react-dom": "^16.9.0", + "react-helmet": "^5.2.1", + "scheduler": "^0.15.0" + } +} diff --git a/examples/monorepo/packages/docs-site/src/Button.mdx b/examples/monorepo/packages/docs-site/src/Button.mdx new file mode 100644 index 000000000..a99f97ff5 --- /dev/null +++ b/examples/monorepo/packages/docs-site/src/Button.mdx @@ -0,0 +1,67 @@ +--- +name: Button +menu: Components +route: / +--- + +import { Playground, Props } from "docz"; +import { Button } from "my-super-special-button"; + +# Button + +Button make common actions more obvious and help users more easily perform them. Buttons use labels and sometimes icons to communicate the action that will occur when the user touches them. + +### Best practices + +- Group buttons logically into sets based on usage and importance. +- Ensure that button actions are clear and consistent. +- The main action of a group set can be a primary button. +- Select a single button variation and do not mix them. + +## Properties + + + +## Basic usage + + + + + +## With different sizes + + + + + + + +## With different colors + + + + + + + + + +## Outlined + + + + + + + + diff --git a/examples/monorepo/packages/docs-site/src/pages/404.js b/examples/monorepo/packages/docs-site/src/pages/404.js new file mode 100644 index 000000000..c196eae26 --- /dev/null +++ b/examples/monorepo/packages/docs-site/src/pages/404.js @@ -0,0 +1,10 @@ +import React from 'react' + +const NotFoundPage = () => ( + <> +

NOT FOUND

+

You just hit a route that doesn't exist... the sadness.

+ +) + +export default NotFoundPage diff --git a/examples/monorepo/packages/my-super-special-button/.gitignore b/examples/monorepo/packages/my-super-special-button/.gitignore new file mode 100644 index 000000000..26404ec2d --- /dev/null +++ b/examples/monorepo/packages/my-super-special-button/.gitignore @@ -0,0 +1,8 @@ +*.log +.DS_Store +node_modules +.cache +.rts2_cache_cjs +.rts2_cache_esm +.rts2_cache_umd +dist diff --git a/examples/monorepo/packages/my-super-special-button/README.md b/examples/monorepo/packages/my-super-special-button/README.md new file mode 100644 index 000000000..697c66e50 --- /dev/null +++ b/examples/monorepo/packages/my-super-special-button/README.md @@ -0,0 +1,167 @@ +# TSDX React User Guide + +Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it. + +> This TSDX setup is meant for developing React components (not apps!) that can be published to NPM. If you’re looking to build an app, you should use `create-react-app`, `razzle`, `nextjs`, `gatsby`, or `react-static`. + +> If you’re new to TypeScript and React, checkout [this handy cheatsheet](https://github.com/sw-yx/react-typescript-cheatsheet/) + +## Commands + +TSDX scaffolds your new library inside `/src`, and also sets up a [Parcel-based](https://parceljs.org) playground for it inside `/example`. + +The recommended workflow is to run TSDX in one terminal: + +``` +npm start # or yarn start +``` + +This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`. + +Then run the example inside another: + +``` +cd example +npm i # or yarn to install dependencies +npm start # or yarn start +``` + +The default example imports and live reloads whatever is in `/dist`, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. **No symlinking required**, [we use Parcel's aliasing](https://github.com/palmerhq/tsdx/pull/88/files). + +To do a one-off build, use `npm run build` or `yarn build`. + +To run tests, use `npm test` or `yarn test`. + +## Configuration + +Code quality is [set up for you](https://github.com/palmerhq/tsdx/pull/45/files) with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly. + +### Jest + +Jest tests are set up to run with `npm test` or `yarn test`. This runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit. + +#### Setup Files + +This is the folder structure we set up for you: + +``` +/example + index.html + index.tsx # test your component here in a demo app + package.json + tsconfig.json +/src + index.tsx # EDIT THIS +/test + blah.test.tsx # EDIT THIS +.gitignore +package.json +README.md # EDIT THIS +tsconfig.json +``` + +#### React Testing Library + +We do not set up `react-testing-library` for you yet, we welcome contributions and documentation on this. + +### Rollup + +TSDX uses [Rollup v1.x](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details. + +### TypeScript + +`tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs. + +## Continuous Integration + +### Travis + +_to be completed_ + +### Circle + +_to be completed_ + +## Optimizations + +Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations: + +```js +// ./types/index.d.ts +declare var __DEV__: boolean; + +// inside your code... +if (__DEV__) { + console.log('foo'); +} +``` + +You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions. + +## Module Formats + +CJS, ESModules, and UMD module formats are supported. + +The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found. + +## Using the Playground + +``` +cd example +npm i # or yarn to install dependencies +npm start # or yarn start +``` + +The default example imports and live reloads whatever is in `/dist`, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. **No symlinking required**! + +## Deploying the Playground + +The Playground is just a simple [Parcel](https://parceljs.org) app, you can deploy it anywhere you would normally deploy that. Here are some guidelines for **manually** deploying with the Netlify CLI (`npm i -g netlify-cli`): + +```bash +cd example # if not already in the example folder +npm run build # builds to dist +netlify deploy # deploy the dist folder +``` + +Alternatively, if you already have a git repo connected, you can set up continuous deployment with Netlify: + +```bash +netlify init +# build command: cd example && yarn && yarn build +# directory to deploy: example/dist +# pick yes for netlify.toml +``` + +## Named Exports + +Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library. + +## Including Styles + +There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like. + +For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader. + +## Publishing to NPM + +We recommend using https://github.com/sindresorhus/np. + +## Usage with Lerna + +When creating a new package with TSDX within a project set up with Lerna, you might encounter a `Cannot resolve dependency` error when trying to run the `example` project. To fix that you will need to make changes to the `package.json` file _inside the `example` directory_. + +The problem is that due to the nature of how dependencies are installed in Lerna projects, the aliases in the example project's `package.json` might not point to the right place, as those dependencies might have been installed in the root of your Lerna project. + +Change the `alias` to point to where those packages are actually installed. This depends on the directory structure of your Lerna project, so the actual path might be different from the diff below. + +```diff + "alias": { +- "react": "../node_modules/react", +- "react-dom": "../node_modules/react-dom" ++ "react": "../../../node_modules/react", ++ "react-dom": "../../../node_modules/react-dom" + }, +``` + +An alternative to fixing this problem would be to remove aliases altogether and define the dependencies referenced as aliases as dev dependencies instead. [However, that might cause other problems.](https://github.com/palmerhq/tsdx/issues/64) diff --git a/examples/monorepo/packages/my-super-special-button/example/.npmignore b/examples/monorepo/packages/my-super-special-button/example/.npmignore new file mode 100644 index 000000000..587e4ec7a --- /dev/null +++ b/examples/monorepo/packages/my-super-special-button/example/.npmignore @@ -0,0 +1,3 @@ +node_modules +.cache +dist \ No newline at end of file diff --git a/examples/monorepo/packages/my-super-special-button/example/index.html b/examples/monorepo/packages/my-super-special-button/example/index.html new file mode 100644 index 000000000..547e2e042 --- /dev/null +++ b/examples/monorepo/packages/my-super-special-button/example/index.html @@ -0,0 +1,14 @@ + + + + + + + Playground + + + +
+ + + diff --git a/examples/monorepo/packages/my-super-special-button/example/index.tsx b/examples/monorepo/packages/my-super-special-button/example/index.tsx new file mode 100644 index 000000000..8023d7e1b --- /dev/null +++ b/examples/monorepo/packages/my-super-special-button/example/index.tsx @@ -0,0 +1,14 @@ +import 'react-app-polyfill/ie11'; +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import { Button } from '../.'; + +const App = () => { + return ( +
+
+ ); +}; + +ReactDOM.render(, document.getElementById('root')); diff --git a/examples/monorepo/packages/my-super-special-button/example/package.json b/examples/monorepo/packages/my-super-special-button/example/package.json new file mode 100644 index 000000000..2b9a863b4 --- /dev/null +++ b/examples/monorepo/packages/my-super-special-button/example/package.json @@ -0,0 +1,24 @@ +{ + "name": "example", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "scripts": { + "start": "parcel index.html", + "build": "parcel build index.html" + }, + "dependencies": { + "react-app-polyfill": "^1.0.0" + }, + "alias": { + "react": "../node_modules/react", + "react-dom": "../node_modules/react-dom/profiling", + "scheduler/tracing": "../node_modules/scheduler/tracing-profiling" + }, + "devDependencies": { + "@types/react": "^16.8.15", + "@types/react-dom": "^16.8.4", + "parcel": "^1.12.3", + "typescript": "^3.4.5" + } +} diff --git a/examples/monorepo/packages/my-super-special-button/example/tsconfig.json b/examples/monorepo/packages/my-super-special-button/example/tsconfig.json new file mode 100644 index 000000000..6d518675d --- /dev/null +++ b/examples/monorepo/packages/my-super-special-button/example/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": false, + "target": "es5", + "module": "commonjs", + "jsx": "react", + "moduleResolution": "node", + "noImplicitAny": false, + "noUnusedLocals": false, + "noUnusedParameters": false, + "removeComments": true, + "strictNullChecks": true, + "preserveConstEnums": true, + "sourceMap": true, + "lib": ["es2015", "es2016", "dom"], + "baseUrl": ".", + "types": ["node"] + } +} diff --git a/examples/monorepo/packages/my-super-special-button/package.json b/examples/monorepo/packages/my-super-special-button/package.json new file mode 100644 index 000000000..ffebd2d6d --- /dev/null +++ b/examples/monorepo/packages/my-super-special-button/package.json @@ -0,0 +1,46 @@ +{ + "name": "my-super-special-button", + "version": "0.1.0", + "main": "dist/index.js", + "module": "dist/button.esm.js", + "typings": "dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "start": "tsdx watch", + "build": "tsdx build", + "test": "tsdx test --env=jsdom", + "lint": "tsdx lint" + }, + "peerDependencies": { + "react": ">=16" + }, + "husky": { + "hooks": { + "pre-commit": "pretty-quick --staged" + } + }, + "prettier": { + "printWidth": 80, + "semi": true, + "singleQuote": true, + "trailingComma": "es5" + }, + "devDependencies": { + "@types/jest": "^24.0.18", + "@types/react": "^16.9.2", + "@types/react-dom": "^16.9.0", + "husky": "^3.0.4", + "prettier": "^1.18.2", + "pretty-quick": "^1.11.1", + "react": "^16.9.0", + "react-dom": "^16.9.0", + "tsdx": "^0.9.0", + "tslib": "^1.10.0", + "typescript": "^3.6.2" + }, + "dependencies": { + "@emotion/styled": "^10.0.15" + } +} diff --git a/examples/monorepo/packages/my-super-special-button/src/index.tsx b/examples/monorepo/packages/my-super-special-button/src/index.tsx new file mode 100644 index 000000000..e6b9e6df6 --- /dev/null +++ b/examples/monorepo/packages/my-super-special-button/src/index.tsx @@ -0,0 +1,79 @@ +import React from 'react'; +import styled from '@emotion/styled'; +import t from 'prop-types'; + +const scales = { + small: ` + padding: 5px 10px; + font-size: 14px; + `, + normal: ` + padding: 10px 20px; + font-size: 16px; + `, + big: ` + padding: 20px 30px; + font-size: 18px; + `, +}; + +const kind = (outline: string) => (bg: string, color: string) => { + const boxShadowColor = outline ? bg : 'transparent'; + const backgroundColor = outline ? 'transparent' : bg; + + return ` + background: ${backgroundColor}; + box-shadow: inset 0 0 0 1px ${boxShadowColor}; + color: ${outline ? bg : color}; + transition: all .3s; + + &:hover { + box-shadow: inset 0 0 0 1000px ${boxShadowColor}; + color: ${color}; + } + `; +}; +//@ts-ignore +const kinds = outline => { + const get = kind(outline); + + return { + primary: get('#1FB6FF', 'white'), + secondary: get('#5352ED', 'white'), + cancel: get('#FF4949', 'white'), + dark: get('#273444', 'white'), + gray: get('#8492A6', 'white'), + }; +}; +//@ts-ignore +const getScale = (({ scale = 'normal' }) => scales[scale]) as any; + +const getKind: any = ({ kind = 'primary', outline = false }: any) => { + //@ts-ignore + return kinds(outline)[kind]; +}; + +const ButtonStyled = styled.button` + ${getKind}; + ${getScale}; + cursor: pointer; + margin: 3px 5px; + border: none; + border-radius: 3px; +`; + +export const Button = ({ children, ...props }: any) => { + return {children}; +}; + +Button.propTypes = { + scales: t.oneOf(['small', 'normal', 'big']), + kind: t.oneOf(['primary', 'secondary', 'cancel', 'dark', 'gray']), + outline: t.bool, +}; + +Button.defaultProps = { + scales: 'normal', + kind: 'primary', + outline: false, +}; diff --git a/examples/monorepo/packages/my-super-special-button/test/blah.test.tsx b/examples/monorepo/packages/my-super-special-button/test/blah.test.tsx new file mode 100644 index 000000000..45e2dcfa8 --- /dev/null +++ b/examples/monorepo/packages/my-super-special-button/test/blah.test.tsx @@ -0,0 +1,11 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import { Button } from '../src'; + +describe('it', () => { + it('renders without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(