Skip to content

Commit

Permalink
Transition to the electron-forge.
Browse files Browse the repository at this point in the history
Moved from the electron-builder to electron-forge and updated the documentation because of that reason.
  • Loading branch information
SpacingBat3 committed Feb 14, 2021
1 parent 238dd55 commit fee8826
Show file tree
Hide file tree
Showing 8 changed files with 265 additions and 2,505 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
node_modules/
out/
package-lock.json
30 changes: 30 additions & 0 deletions CONTRIBUTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Notes about contribution
This file contains simplified usage of the Electron Forge to test and produce the distributables with the source code. For more detailed information, see [Electron Forge Docs](https://www.electronforge.io/).

## Run
JavaScript has a great advantage over the other standards to test an application without compiling the code – and this is also possible with the Electron-based software.

### How-to
Go to your cloned repository and execute this as a regular user:
```sh
npm i && npm start
```

## Creating distributables
Electron Forge allows to package the sources into the different standards – like DEB, SNAP or RPM.
With a help of my [AppImage maker fork](https://github.com/SpacingBat3/electron-forge-maker-appimage) it is even possible to package it to the AppImage standard.

### How-to
```sh
npm i && npm run make
```
Type `npm run make -- --help` in the Terminal for more advanced usage.

## Packaging
Sometimes you don't want to package the application (to quickly debug the application after packaging it) or there's no standard for your OS supported by the Electron Forge. Fortunelly, you can still produce the directory containing the electron binary for your OS and architecture and packaged sources in `app.asar` with the Electron Forge.

### How-to
```sh
npm i && npm run package
```
This will produce a `./out/Electron Discord Web App/` directory containig the electron binary with it's dependencies and the packaged application in `app.asar` format.
20 changes: 4 additions & 16 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# MIT License
# Released under MIT License

**Copyright © `2020-2021` `SpacingBat3`**

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
63 changes: 12 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,25 @@
[![PRs/Translations Welcome](https://img.shields.io/badge/PRs/Translations-welcome-brightgreen.svg)](#want-to-contribute-to-my-project)
[![Pi-Apps badge](https://badgen.net/badge/Pi-Apps%3F/Yes!/c51a4a?icon=https://raw.githubusercontent.com/Botspot/pi-apps/3d61f713573ba591aba50c32dd95c9df2f845b37/icons/logo.svg)](https://github.com/Botspot/pi-apps)

A Discord Web App based on the [Electron](https://github.com/electron/electron) engine.
A Discord Web App based on the [Electron](https://github.com/electron/electron) engine, tweaked with the [Electron Forge]().

It is completely indpenendent from [Discord-Electron](https://github.com/GyozaGuy/Discord-Electron), but I used it to learn why my previous attempts of doing electron discord app have failed – so I really apprieciate that someone wrote that code. I've previously forked his work, but right now I've made a seperate one – this fixed some issues that the fork had and overall improved multiple things a lot.

## Contents:
- [Run from the source](#run)
- [Install binaries](#install)
- [Build](#build)
- [Package](#package)
- [License](#license)
- [Contribution](#want-to-contribute-to-my-project)

## Run
Go to your cloned repository and execute this as a regular user:
```sh
npm install && npm start
```

## Install
Check the [releases](https://github.com/SpacingBat3/electron-discord-webapp/releases/).

## Build
I recommend building this app with the `electron-builder` tool.
Install it as node_module with:
```sh
npm install
```
The usage of it would be like:
```sh
# Build all on X86 hosts (both ARM and X86 targets)
# Also, use this command with flags instead of `dist-armhosts`
npm run dist
# Build all on ARM hosts (both ARM and X86 targets)
npm run dist-armhosts
```
If you want to run an `electron-builder` with flags, you can specify them you type `--`. For example:
```sh
npm run dist -- -l
```
will build the application with all supported flags on Linux.

For more flags and help with the usage, you can visit the [`electron-builder` docs](https://www.electron.build/) or type in the terminal:
```sh
npm run dist -- --help
```
## Package
The app uses also `electron-builder` to quickly produce unpackaged directory (eg. for testing purpouses).
You can use it (without globally installing it on your OS) like this:
```sh
npm install && npm run pack
```
This will produce a `./dist/*-unpackaged` directory containing the build.
## Docs:
- [Contribution](./CONTRIBUTIONS.md)
- [Run from the sources](./CONTRIBUTIONS.md#run)
- [Creating the distributables](./CONTRIBUTIONS.md#creating-distributables)
- [Packaging the application](./CONTRIBUTIONS.md#packaging)
- [Translating the application](./TRANSLATE.md)
- [JSON basics](./TRANSLATE.md#dont-know-the-json-syntax)
- [Credits](./TRANSLATE.md#the-people-that-hepled-me-with-the-app-translation)
- [License](./LICENSE.md)

## License
This project is redistributed under the [MIT License](LICENSE).
This project is redistributed under the [MIT License](LICENSE.md).

## Want to contribute to my project?
- If you want to improve my code, do a Pull Request and add yourself to the list of contributors in `main.js`.
- If you want to translate strings in `lang` folder, please visit [TRANSLATE.md](TRANSLATE.md).

Never made a pull request before? Please jump to [this website](http://makeapullrequest.com).
Never made a pull request before? Please reffer to [this website](http://makeapullrequest.com).
20 changes: 13 additions & 7 deletions TRANSLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How to translate?
## How to translate?
- fork this project,
- clone (download) it to your computer,
- create new folder for your translation (check [electron docs](https://www.electronjs.org/docs/api/locales) for list of possible codes – names of the folders),
Expand All @@ -7,26 +7,32 @@
- do a Pull Request (here's [random youtube tutorial](https://www.youtube.com/watch?v=dSl_qnWO104) how to do that),
- you're done!

# Don't know the JSON syntax?
I've written below the most important information about the proper JSON syntax:
## Don't know the JSON syntax?
Here's the basic information about the proper JSON syntax:
- the JSON file should begin from and end on the braces (`{`,`}`),
- JSON file can contain keys, values, arrays and objects – example use of all of these:
```json
{
"key": "value",
"array": [ "firstValue", "secondValue" ],
"object": { "firstValue", "secondValue" }
"object": { "firstKey": "firstValue", "secondKey": "secondValue" }
}
```
- the keys of JSON files needs to end with the comma (`,`) sign only when there's another key below them – for example:
- the keys of JSON files must end with the comma (`,`) signs only when there's another key after them – for an example:
```json
{
"key": "value",
"anotherKey": "anotherValue"
}
```
Adding the comma sign at the end of `"anotherKey"` or removing it from the end of `"key"` would be a syntax error.
Adding the comma sign at the end of `"anotherKey"` or removing it from the end of `"key"` would be a syntax error:
```
{
"key": "value",
"anotherKey": "anotherValue",
}
```

# The people that helped me with the app translation:
## The people that helped me with the app translation:
(add yourself there if you weren't added before/after you do a PR):
- [MrCoolAndroid](https://github.com/MrCoolAndroid) – Spanish translation
Loading

0 comments on commit fee8826

Please sign in to comment.