Skip to content

Introduce Prettier as code formatter #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx pretty-quick --staged
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
dist
emscr
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ We then built a graphical user interface (GUI) on top of that, so it's easy for

![image](https://user-images.githubusercontent.com/9321076/157410455-686ce0de-335f-4335-a639-07b6963e4589.png)


## Installation

First, [install Node.js and npm](https://nodejs.org). Then clone this project and install its dependencies:
Expand All @@ -27,7 +26,6 @@ $ npm run serve

You can now view the OpenSSL Webterm at https://localhost:4200.


## Internal workings

The React GUI just builds commands (as strings). These are then called upon the terminal, which is an instance of [wasm-webterm](https://github.com/cryptool-org/wasm-webterm). If your browser supports WebWorkers (including SharedArrayBuffers and Atomics), a new Worker thread is spawned and the WebAssembly binary ([`openssl.wasm`](https://github.com/cryptool-org/openssl-webterm/blob/master/emscr/binary/openssl.wasm)) is ran there. Otherwise, it is executed on the main browser thread using a fallback (which can freeze the tab).
Expand All @@ -38,7 +36,6 @@ If the binary asks for input (reads from `/dev/stdin`), the thread will be pause

After each command, the files in the memory filesystem are gathered and passed to the React GUI.


## Compiling OpenSSL

First, [install the Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html). You can then easily recompile the OpenSSL WebAssembly binary by calling the following command. Note that this is not neccessary, as [it's already compiled](https://github.com/cryptool-org/openssl-webterm/blob/master/emscr/binary).
Expand All @@ -51,7 +48,6 @@ This will call the script in [`emscr/builds/openssl/build.sh`](https://github.co

The created files `openssl.wasm` and `openssl.js` are then copied into `emscr/binary`, where the webpack server will deliver them from.


## Contributing

Any contributions are **greatly appreciated**. If you have a suggestion that would make this better, please open an issue or fork the repository and create a pull request.
Expand Down
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react"
import ReactDOM from "react-dom"
import React from 'react';
import ReactDOM from 'react-dom';

import "./sources/translations"
import CommandLine from "./sources/OpenSSL_CommandLine"
import './sources/translations';
import CommandLine from './sources/OpenSSL_CommandLine';

import "./static/style.css"
import './static/style.css';

// initialize command line component
ReactDOM.render(<CommandLine />, document.getElementById("commandline"))
ReactDOM.render(<CommandLine />, document.getElementById('commandline'));
Loading