Skip to content

Commit

Permalink
Removed a bunch of stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
FortunatM committed Jan 30, 2021
1 parent cd0140f commit 28f20a2
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 527 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/main.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/size.yml

This file was deleted.

46 changes: 5 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# TSDX 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 libraries (not apps!) that can be published to NPM. If you’re looking to build a Node app, you could use `ts-node-dev`, plain `ts-node`, or simple `tsc`.
> If you’re new to TypeScript, checkout [this handy cheatsheet](https://devhints.io/typescript)
## Commands

TSDX scaffolds your new library inside `/src`.
Expand All @@ -22,28 +14,22 @@ To do a one-off build, use `npm run build` or `yarn build`.

To run tests, use `npm test` or `yarn test`.

```bash
npm run lunch
```
This will lunch chromium and download the sermons in a `json/spurgeongems.json` file located at the root of the project.

## Configuration

Code quality is set up for you 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`.

### Bundle Analysis

[`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`.

#### Setup Files

This is the folder structure we set up for you:

```txt
/src
index.tsx # EDIT THIS
/test
blah.test.tsx # EDIT THIS
.gitignore
package.json
README.md # EDIT THIS
tsconfig.json
Expand All @@ -57,8 +43,6 @@ TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rol

`tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.

## Continuous Integration

### GitHub Actions

Two actions are added by default:
Expand All @@ -81,23 +65,3 @@ if (__DEV__) {
```

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.

## 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 [np](https://github.com/sindresorhus/np).
Binary file modified example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.0",
"version": "1.0.0",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
10 changes: 9 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import puppeteer from 'puppeteer';
import fs from 'fs';

(async () => {
console.time('done...');
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://www.spurgeongems.org/spurgeon-audio/');
Expand Down Expand Up @@ -31,7 +32,14 @@ import fs from 'fs';
}),
);

fs.writeFileSync('spurgeongems.json', JSON.stringify(data, null, 2));
fs.mkdir('json', {recursive: true}, async (err) =>{
if (err) {
await browser.close();
throw err;
};
fs.writeFileSync('json/spurgeongems.json', JSON.stringify(data, null, 2));
});

console.timeEnd('done...');
await browser.close();
})();
Loading

0 comments on commit 28f20a2

Please sign in to comment.