diff --git a/src/index.ts b/src/index.ts index 13f753fd2..9b41a7fb5 100755 --- a/src/index.ts +++ b/src/index.ts @@ -288,7 +288,10 @@ prog scripts: { start: 'tsdx watch', build: 'tsdx build', - test: template === 'react' ? 'tsdx test --env=jsdom --passWithNoTests' : 'tsdx test', + test: + template === 'react' + ? 'tsdx test --env=jsdom --passWithNoTests' + : 'tsdx test', lint: 'tsdx lint', }, peerDependencies: template === 'react' ? { react: '>=16' } : {}, diff --git a/website/docs/api.md b/website/docs/api.md index a18fb98f7..bd09a9278 100644 --- a/website/docs/api.md +++ b/website/docs/api.md @@ -1,6 +1,6 @@ --- id: api -title: API +title: API Reference --- ### `tsdx watch` @@ -19,6 +19,7 @@ Options --format Specify module format(s) (default cjs,esm) --tsconfig Specify your custom tsconfig path (default /tsconfig.json) --verbose Keep outdated console output in watch mode instead of clearing the screen + --noClean Don't clean the dist folder -h, --help Displays this message Examples @@ -26,7 +27,8 @@ Examples $ tsdx watch --target node $ tsdx watch --name Foo $ tsdx watch --format cjs,esm,umd - $ tsdx build --tsconfig ./tsconfig.foo.json + $ tsdx watch --tsconfig ./tsconfig.foo.json + $ tsdx watch --noClean ``` ### `tsdx build` @@ -73,6 +75,7 @@ Options --fix Fixes fixable errors and warnings --ignore-pattern Ignore a pattern --write-file Write the config file locally + --report-file Write JSON report to file locally -h, --help Displays this message Examples @@ -80,4 +83,5 @@ Examples $ tsdx lint src --fix $ tsdx lint src test --ignore-pattern test/foo.ts $ tsdx lint src --write-file + $ tsdx lint src --report-file report.json ``` diff --git a/website/docs/starthere.md b/website/docs/get-started.md similarity index 53% rename from website/docs/starthere.md rename to website/docs/get-started.md index 31c1c442f..d51351d1b 100755 --- a/website/docs/starthere.md +++ b/website/docs/get-started.md @@ -1,8 +1,26 @@ --- -id: starthere +id: get-started title: Getting Started --- +## Overview + +Despite all the recent hype, setting up a new TypeScript (x React) library can be tough. Between [Rollup](https://github.com/rollup/rollup), [Jest](https://github.com/facebook/jest), `tsconfig`, [Yarn resolutions](https://yarnpkg.com/en/docs/selective-version-resolutions), ESLint, and getting VSCode to play nicely....there is just a whole lot of stuff to do (and things to screw up). TSDX is a zero-config CLI that helps you develop, test, and publish modern TypeScript packages with ease--so you can focus on your awesome new library and not waste another afternoon on the configuration. + +## Features + +TSDX comes with the "battery-pack included" and is part of a complete TypeScript breakfast: + +- Bundles your code with [Rollup](https://github.com/rollup/rollup) and outputs multiple module formats (CJS & ESM by default, and also UMD if you want) plus development and production builds +- Comes with treeshaking, ready-to-rock lodash optimizations, and minification/compression +- Live reload / watch-mode +- Works with React +- Human readable error messages (and in VSCode-friendly format) +- Bundle size snapshots +- Opt-in to extract `invariant` error codes +- Jest test runner setup with sensible defaults via `tsdx test` +- Zero-config, single dependency + ## Quick Start ``` diff --git a/website/docs/features.md b/website/docs/philosophy.md similarity index 56% rename from website/docs/features.md rename to website/docs/philosophy.md index 9ccae8853..d6cc93bc3 100644 --- a/website/docs/features.md +++ b/website/docs/philosophy.md @@ -1,22 +1,8 @@ --- -id: features -title: Features +id: philosophy +title: Philosophy --- -## Features - -TSDX comes with the "battery-pack included" and is part of a complete TypeScript breakfast: - -- Bundles your code with [Rollup](https://github.com/rollup/rollup) and outputs multiple module formats (CJS & ESM by default, and also UMD if you want) plus development and production builds -- Comes with treeshaking, ready-to-rock lodash optimizations, and minification/compression -- Live reload / watch-mode -- Works with React -- Human readable error messages (and in VSCode-friendly format) -- Bundle size snapshots -- Opt-in to extract `invariant` error codes -- Jest test runner setup with sensible defaults via `tsdx test` -- Zero-config, single dependency - ## Inspiration TSDX is ripped out of [Formik's](https://github.com/jaredpalmer/formik) build tooling. TSDX is very similar to [@developit/microbundle](https://github.com/developit/microbundle), but that is because Formik's Rollup configuration and Microbundle's internals have converged around similar plugins over the last year or so. diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index db2f89d88..e723980b4 100755 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -21,8 +21,10 @@ module.exports = { src: 'img/logo.svg', }, links: [ - { to: 'docs/starthere', label: 'Docs', position: 'right' }, - { to: 'blog', label: 'Blog', position: 'right' }, + { to: 'docs/get-started', label: 'Docs', position: 'right' }, + { to: 'help', label: 'Help', position: 'right' }, + { to: 'users', label: 'Users', position: 'right' }, + // { to: 'blog', label: 'Blog', position: 'right' }, { href: 'https://github.com/palmerhq/tsdx', label: 'GitHub', @@ -31,14 +33,14 @@ module.exports = { ], }, footer: { - style: 'dark', + style: 'light', links: [ { title: 'Docs', items: [ { label: 'Docs', - to: 'docs/starthere', + to: 'docs/get-started', }, ], }, diff --git a/website/package.json b/website/package.json index 8ee1d8bf2..eedc8a949 100755 --- a/website/package.json +++ b/website/package.json @@ -10,11 +10,11 @@ "deploy": "docusaurus deploy" }, "dependencies": { - "@docusaurus/core": "^2.0.0-alpha.24", - "@docusaurus/preset-classic": "^2.0.0-alpha.24", + "@docusaurus/core": "^2.0.0-alpha.32", + "@docusaurus/preset-classic": "^2.0.0-alpha.32", "classnames": "^2.2.6", - "react": "^16.8.4", - "react-dom": "^16.8.4" + "react": "^16.11.0", + "react-dom": "^16.11.0" }, "browserslist": { "production": [ diff --git a/website/sidebars.js b/website/sidebars.js index 25d67c377..4dbb58d45 100755 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -7,7 +7,13 @@ module.exports = { docs: { - Guide: ['features', 'starthere', 'optimizations', 'customization', 'api'], + Guide: [ + 'get-started', + 'optimizations', + 'customization', + 'philosophy', + 'api', + ], Contributing: ['docusaurus', 'contributing'], }, }; diff --git a/website/src/pages/help.js b/website/src/pages/help.js new file mode 100644 index 000000000..ffdce3fb2 --- /dev/null +++ b/website/src/pages/help.js @@ -0,0 +1,101 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React from 'react'; +import Layout from '@theme/Layout'; + +import Link from '@docusaurus/Link'; +import useBaseUrl from '@docusaurus/useBaseUrl'; + +function Help() { + return ( + +
+
+

Need Help?

+

+ If you need help with TSDX, you can try one of the mechanisms below. +

+
+
+
+

Browse the docs

+

+ Learn more about Docusaurus using the{' '} + + official documentation. + +

+
+
+

Twitter

+

+ You can follow and contact the maintainers on Twitter{' '} + + @jaredpalmer + {' '} + and{' '} + + @swyx + + . +

+
+
+

GitHub

+

+ At our{' '} + + GitHub repo + {' '} + Browse and submit{' '} + + issues + {' '} + or{' '} + + pull requests + {' '} + for bugs you find or any new features you may want implemented. Be + sure to also check out our{' '} + + contributing guide + + . +

+
+
+
+
+ ); +} + +export default Help; diff --git a/website/src/pages/index.js b/website/src/pages/index.js index d70bfc17c..f0b8db1f7 100755 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -10,7 +10,7 @@ import classnames from 'classnames'; import Layout from '@theme/Layout'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import withBaseUrl from '@docusaurus/withBaseUrl'; +import useBaseUrl from '@docusaurus/useBaseUrl'; import styles from './styles.module.css'; const features = [ @@ -32,7 +32,7 @@ const features = [ description: ( <> TSDX is a zero-config CLI that helps you develop, test, and publish - modern TypeScript packages with ease--so you can focus on your awesome + modern TypeScript packages use ease--so you can focus on your awesome new library and not waste another afternoon on the configuration. ), @@ -43,24 +43,24 @@ const features = [ description: (