1
Fork 0

Clean up package

Add LICENSE, README.md, clean up package.json, add out to .gitignore
This commit is contained in:
Tobias Berger 2022-02-07 12:07:44 +00:00 committed by GitHub
parent 6e54d8469a
commit b84fb89763
4 changed files with 123 additions and 4 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
node_modules/ node_modules/
.vercel .vercel
tsconfig.tsbuildinfo tsconfig.tsbuildinfo
out/

24
LICENSE Normal file
View file

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
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 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.
For more information, please refer to <https://unlicense.org/>

78
README.md Normal file
View file

@ -0,0 +1,78 @@
# Backend for Minimal Non-Persistent chat
Built in [TypeScript 4.5](https://www.typescriptlang.org/) with [Next.js](https://nextjs.org/), [React](https://reactjs.org/), [Preact](https://preactjs.com/), and [Sass](https://sass-lang.com/).
## Install
Run the command `yarn install` (or the equivalent in your package manager of choice).
## Develop
Run the command `yarn dev` (or the equivalent in your package manager of choice).
This will run the server in development mode.
Changes to source files will trigger a rebuild and an automatic reload of the page.
By default the application will be hosted on `http://localhost:3000`.
To change the port, pass the `--port` flag to the command. (e.g. `yarn dev --port 9090`)
### Formatting & Testing
The command `yarn type-check` (or equivalent) will run the TypeScript compiler without any output, reporting any compile-time errors or warnings.
The command `yarn lint` (or equivalent) will run the configured linters, reporting any linting errors or warnings.
Its "subcommands" are:
- `yarn lint`: runs all configured linters
- `yarn lint:eslint`: runs [ESLint](https://eslint.org/) with the rules set in `.eslintrc.json`, ignoring files in `.eslintignore`
- `yarn lint:prettier`: runs [Prettier](https://prettier.io/) with the rules set in `.prettierrc`
The command `yarn test` (or equivalent) will run the type checker and the configured linters in strict mode. It will fail if there are any warnings or errors reported. It will (or should, at least) automatically run when you create a new git commit.
Its "subcommands" are:
- `yarn test`: runs the type checker and both linter test-scripts
- `yarn test:eslint`: runs [ESLint](https://eslint.org/) lint-script, but disallows any warnings or errors
- `yarn test:prettier`: runs [Prettier](https://prettier.io/) lint-script
- prettier's test and lint script are equivalent, by prettier's design
The command `yarn fix` (or equivalent) will format all source files using the configured linters.
Its "subcommands" are:
- `yarn fix`: formats all source files using both linter fix-scripts
- `yarn fix:eslint`: runs the eslint lint-script, but fixes any fixable errors in-place
- `yarn fix:prettier`: formats all source files only using the [Prettier](https://prettier.io/) linter
## Build
Run the command `yarn build` (or the equivalent in your package manager of choice).
This will build a production version of the application.
Barring unexpected changes, this build output will be static and suitable for deployment on a web server with no installed JavaScript runtime.
## Export
You may access the built output files manually.
For that you will need to run `yarn next export` (or the equivalent in your package manager of choice).
The files will then be available in the `out` directory.
## Run
To run a production build, run the command `yarn start` (or the equivalent in your package manager of choice).
The compiled script does not take any parameters.
Any configuration needs to be done in-source, before the [building step](#build).
This will run the built production version of the application and will fail if no such build has been created.
By default the application will be hosted on `http://localhost:3000`.
To change the port, pass the `--port` flag to the command. (e.g. `yarn start --port 9090`)
### Combined script
The combined script `yarn prod` (or equivalent) will run the build script and, if successful, the run script.
This command takes the same parameters as the `start` script.
## This package has only been tested on Linux with Node.js v17.3.0
## The page has only been tested in the Chrome browser.

View file

@ -1,6 +1,22 @@
{ {
"name": "vite-preact-ts-eslint-prettier", "name": "web-drs-frontent",
"version": "0.0.0", "version": "1.0.0",
"description": "Frontend for a non-persistent chat",
"homepage": "https://home.tobot.dev/toby/web-drs-frontend/",
"bugs": {
"url": "https://home.tobot.dev/toby/web-drs-frontend/issues",
"email": "tobi.berger13@gmail.com"
},
"license": "Unlicense",
"author": {
"name": "Tobias Berger",
"email": "tobi.berger13@gmail.com",
"url": "https://tobot.dev/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Toby222/web-drs-frontend.git"
},
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
@ -43,6 +59,6 @@
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2" "react-dom": "^17.0.2"
}, },
"pre-commit": "test", "private": true,
"license": "MIT" "pre-commit": "test"
} }