Skip to content

Commit f1a2643

Browse files
committed
Tweak docs
1 parent 6225b8e commit f1a2643

File tree

10 files changed

+1058
-812
lines changed

10 files changed

+1058
-812
lines changed

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ prog
288288
scripts: {
289289
start: 'tsdx watch',
290290
build: 'tsdx build',
291-
test: template === 'react' ? 'tsdx test --env=jsdom --passWithNoTests' : 'tsdx test',
291+
test:
292+
template === 'react'
293+
? 'tsdx test --env=jsdom --passWithNoTests'
294+
: 'tsdx test',
292295
lint: 'tsdx lint',
293296
},
294297
peerDependencies: template === 'react' ? { react: '>=16' } : {},

website/docs/api.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: api
3-
title: API
3+
title: API Reference
44
---
55

66
### `tsdx watch`
@@ -19,14 +19,16 @@ Options
1919
--format Specify module format(s) (default cjs,esm)
2020
--tsconfig Specify your custom tsconfig path (default <root-folder>/tsconfig.json)
2121
--verbose Keep outdated console output in watch mode instead of clearing the screen
22+
--noClean Don't clean the dist folder
2223
-h, --help Displays this message
2324
2425
Examples
2526
$ tsdx watch --entry src/foo.tsx
2627
$ tsdx watch --target node
2728
$ tsdx watch --name Foo
2829
$ tsdx watch --format cjs,esm,umd
29-
$ tsdx build --tsconfig ./tsconfig.foo.json
30+
$ tsdx watch --tsconfig ./tsconfig.foo.json
31+
$ tsdx watch --noClean
3032
```
3133
3234
### `tsdx build`
@@ -73,11 +75,13 @@ Options
7375
--fix Fixes fixable errors and warnings
7476
--ignore-pattern Ignore a pattern
7577
--write-file Write the config file locally
78+
--report-file Write JSON report to file locally
7679
-h, --help Displays this message
7780
7881
Examples
7982
$ tsdx lint src
8083
$ tsdx lint src --fix
8184
$ tsdx lint src test --ignore-pattern test/foo.ts
8285
$ tsdx lint src --write-file
86+
$ tsdx lint src --report-file report.json
8387
```

website/docs/starthere.md renamed to website/docs/get-started.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
---
2-
id: starthere
2+
id: get-started
33
title: Getting Started
44
---
55

6+
## Overview
7+
8+
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.
9+
10+
## Features
11+
12+
TSDX comes with the "battery-pack included" and is part of a complete TypeScript breakfast:
13+
14+
- 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
15+
- Comes with treeshaking, ready-to-rock lodash optimizations, and minification/compression
16+
- Live reload / watch-mode
17+
- Works with React
18+
- Human readable error messages (and in VSCode-friendly format)
19+
- Bundle size snapshots
20+
- Opt-in to extract `invariant` error codes
21+
- Jest test runner setup with sensible defaults via `tsdx test`
22+
- Zero-config, single dependency
23+
624
## Quick Start
725

826
```

website/docs/features.md renamed to website/docs/philosophy.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
---
2-
id: features
3-
title: Features
2+
id: philosophy
3+
title: Philosophy
44
---
55

6-
## Features
7-
8-
TSDX comes with the "battery-pack included" and is part of a complete TypeScript breakfast:
9-
10-
- 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
11-
- Comes with treeshaking, ready-to-rock lodash optimizations, and minification/compression
12-
- Live reload / watch-mode
13-
- Works with React
14-
- Human readable error messages (and in VSCode-friendly format)
15-
- Bundle size snapshots
16-
- Opt-in to extract `invariant` error codes
17-
- Jest test runner setup with sensible defaults via `tsdx test`
18-
- Zero-config, single dependency
19-
206
## Inspiration
217

228
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.

website/docusaurus.config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ module.exports = {
2121
src: 'img/logo.svg',
2222
},
2323
links: [
24-
{ to: 'docs/starthere', label: 'Docs', position: 'right' },
25-
{ to: 'blog', label: 'Blog', position: 'right' },
24+
{ to: 'docs/get-started', label: 'Docs', position: 'right' },
25+
{ to: 'help', label: 'Help', position: 'right' },
26+
{ to: 'users', label: 'Users', position: 'right' },
27+
// { to: 'blog', label: 'Blog', position: 'right' },
2628
{
2729
href: 'https://github.com/palmerhq/tsdx',
2830
label: 'GitHub',
@@ -31,14 +33,14 @@ module.exports = {
3133
],
3234
},
3335
footer: {
34-
style: 'dark',
36+
style: 'light',
3537
links: [
3638
{
3739
title: 'Docs',
3840
items: [
3941
{
4042
label: 'Docs',
41-
to: 'docs/starthere',
43+
to: 'docs/get-started',
4244
},
4345
],
4446
},

website/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
"deploy": "docusaurus deploy"
1111
},
1212
"dependencies": {
13-
"@docusaurus/core": "^2.0.0-alpha.24",
14-
"@docusaurus/preset-classic": "^2.0.0-alpha.24",
13+
"@docusaurus/core": "^2.0.0-alpha.32",
14+
"@docusaurus/preset-classic": "^2.0.0-alpha.32",
1515
"classnames": "^2.2.6",
16-
"react": "^16.8.4",
17-
"react-dom": "^16.8.4"
16+
"react": "^16.11.0",
17+
"react-dom": "^16.11.0"
1818
},
1919
"browserslist": {
2020
"production": [

website/sidebars.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77

88
module.exports = {
99
docs: {
10-
Guide: ['features', 'starthere', 'optimizations', 'customization', 'api'],
10+
Guide: [
11+
'get-started',
12+
'optimizations',
13+
'customization',
14+
'philosophy',
15+
'api',
16+
],
1117
Contributing: ['docusaurus', 'contributing'],
1218
},
1319
};

website/src/pages/help.js

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/**
2+
* Copyright (c) 2017-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import React from 'react';
9+
import Layout from '@theme/Layout';
10+
11+
import Link from '@docusaurus/Link';
12+
import useBaseUrl from '@docusaurus/useBaseUrl';
13+
14+
function Help() {
15+
return (
16+
<Layout permalink="/help" description="Docusaurus 2 Help page">
17+
<div className="container margin-vert--xl">
18+
<div className="text--center margin-bottom--xl">
19+
<h1>Need Help?</h1>
20+
<p>
21+
If you need help with TSDX, you can try one of the mechanisms below.
22+
</p>
23+
</div>
24+
<div className="row">
25+
<div className="col">
26+
<h2>Browse the docs</h2>
27+
<p>
28+
Learn more about Docusaurus using the{' '}
29+
<Link to={useBaseUrl('docs/get-started')}>
30+
official documentation.
31+
</Link>
32+
</p>
33+
</div>
34+
<div className="col">
35+
<h2>Twitter</h2>
36+
<p>
37+
You can follow and contact the maintainers on Twitter{' '}
38+
<a
39+
target="_blank"
40+
rel="noreferrer noopener"
41+
href="https://twitter.com/jaredpalmer"
42+
>
43+
@jaredpalmer
44+
</a>{' '}
45+
and{' '}
46+
<a
47+
target="_blank"
48+
rel="noreferrer noopener"
49+
href="https://twitter.com/swyx"
50+
>
51+
@swyx
52+
</a>
53+
.
54+
</p>
55+
</div>
56+
<div className="col">
57+
<h2>GitHub</h2>
58+
<p>
59+
At our{' '}
60+
<a
61+
target="_blank"
62+
rel="noreferrer noopener"
63+
href="https://github.com/jaredpalmer/tsdx"
64+
>
65+
GitHub repo
66+
</a>{' '}
67+
Browse and submit{' '}
68+
<a
69+
target="_blank"
70+
rel="noreferrer noopener"
71+
href="https://github.com/jaredpalmer/tsdx/issues"
72+
>
73+
issues
74+
</a>{' '}
75+
or{' '}
76+
<a
77+
target="_blank"
78+
rel="noreferrer noopener"
79+
href="https://github.com/jaredpalmer/tsdx/pulls"
80+
>
81+
pull requests
82+
</a>{' '}
83+
for bugs you find or any new features you may want implemented. Be
84+
sure to also check out our{' '}
85+
<a
86+
target="_blank"
87+
rel="noreferrer noopener"
88+
href="https://github.com/jaredpalmer/tsdx/blob/master/CONTRIBUTING.md"
89+
>
90+
contributing guide
91+
</a>
92+
.
93+
</p>
94+
</div>
95+
</div>
96+
</div>
97+
</Layout>
98+
);
99+
}
100+
101+
export default Help;

website/src/pages/index.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import classnames from 'classnames';
1010
import Layout from '@theme/Layout';
1111
import Link from '@docusaurus/Link';
1212
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
13-
import withBaseUrl from '@docusaurus/withBaseUrl';
13+
import useBaseUrl from '@docusaurus/useBaseUrl';
1414
import styles from './styles.module.css';
1515

1616
const features = [
@@ -32,7 +32,7 @@ const features = [
3232
description: (
3333
<>
3434
TSDX is a zero-config CLI that helps you develop, test, and publish
35-
modern TypeScript packages with ease--so you can focus on your awesome
35+
modern TypeScript packages use ease--so you can focus on your awesome
3636
new library and not waste another afternoon on the configuration.
3737
</>
3838
),
@@ -43,24 +43,24 @@ const features = [
4343
description: (
4444
<ul>
4545
<li>
46-
Bundles your code with{' '}
46+
Bundles your code use{' '}
4747
<a href="https://github.com/rollup/rollup">Rollup</a> and outputs
4848
multiple module formats (CJS &amp; ESM by default, and also UMD if you
4949
want) plus development and production builds
5050
</li>
5151
<li>
52-
Comes with treeshaking, ready-to-rock lodash optimizations, and
52+
Comes use treeshaking, ready-to-rock lodash optimizations, and
5353
minification/compression
5454
</li>
5555
<li>Live reload / watch-mode</li>
56-
<li>Works with React</li>
56+
<li>Works use React</li>
5757
<li>Human readable error messages (and in VSCode-friendly format)</li>
5858
<li>Bundle size snapshots</li>
5959
<li>
6060
Opt-in to extract <code>invariant</code> error codes
6161
</li>
6262
<li>
63-
Jest test runner setup with sensible defaults via{' '}
63+
Jest test runner setup use sensible defaults via{' '}
6464
<code>tsdx test</code>
6565
</li>
6666
<li>Zero-config, single dependency</li>
@@ -72,6 +72,7 @@ const features = [
7272
function Home() {
7373
const context = useDocusaurusContext();
7474
const { siteConfig = {} } = context;
75+
const baseUrl = useBaseUrl('/');
7576
return (
7677
<Layout
7778
title={`Hello from ${siteConfig.title}`}
@@ -112,7 +113,7 @@ function Home() {
112113
styles.getStarted
113114
)}
114115
style={{ marginRight: '1rem' }}
115-
to={withBaseUrl('docs/starthere')}
116+
to={useBaseUrl('docs/get-started')}
116117
>
117118
Get Started
118119
</Link>
@@ -153,7 +154,7 @@ cd mylib && yarn start`}
153154
<div className="text--center">
154155
<img
155156
className={styles.featureImage}
156-
src={withBaseUrl(imageUrl)}
157+
src={baseUrl + imageUrl}
157158
alt={title}
158159
/>
159160
</div>

0 commit comments

Comments
 (0)