Skip to content

Commit 28af860

Browse files
authored
1 parent 22fd9a2 commit 28af860

39 files changed

+3519
-4066
lines changed

Diff for: .babelrc

+5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
{
22
"presets": [ "@babel/react", [ "@babel/env" ] ],
33
"plugins": [
4+
"react-hot-loader/babel",
5+
"@babel/plugin-proposal-object-rest-spread",
46
"@babel/plugin-proposal-class-properties",
7+
"@babel/plugin-proposal-optional-chaining",
58
[ "@babel/plugin-transform-runtime", { "regenerator": true } ]
69
],
710
"env": {
811
"test": {
912
"presets": [ "@babel/react", [ "@babel/env" ] ],
1013
"plugins": [
14+
"@babel/plugin-proposal-object-rest-spread",
1115
"@babel/plugin-proposal-class-properties",
16+
"@babel/plugin-proposal-optional-chaining",
1217
[ "@babel/plugin-transform-runtime", { "regenerator": true } ]
1318
]
1419
}

Diff for: .eslintrc

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@
1313
},
1414
"sourceType": "module"
1515
},
16-
"extends": "standard",
16+
"extends": [
17+
"standard",
18+
"standard-react"
19+
],
1720
"plugins": [
1821
"standard"
19-
]
22+
],
23+
"rules": {
24+
"react/jsx-closing-bracket-location": "off",
25+
"react/jsx-handler-names": "off",
26+
"react/jsx-tag-spacing": "off"
27+
}
2028
}

Diff for: .github/logo.png

369 KB
Loading

Diff for: .npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
demo
2-
lib
2+
src
33
coverage
44
test
55
.circleci

Diff for: .vscode/tasks.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "start",
7+
"problemMatcher": [],
8+
"label": "npm: start",
9+
"detail": "cross-env NODE_ENV=development webpack-dev-server"
10+
}
11+
]
12+
}

Diff for: CHANGELOG.md

+50-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,59 @@
1+
# 4.0.0
2+
3+
This update brings with it the biggest batch of changes to react-console-emulator since its initial release. Changes include a move to a new location, major restructurations of the repository and the internal logic, a whole bunch of changes, improvements, new features and of course some bug fixes.
4+
5+
### Breaking changes
6+
7+
Moved repositories; js-rcon/react-console-emulator is now linuswillner/react-console-emulator!
8+
9+
Renamed `noAutomaticStdout` prop to `noEchoBack` for added clarity.
10+
11+
### Main changes
12+
13+
Terminal message styling is here! You can now re-style the messages output by the terminal (Including echoes, optionally with the `styleEchoBack` prop) using the `messageStyle` and `messageClassName` props ([#518](https://github.com/linuswillner/react-console-emulator/issues/518)).
14+
15+
JSX prompt labels! Prompt labels now support elements instead of just plain old strings ([#210](https://github.com/linuswillner/react-console-emulator/issues/210)).
16+
17+
Newline parsing is now possible! The terminal can now parse newline characters in terminal messages - anything with a \n character in it will be rendered as a separate line in the response message. This does of course not apply to command back-echoes. This behaviour can also be disabled, if desired, using the `noNewlineParsing` prop ([#519](https://github.com/linuswillner/react-console-emulator/issues/519)).
18+
19+
20+
Case-insensitive command matching! You can now supply the `ignoreCommandCase` prop to allow matching commands even when their casing is not correct. Do note that for security reasons, enabling case-insensitive command matching restricts command names to letters, numbers and dashes/underscores ([#415](https://github.com/linuswillner/react-console-emulator/issues/415)).
21+
22+
### Other changes
23+
24+
The acceptance of terminal input can now be controlled with a prop. Setting the `disabled` prop will enable/disable character input to the terminal.
25+
26+
Fixed an extremely long-running bug where, when the history only had one unit in it, the terminal would not correctly reset the input value and would show the same value twice. This has now finally been fixed after having been in the library for over two years.
27+
28+
Completely reworked demo page - the old one was really drab and plain, so I took the time to make it a lot more pretty and informative.
29+
30+
A full run-down of the prop changes is as follows:
31+
```diff
32+
- noAutomaticStdout
33+
+ noEchoBack
34+
+ noNewlineParsing
35+
+ ignoreCommandCase
36+
+ styleEchoBack
37+
+ messageStyle
38+
+ messageClassName
39+
+ disabled
40+
```
41+
142
# 3.0.4
243

3-
Fixed a bug preventing users from selecting text in the terminal output ([#414](https://github.com/js-rcon/react-console-emulator/issues/414)).
44+
Fixed a bug preventing users from selecting text in the terminal output ([#414](https://github.com/linuswillner/react-console-emulator/issues/414)).
445

546
# 3.0.3
647

7-
Removed redundant `stringify-object` dependency to properly enable command re-validation based on raw objects alone. This was supposed to have been fixed in 3.0.2, but due to a mishap the old validation was left dangling. This has now been fixed ([#411](https://github.com/js-rcon/react-console-emulator/issues/411)).
48+
Removed redundant `stringify-object` dependency to properly enable command re-validation based on raw objects alone. This was supposed to have been fixed in 3.0.2, but due to a mishap the old validation was left dangling. This has now been fixed ([#411](https://github.com/linuswillner/react-console-emulator/issues/411)).
849

950
# 3.0.2
1051

11-
Fixed command re-validation reliability issues relating to source-identical commands ([#35](https://github.com/js-rcon/react-console-emulator/issues/35)).
52+
Fixed command re-validation reliability issues relating to source-identical commands ([#35](https://github.com/linuswillner/react-console-emulator/issues/35)).
1253

1354
# 3.0.1
1455

15-
Fixed input outline showing on Safari ([#258](https://github.com/js-rcon/react-console-emulator/pull/258)) ([Herve07h22](https://github.com/Herve07h22)).
56+
Fixed input outline showing on Safari ([#258](https://github.com/linuswillner/react-console-emulator/pull/258)) ([Herve07h22](https://github.com/Herve07h22)).
1657

1758
# 3.0.0
1859

@@ -36,7 +77,7 @@ The following style-related props have been removed and replaced:
3677
+ inputStyle
3778
```
3879

39-
Instead of having a unique prop for styling only some parts of the terminal elements, every style aspect is now overridable. Any styles defines in [lib/defs/styles/Terminal.js](lib/defs/styles/Terminal.js) can be overridden via the new props. See [the guide](docs/CONFIG.md#re-styling) for more details.
80+
Instead of having a unique prop for styling only some parts of the terminal elements, every style aspect is now overridable. Any styles defines in [src/defs/styles/Terminal.js](src/defs/styles/Terminal.js) can be overridden via the new props. See [the guide](docs/CONFIG.md#re-styling) for more details.
4081

4182
### Other changes
4283

@@ -72,19 +113,19 @@ Enabled module transpilation to widen the support amongst Node versions for dist
72113

73114
# 1.7.2
74115

75-
Re-added Babel into build flow in a different format to improve compatibility ([#39, comment](https://github.com/js-rcon/react-console-emulator/issues/39#issuecomment-440973765)).
116+
Re-added Babel into build flow in a different format to improve compatibility ([#39, comment](https://github.com/linuswillner/react-console-emulator/issues/39#issuecomment-440973765)).
76117

77118
# 1.7.1
78119

79-
Removed Babel from the build flow in order to allow the inclusion of the helper files ([#39](https://github.com/js-rcon/react-console-emulator/issues/39)).
120+
Removed Babel from the build flow in order to allow the inclusion of the helper files ([#39](https://github.com/linuswillner/react-console-emulator/issues/39)).
80121

81122
# 1.7.0
82123

83124
Internal refactoring for better maintainability.
84125

85-
Added default-enabled automatic scrolling to the bottom of the terminal when a command is run ([#36](https://github.com/js-rcon/react-console-emulator/issues/36)).
126+
Added default-enabled automatic scrolling to the bottom of the terminal when a command is run ([#36](https://github.com/linuswillner/react-console-emulator/issues/36)).
86127

87-
Added command callback support to run a function each time a command is executed ([#36](https://github.com/js-rcon/react-console-emulator/issues/36)).
128+
Added command callback support to run a function each time a command is executed ([#36](https://github.com/linuswillner/react-console-emulator/issues/36)).
88129

89130
Added `noAutoScroll` and `commandCallback` props.
90131

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Linus Willner and Curtis Fowler
3+
Copyright (c) 2018-2020 Linus Willner and Curtis Fowler
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<img src="https://i.linuswillner.me/ot0GAp8.png" height="250px">
1+
<img src=".github/logo.png" height="250px">
22

33
# react-console-emulator
44

@@ -20,7 +20,7 @@ A simple, powerful and highly customisable Unix terminal emulator for React.
2020
## Usage
2121

2222
```jsx
23-
import React from 'react'
23+
import React, { Component } from 'react'
2424
import Terminal from 'react-console-emulator'
2525

2626
const commands = {
@@ -33,7 +33,7 @@ const commands = {
3333
}
3434
}
3535

36-
export default class MyTerminal extends React.Component {
36+
export default class MyTerminal extends Component {
3737
render () {
3838
return (
3939
<Terminal

0 commit comments

Comments
 (0)