mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-21 22:27:11 +00:00
Lint fix (#1035)
* User HTTP instead of HTTPS when fetching icon in docker internal network * Add debug statement. * Revert "Add debug statement." This reverts commit7fbb12a4bd
. * Revert "User HTTP instead of HTTPS when fetching icon in docker internal network" This reverts commit498de660ba
. * Always replace host with internal host * Fix lint script * Remove prettier from pre-commit --------- Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
parent
ffe95ee1c6
commit
ac2a83a7a6
6
.babelrc
6
.babelrc
|
@ -10,11 +10,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
["@babel/typescript", {"isTSX": true, "allExtensions": true}]
|
["@babel/typescript", { "isTSX": true, "allExtensions": true }]
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@babel/plugin-transform-runtime",
|
"@babel/plugin-transform-runtime",
|
||||||
["babel-plugin-inferno", { "imports": true }],
|
["babel-plugin-inferno", { "imports": true }],
|
||||||
["@babel/plugin-proposal-class-properties", { "loose": true }],
|
["@babel/plugin-proposal-class-properties", { "loose": true }]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
generate_translations.js
|
generate_translations.js
|
||||||
webpack.config.js
|
webpack.config.js
|
||||||
src/api_tests
|
src/api_tests
|
||||||
|
**/*.png
|
||||||
|
**/*.svg
|
||||||
|
**/*.css
|
||||||
|
**/*.scss
|
|
@ -3,9 +3,7 @@
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true
|
"browser": true
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": ["@typescript-eslint"],
|
||||||
"@typescript-eslint"
|
|
||||||
],
|
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
|
12
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
12
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
|
@ -1,10 +1,9 @@
|
||||||
---
|
---
|
||||||
name: "\U0001F41E Bug Report"
|
name: "\U0001F41E Bug Report"
|
||||||
about: Create a report to help us improve Lemmy
|
about: Create a report to help us improve Lemmy
|
||||||
title: ''
|
title: ""
|
||||||
labels: bug
|
labels: bug
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Found a bug? Please fill out the sections below. 👍
|
Found a bug? Please fill out the sections below. 👍
|
||||||
|
@ -15,7 +14,6 @@ For backend issues, use [lemmy](https://github.com/LemmyNet/lemmy)
|
||||||
|
|
||||||
A summary of the bug.
|
A summary of the bug.
|
||||||
|
|
||||||
|
|
||||||
### Steps to Reproduce
|
### Steps to Reproduce
|
||||||
|
|
||||||
1. (for example) I clicked login, and an endless spinner show up.
|
1. (for example) I clicked login, and an endless spinner show up.
|
||||||
|
@ -24,6 +22,6 @@ A summary of the bug.
|
||||||
|
|
||||||
### Technical details
|
### Technical details
|
||||||
|
|
||||||
* Please post your log: `sudo docker-compose logs > lemmy_log.out`.
|
- Please post your log: `sudo docker-compose logs > lemmy_log.out`.
|
||||||
* What OS are you trying to install lemmy on?
|
- What OS are you trying to install lemmy on?
|
||||||
* Any browser console errors?
|
- Any browser console errors?
|
||||||
|
|
5
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
5
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
|
@ -1,10 +1,9 @@
|
||||||
---
|
---
|
||||||
name: "\U0001F680 Feature request"
|
name: "\U0001F680 Feature request"
|
||||||
about: Suggest an idea for improving Lemmy
|
about: Suggest an idea for improving Lemmy
|
||||||
title: ''
|
title: ""
|
||||||
labels: enhancement
|
labels: enhancement
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
For backend issues, use [lemmy](https://github.com/LemmyNet/lemmy)
|
For backend issues, use [lemmy](https://github.com/LemmyNet/lemmy)
|
||||||
|
|
5
.github/ISSUE_TEMPLATE/QUESTION.md
vendored
5
.github/ISSUE_TEMPLATE/QUESTION.md
vendored
|
@ -1,10 +1,9 @@
|
||||||
---
|
---
|
||||||
name: "? Question"
|
name: "? Question"
|
||||||
about: General questions about Lemmy
|
about: General questions about Lemmy
|
||||||
title: ''
|
title: ""
|
||||||
labels: question
|
labels: question
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
What's the question you have about lemmy?
|
What's the question you have about lemmy?
|
||||||
|
|
5
.github/ISSUE_TEMPLATE/hexbear.md
vendored
5
.github/ISSUE_TEMPLATE/hexbear.md
vendored
|
@ -1,10 +1,9 @@
|
||||||
---
|
---
|
||||||
name: Hexbear
|
name: Hexbear
|
||||||
about: For hexbear issues
|
about: For hexbear issues
|
||||||
title: ''
|
title: ""
|
||||||
labels: hexbear
|
labels: hexbear
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
For hexbear-related issues
|
For hexbear-related issues
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
src/shared/translations
|
src/shared/translations
|
||||||
|
lemmy-translations
|
|
@ -69,7 +69,7 @@ pipeline:
|
||||||
|
|
||||||
publish_release_docker_manifest:
|
publish_release_docker_manifest:
|
||||||
image: plugins/manifest
|
image: plugins/manifest
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
password:
|
password:
|
||||||
|
@ -85,7 +85,7 @@ pipeline:
|
||||||
|
|
||||||
publish_latest_release_docker_manifest:
|
publish_latest_release_docker_manifest:
|
||||||
image: plugins/manifest
|
image: plugins/manifest
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
password:
|
password:
|
||||||
|
|
42
README.md
42
README.md
|
@ -1,21 +1,21 @@
|
||||||
# lemmy-ui
|
# lemmy-ui
|
||||||
|
|
||||||
The official web app for [Lemmy](https://github.com/LemmyNet/lemmy), written in inferno.
|
The official web app for [Lemmy](https://github.com/LemmyNet/lemmy), written in inferno.
|
||||||
|
|
||||||
Based off of MrFoxPro's [inferno-isomorphic-template](https://github.com/MrFoxPro/inferno-isomorphic-template).
|
Based off of MrFoxPro's [inferno-isomorphic-template](https://github.com/MrFoxPro/inferno-isomorphic-template).
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
The following environment variables can be used to configure lemmy-ui:
|
The following environment variables can be used to configure lemmy-ui:
|
||||||
|
|
||||||
`ENV_VAR` | type | default | description
|
| `ENV_VAR` | type | default | description |
|
||||||
--- | --- | --- | ---
|
| ------------------------------ | -------- | ---------------- | ----------------------------------------------------------------------------------- |
|
||||||
`LEMMY_UI_HOST` | `string` | `0.0.0.0:1234` | The IP / port that the lemmy-ui isomorphic node server is hosted at.
|
| `LEMMY_UI_HOST` | `string` | `0.0.0.0:1234` | The IP / port that the lemmy-ui isomorphic node server is hosted at. |
|
||||||
`LEMMY_UI_LEMMY_INTERNAL_HOST` | `string` | `0.0.0.0:8536` | The internal IP / port that lemmy is hosted at. Often `lemmy:8536` if using docker.
|
| `LEMMY_UI_LEMMY_INTERNAL_HOST` | `string` | `0.0.0.0:8536` | The internal IP / port that lemmy is hosted at. Often `lemmy:8536` if using docker. |
|
||||||
`LEMMY_UI_LEMMY_EXTERNAL_HOST` | `string` | `0.0.0.0:8536` | The external IP / port that lemmy is hosted at. Often `DOMAIN.TLD`.
|
| `LEMMY_UI_LEMMY_EXTERNAL_HOST` | `string` | `0.0.0.0:8536` | The external IP / port that lemmy is hosted at. Often `DOMAIN.TLD`. |
|
||||||
`LEMMY_UI_LEMMY_WS_HOST` | `string` | `0.0.0.0:8536` | An alternate location for lemmy's websocket address. Not usually necessary.
|
| `LEMMY_UI_LEMMY_WS_HOST` | `string` | `0.0.0.0:8536` | An alternate location for lemmy's websocket address. Not usually necessary. |
|
||||||
`LEMMY_UI_HTTPS` | `bool` | `false` | Whether to use https.
|
| `LEMMY_UI_HTTPS` | `bool` | `false` | Whether to use https. |
|
||||||
`LEMMY_UI_EXTRA_THEMES_FOLDER` | `string` | `./extra_themes` | A location for additional lemmy css themes.
|
| `LEMMY_UI_EXTRA_THEMES_FOLDER` | `string` | `./extra_themes` | A location for additional lemmy css themes. |
|
||||||
`LEMMY_UI_DEBUG` | `bool` | `false` | Loads the [Eruda](https://github.com/liriliri/eruda) debugging utility.
|
| `LEMMY_UI_DEBUG` | `bool` | `false` | Loads the [Eruda](https://github.com/liriliri/eruda) debugging utility. |
|
||||||
`LEMMY_UI_DISABLE_CSP` | `bool` | `false` | Disables CSP security headers
|
| `LEMMY_UI_DISABLE_CSP` | `bool` | `false` | Disables CSP security headers |
|
||||||
`LEMMY_UI_CUSTOM_HTML_HEADER` | `string` | | Injects a custom script into `<head>`.
|
| `LEMMY_UI_CUSTOM_HTML_HEADER` | `string` | | Injects a custom script into `<head>`. |
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"build:prod": "webpack --mode=production",
|
"build:prod": "webpack --mode=production",
|
||||||
"clean": "yarn run rimraf dist",
|
"clean": "yarn run rimraf dist",
|
||||||
"dev": "yarn start",
|
"dev": "yarn start",
|
||||||
"lint": "node generate_translations.js && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check \"src/**/*.{ts,tsx,js,css,scss}\"",
|
"lint": "node generate_translations.js && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx \"src/**\" && prettier --check \"src/**/*.{ts,tsx,js,css,scss}\"",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"start": "yarn build:dev --watch"
|
"start": "yarn build:dev --watch"
|
||||||
},
|
},
|
||||||
|
|
|
@ -356,7 +356,7 @@ export async function generateManifestBase64(site: Site) {
|
||||||
|
|
||||||
async function fetchIconPng(iconUrl: string) {
|
async function fetchIconPng(iconUrl: string) {
|
||||||
return await fetch(
|
return await fetch(
|
||||||
iconUrl.replace(/https?:\/\/localhost:\d+/g, getHttpBaseInternal())
|
iconUrl.replace(/https?:\/\/[^\/]+/g, getHttpBaseInternal())
|
||||||
)
|
)
|
||||||
.then(res => res.blob())
|
.then(res => res.blob())
|
||||||
.then(blob => blob.arrayBuffer());
|
.then(blob => blob.arrayBuffer());
|
||||||
|
|
|
@ -1,29 +1,28 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"pretty": true,
|
"pretty": true,
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"preserveConstEnums": true,
|
"preserveConstEnums": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"lib": ["es2017", "dom"],
|
"lib": ["es2017", "dom"],
|
||||||
"types": [
|
"types": ["inferno"],
|
||||||
"inferno"
|
"jsx": "preserve",
|
||||||
],
|
"noUnusedLocals": true,
|
||||||
"jsx": "preserve",
|
"baseUrl": "./src",
|
||||||
"noUnusedLocals": true,
|
"noEmit": true,
|
||||||
"baseUrl": "./src",
|
"skipLibCheck": true,
|
||||||
"noEmit": true,
|
"noUnusedParameters": true,
|
||||||
"skipLibCheck": true,
|
"noImplicitReturns": true,
|
||||||
"noUnusedParameters": true,
|
"experimentalDecorators": true,
|
||||||
"noImplicitReturns": true,
|
"strictNullChecks": true,
|
||||||
"experimentalDecorators": true,
|
"noFallthroughCasesInSwitch": true
|
||||||
"strictNullChecks": true,
|
},
|
||||||
"noFallthroughCasesInSwitch": true
|
"include": [
|
||||||
},
|
"src/**/*.ts",
|
||||||
"include": [
|
"src/**/*.tsx",
|
||||||
"src/**/*",
|
"node_modules/inferno/dist/index.d.ts"
|
||||||
"node_modules/inferno/dist/index.d.ts"
|
]
|
||||||
]
|
}
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue