Skip to content

Commit 925e8ce

Browse files
committedFeb 12, 2021
Spiff up repo meta
1 parent 78d7166 commit 925e8ce

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed
 

‎.github/CONTRIBUTING.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
### Thank you for displaying interest in contributing to react-console-emulator!
2+
3+
## Repository structure
4+
5+
- `demo`
6+
- The demo site at [linuswillner.me/react-console-emulator](https://linuswillner.me/react-console-emulator). Can be previewed with `npm start` and built with `npm run build`.
7+
- `src`
8+
- Library code. All components related to how the library functions are located here.
9+
- `test`
10+
- Unit tests, powered by Jest and Puppeteer.
11+
12+
## Contribution rules
13+
14+
You're free to implement changes that you believe will benefit the project in any manner, be it documentation improvements, code changes or something else. However, please consider the following before submitting a PR:
15+
16+
- Your code must...
17+
- Work as you intend it to
18+
- Pass style checks as outlined by ESLint (`npm run lint`)
19+
- Pass the unit tests and have such written if necessary (See the `test` folder, more below)
20+
- Be documented if relevant
21+
- Have a demo terminal written, if new terminal features are introduced
22+
23+
## Testing
24+
25+
Make sure the development dependencies are installed (`npm i`). Then run `npm run test-coverage` (For coverage) or `npm run test-nocoverage` (Without coverage) before you submit your PR. All tests must pass for the PR to be considered valid.
26+
27+
**Note:** It's not recommended to run `npm test` locally, as that step also includes Codecov report uploading, which will fail locally due to missing authentication information. If you want to accurately emulate CI test flow, use `npm run test-local` instead.
28+
29+
**Note about Puppeteer testing:** The jest-puppeteer toolchain [does not currently support collecting code coverage in a non-trivial way](https://github.com/smooth-code/jest-puppeteer/issues/90), so it's fine to set `/* istanbul ignore next: Covered by interactivity tests */` for any code that is covered by tests performed by Puppeteer until this changes.

‎README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# react-console-emulator
44

5+
![Version](https://img.shields.io/npm/v/react-console-emulator) ![License](https://img.shields.io/npm/l/react-console-emulator) ![NPM downloads](https://img.shields.io/npm/dw/react-console-emulator) ![NPM bundle size](https://img.shields.io/bundlephobia/min/react-console-emulator) ![CircleCI](https://img.shields.io/circleci/build/github/linuswillner/react-console-emulator/master) ![Codecov](https://img.shields.io/codecov/c/github/linuswillner/react-console-emulator)
6+
57
A simple, powerful and highly customisable Unix terminal emulator for React.
68

79
[Live demo](https://linuswillner.me/react-console-emulator/)
@@ -19,6 +21,8 @@ A simple, powerful and highly customisable Unix terminal emulator for React.
1921

2022
## Usage
2123

24+
> See more command examples in [demo/extra/config.js](demo/extra/config.js) and [demo/App.jsx](demo/App.jsx)
25+
2226
```jsx
2327
import React, { Component } from 'react'
2428
import Terminal from 'react-console-emulator'
@@ -27,9 +31,7 @@ const commands = {
2731
echo: {
2832
description: 'Echo a passed string.',
2933
usage: 'echo <string>',
30-
fn: function () {
31-
return `${Array.from(arguments).join(' ')}`
32-
}
34+
fn: (...args) => args.join(' ')
3335
}
3436
}
3537

@@ -46,6 +48,10 @@ export default class MyTerminal extends Component {
4648
}
4749
```
4850

51+
## Contributing
52+
53+
For information on contributing, see [.github/CONTRIBUTING.md](.github/CONTRIBUTING.md).
54+
4955
## License
5056

5157
MIT © Linus Willner and Curtis Fowler.

0 commit comments

Comments
 (0)
Please sign in to comment.