Add json and markdown to lint workflow + add automation workflow (#1039)

* add json to lint workflow

* add markdown to lint workflow

* fix markdown linting errors + add outline to devguide

* rename build workflow step

* Spellcheck markdown files in lint workflow

* make linter happy - fix spelling mistakes

* bugfix

* add problem-matcher to xml linter

* add markdown error to test problem matcher

* Add merge-conflicts workflow

* fix merge conflict

* Fix markdown linting errors

* Fix markdown spelling errors

* recommend markdownlint extension for vscode

* auto add new PRs to Project board + combine with merge conflicts workflow

* Move intro text above outline
This commit is contained in:
Charles Ewert 2023-02-24 21:16:48 -05:00 committed by GitHub
parent 710cd275f2
commit d6a1f60fab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 3584 additions and 37 deletions

35
.github/workflows/automations.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Automation 🤖
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- unstable
pull_request_target:
types:
- synchronize
jobs:
project:
name: Project board 📊
runs-on: ubuntu-latest
steps:
- uses: alex-page/github-project-automation-plus@v0.8.2
if: ${{ github.event_name == 'pull_request_target' }}
continue-on-error: true
with:
project: Ongoing development
column: In progress
repo-token: ${{ secrets.JF_BOT_TOKEN }}
label:
name: Labeling 🏷️
runs-on: ubuntu-latest
steps:
- name: Check all PRs for merge conflicts ⛔
uses: eps1lon/actions-label-merge-conflict@releases/2.x
with:
dirtyLabel: 'merge conflict'
repoToken: ${{ secrets.JF_BOT_TOKEN }}

View File

@ -5,7 +5,7 @@ on:
paths-ignore: paths-ignore:
- 'locale/**' - 'locale/**'
jobs: jobs:
run: roku-app:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3

View File

@ -27,3 +27,34 @@ jobs:
run: xmllint --noout ./locale/*/*.ts run: xmllint --noout ./locale/*/*.ts
- name: Check XML for duplicate entries - name: Check XML for duplicate entries
run: xmlstarlet sel -t -m '/TS/context/message/source' -o 'Duplicate entry found in:' -f -o ' ' -c '.' -nl ./locale/*/*.ts | sort | uniq -d run: xmlstarlet sel -t -m '/TS/context/message/source' -o 'Duplicate entry found in:' -f -o ' ' -c '.' -nl ./locale/*/*.ts | sort | uniq -d
json:
runs-on: ubuntu-latest
steps:
- name: Clone github repo
uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: "lts/*"
cache: "npm"
- name: Install npm dependencies
run: npm ci
- name: Install roku package dependencies
run: npx ropm install
- name: Validate JSON syntax
run: npm run lint-json
markdown:
runs-on: ubuntu-latest
steps:
- name: Clone github repo
uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: "lts/*"
cache: "npm"
- name: Install npm dependencies
run: npm ci
- name: Install roku package dependencies
run: npx ropm install
- uses: xt0rted/markdownlint-problem-matcher@v2
- name: Lint markdown files
run: npm run lint-markdown

5
.jsonlintrc Normal file
View File

@ -0,0 +1,5 @@
{
"ignore": [
"node_modules/**/*"
]
}

15
.markdownlint.yml Normal file
View File

@ -0,0 +1,15 @@
---
# MD013/line-length
MD013: false
# MD033/no-inline-html
MD033: false
# MD025/single-title
MD025:
# Ignore front matter 'title' property, it is not used in generated markup
front_matter_title: ""
# MD026/no-trailing-punctuation
MD026:
# Allow headings to end with '?'
punctuation: ".,;:!"
# MD028/no-blanks-blockquote
MD028: false

17
.spelling Normal file
View File

@ -0,0 +1,17 @@
jellyfin
brightscript
vscode
roku
github
pre-release
sideload
dev
repo
hardcode
hardcoding
breakpoint
DEVGUIDE
runtime
translations.ts
en_US
ing

View File

@ -4,7 +4,8 @@
// List of extensions which should be recommended for users of this workspace. // List of extensions which should be recommended for users of this workspace.
"recommendations": [ "recommendations": [
"RokuCommunity.brightscript", "RokuCommunity.brightscript",
"redhat.vscode-xml" "redhat.vscode-xml",
"davidanson.vscode-markdownlint"
], ],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [] "unwantedRecommendations": []

View File

@ -1,11 +1,35 @@
## Developing The Jellyfin Roku App # Dev Guide For The Jellyfin Roku App
Follow the steps below to install the app on your personal Roku device for development.
### Developer Mode Follow the steps below to install the app on your personal Roku device. This will enable you to write code for the app, install the latest beta release, as well as provide app logs to the developers if you encounter a bug.
- [Dev Guide For The Jellyfin Roku App](#dev-guide-for-the-jellyfin-roku-app)
- [Developer Mode](#developer-mode)
- [Clone the GitHub Repo](#clone-the-github-repo)
- [Method 1: Visual Studio Code](#method-1-visual-studio-code)
- [Install VSCode](#install-vscode)
- [Usage](#usage)
- [Hardcoding Roku Information](#hardcoding-roku-information)
- [Method 2: Sideload to Roku Device Manually](#method-2-sideload-to-roku-device-manually)
- [Method 3: Direct load to Roku Device](#method-3-direct-load-to-roku-device)
- [Login Details](#login-details)
- [Install Necessary Packages](#install-necessary-packages)
- [Deploy](#deploy)
- [Bug/Crash Reports](#bugcrash-reports)
- [Upgrade](#upgrade)
- [Command Line Workflow](#command-line-workflow)
- [Committing](#committing)
- [(Optional) Update Images](#optional-update-images)
- [Adding a User Setting](#adding-a-user-setting)
- [The order of any particular menu is as follows](#the-order-of-any-particular-menu-is-as-follows)
- [When giving your setting a name](#when-giving-your-setting-a-name)
- [When giving your setting a description](#when-giving-your-setting-a-description)
- [**Remember to add all new strings to locale/en\_US/translations.ts**](#remember-to-add-all-new-strings-to-localeen_ustranslationsts)
## Developer Mode
Put your Roku device in [developer mode](https://blog.roku.com/developer/2016/02/04/developer-setup-guide). Write down your Roku device IP and the password you created, you will need these later. Put your Roku device in [developer mode](https://blog.roku.com/developer/2016/02/04/developer-setup-guide). Write down your Roku device IP and the password you created, you will need these later.
### Clone the GitHub Repo ## Clone the GitHub Repo
Navigate to where you'd like to install the app then copy the application files: Navigate to where you'd like to install the app then copy the application files:
@ -25,16 +49,17 @@ Install Dependencies:
npm install npm install
``` ```
## Method 1: Visual Studio Code ## Method 1: Visual Studio Code
We recommend using Visual Studio Code when working on this project. The [BrightScript Language extension](https://marketplace.visualstudio.com/items?itemName=RokuCommunity.brightscript) provides a rich debugging experience, including in-editor syntax checking, debugging/breakpoint support, variable inspection at runtime, auto-formatting, an integrated remote control mode, and [much more](https://rokucommunity.github.io/vscode-brightscript-language/features.html). We recommend using Visual Studio Code when working on this project. The [BrightScript Language extension](https://marketplace.visualstudio.com/items?itemName=RokuCommunity.brightscript) provides a rich debugging experience, including in-editor syntax checking, debugging/breakpoint support, variable inspection at runtime, auto-formatting, an integrated remote control mode, and [much more](https://rokucommunity.github.io/vscode-brightscript-language/features.html).
### Installation ### Install VSCode
1. Download and install [Visual Studio Code](https://code.visualstudio.com/) 1. Download and install [Visual Studio Code](https://code.visualstudio.com/)
2. Install the **BrightScript Language** extension within VSCode in the _Extensions_ panel or by downloading it from the [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=RokuCommunity.brightscript). 2. Install the **BrightScript Language** extension within VSCode in the _Extensions_ panel or by downloading it from the [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=RokuCommunity.brightscript).
### Usage ### Usage
1. Open the `jellyfin-roku` folder in vscode 1. Open the `jellyfin-roku` folder in vscode
2. Press `F5` on your keyboard or click `Run` -> `Start Debugging` from the vscode menu. ![image](https://user-images.githubusercontent.com/2544493/170696233-8ba49bf4-bebb-4655-88f3-ac45150dda02.png) 2. Press `F5` on your keyboard or click `Run` -> `Start Debugging` from the vscode menu. ![image](https://user-images.githubusercontent.com/2544493/170696233-8ba49bf4-bebb-4655-88f3-ac45150dda02.png)
@ -42,8 +67,8 @@ We recommend using Visual Studio Code when working on this project. The [BrightS
That's it! vscode will auto-package the project, sideload it to the specified device, and the channel is up and running. (assuming you remembered to put your device in [developer mode](#developer-mode)) That's it! vscode will auto-package the project, sideload it to the specified device, and the channel is up and running. (assuming you remembered to put your device in [developer mode](#developer-mode))
### Hardcoding Roku Information ### Hardcoding Roku Information
Out of the box, the Brightscript extension will prompt you to pick a Roku device (from devices found on your local network) and enter a password on every launch. If you'd prefer to hardcode this information rather than entering it every time, you can set these values in your vscode user settings: Out of the box, the Brightscript extension will prompt you to pick a Roku device (from devices found on your local network) and enter a password on every launch. If you'd prefer to hardcode this information rather than entering it every time, you can set these values in your vscode user settings:
```js ```js
@ -58,13 +83,14 @@ Example:
## Method 2: Sideload to Roku Device Manually ## Method 2: Sideload to Roku Device Manually
### Install Necessary Packages Install Necessary Packages
```bash ```bash
sudo apt-get install wget make zip sudo apt-get install wget make zip
``` ```
### Build the package Build the package
```bash ```bash
make dev make dev
``` ```
@ -124,11 +150,11 @@ Deploy the app:
make install make install
``` ```
### Command Line Workflow ## Command Line Workflow
Modify code -> `make install` -> Use Roku remote to test changes -> `telnet ${ROKU_DEV_TARGET} 8085` -> `CTRL + ]` -> `quit + ENTER` Modify code -> `make install` -> Use Roku remote to test changes -> `telnet ${ROKU_DEV_TARGET} 8085` -> `CTRL + ]` -> `quit + ENTER`
Unfortunately there is no debuger. You will need to use telnet to see log statements, warnings, and error reports. You won't always need to telnet into your device but the workflow above is typical when you are new to Brightscript or are working on tricky code. Unfortunately there is no debugger. You will need to use telnet to see log statements, warnings, and error reports. You won't always need to telnet into your device but the workflow above is typical when you are new to Brightscript or are working on tricky code.
Install necessary packages: Install necessary packages:
@ -136,9 +162,9 @@ Install necessary packages:
sudo apt-get install nodejs npm sudo apt-get install nodejs npm
``` ```
### Committing ## Committing
Before commiting your code, please run: Before committing your code, please run:
```bash ```bash
make prep_commit make prep_commit
@ -146,7 +172,7 @@ make prep_commit
This will format your code and run the CI checks locally to ensure you will pass the CI tests. This will format your code and run the CI checks locally to ensure you will pass the CI tests.
### (Optional) Update Images ## (Optional) Update Images
This repo already contains all necessary images for the app. This script only needs to be run when the [official Jellyfin images](https://github.com/jellyfin/jellyfin-ux) are changed to allow us to update the repo images. This repo already contains all necessary images for the app. This script only needs to be run when the [official Jellyfin images](https://github.com/jellyfin/jellyfin-ux) are changed to allow us to update the repo images.
@ -163,22 +189,23 @@ make get_images
``` ```
## Adding a User Setting ## Adding a User Setting
Your new functionality may need a setting to configure its behavior, or, sometimes, we may ask you to add a setting for your new functionality, so that users may enable or disable it. If you find yourself in this position, please observe the following considerations when adding your new user setting. Your new functionality may need a setting to configure its behavior, or, sometimes, we may ask you to add a setting for your new functionality, so that users may enable or disable it. If you find yourself in this position, please observe the following considerations when adding your new user setting.
### The order of any particular menu is as follows: ### The order of any particular menu is as follows
First, any menu titled "General." 1. Any menu titled "General."
Second, any settings that have children, in alphabetical order. 2. Any settings that have children, in alphabetical order.
Third, any settings that do not have children, in alphabetical order. 3. Any settings that do not have children, in alphabetical order.
### When giving your setting a name ### When giving your setting a name
Ideally, your setting will be named with a relevant noun such as ```Cinema Mode``` or ```Codec Support.``` Sometimes there is no such name that is sufficiently specific, such as with ```Clock```. In this case you must use a verb phrase to name your setting, such as ```Hide Clock.``` If your verb phrase *must* be long to be specific, you may drop implied verbs if absolutely necessary, such as how ```Text Subtitles Only``` drops the implied ```Show.``` Do not use the infinitive form ```action-doing``` or ```doing stuff.``` Instead, use the imperative: ```Do Action``` or ```Do Stuff.``` Remember that *characters are a commodity in names.* Ideally, your setting will be named with a relevant noun such as ```Cinema Mode``` or ```Codec Support.``` Sometimes there is no such name that is sufficiently specific, such as with ```Clock```. In this case you must use a verb phrase to name your setting, such as ```Hide Clock.``` If your verb phrase _must_ be long to be specific, you may drop implied verbs if absolutely necessary, such as how ```Text Subtitles Only``` drops the implied ```Show.``` Do not use the infinitive form ```action-doing``` or ```doing stuff.``` Instead, use the imperative: ```Do Action``` or ```Do Stuff.``` Remember that _characters are a commodity in names._
Generally, we should not repeat the name of a setting's parent in the setting's name. Being a child of that parent implies that the settings are related to it. Generally, we should not repeat the name of a setting's parent in the setting's name. Being a child of that parent implies that the settings are related to it.
### When giving your setting a description ### When giving your setting a description
A setting's description should begin with a grammatically correct, complete, imperative sentence that ends with a period. *Characters are not a commodity in descriptions* so be specific. Again, do not use infinitive verb phrases ("...ing" should not appear anywhere in the text of your setting). While the first sentence should be imperative, additional sentences may be necessary to tell your user how to use the setting or why its doing what its doing. If you *must* use non-imperative sentences, be concise and consider the fact that your description will need to be translated into many languages. Do not use colloquialism, metaphor, or idiomatic phrases. A setting's description should begin with a grammatically correct, complete, imperative sentence that ends with a period. _Characters are not a commodity in descriptions_ so be specific. Again, do not use infinitive verb phrases ("...ing" should not appear anywhere in the text of your setting). While the first sentence should be imperative, additional sentences may be necessary to tell your user how to use the setting or why its doing what its doing. If you _must_ use non-imperative sentences, be concise and consider the fact that your description will need to be translated into many languages. Do not use colloquialism, metaphor, or idiomatic phrases.
#### **Remember to add all new strings to locale/en_US/translations.ts** #### **Remember to add all new strings to locale/en_US/translations.ts**

View File

@ -1,7 +1,5 @@
<p> <h1 style="text-align: center;">Jellyfin app for Roku</h1>
<h1 style="text-align: center;">Jellyfin app for Roku</h1> <h3 style="text-align: center;">Part of the <a href="https://jellyfin.media/">Jellyfin</a> Project</h3>
<h3 style="text-align: center;">Part of the <a href="https://jellyfin.media/">Jellyfin</a> Project</h3>
</p>
<p align="center"> <p align="center">
<img alt="Logo banner" src="https://raw.githubusercontent.com/jellyfin/jellyfin-ux/master/branding/SVG/banner-logo-solid.svg?sanitize=true"/> <img alt="Logo banner" src="https://raw.githubusercontent.com/jellyfin/jellyfin-ux/master/branding/SVG/banner-logo-solid.svg?sanitize=true"/>
@ -26,8 +24,6 @@
The Jellyfin Roku App is a Jellyfin client for Roku Devices. This is still very much a work in progress, so we would encourage you to [get involved](#get_involved) if you can. The Jellyfin Roku App is a Jellyfin client for Roku Devices. This is still very much a work in progress, so we would encourage you to [get involved](#get_involved) if you can.
## Getting Started ## Getting Started
The channel is available on the [Roku Channel Store](https://my.roku.com/add/jellyfin). The channel is available on the [Roku Channel Store](https://my.roku.com/add/jellyfin).
@ -40,4 +36,4 @@ Feature requests are always welcome too, but please have a read though the exist
If you fancy some development, then read the [DEVGUIDE](DEVGUIDE.md) to find out the best ways to help. If you fancy some development, then read the [DEVGUIDE](DEVGUIDE.md) to find out the best ways to help.
As Roku have severely limited their Beta channel programme, the best way to test pre-release versions is by following the [DEVGUIDE](DEVGUIDE.md) to install and test the latest changes. Feedback is always welcome. As Roku have severely limited their Beta channel program, the best way to test pre-release versions is by following the [DEVGUIDE](DEVGUIDE.md) to install and test the latest changes. Feedback is always welcome.

3427
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,13 +6,18 @@
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "0.8.1", "@rokucommunity/bslint": "0.8.1",
"brighterscript": "0.61.3", "brighterscript": "0.61.3",
"ropm": "0.10.11" "ropm": "0.10.11",
"jsonlint-cli": "1.0.1",
"markdownlint-cli": "0.33.0",
"markdown-spellcheck": "1.3.1"
}, },
"scripts": { "scripts": {
"postinstall": "npx ropm copy", "postinstall": "npx ropm copy",
"validate": "npx bsc --copy-to-staging=false --create-package=false", "validate": "npx bsc --copy-to-staging=false --create-package=false",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"lint": "bslint", "lint": "bslint",
"lint-json": "jsonlint-cli **/*.json",
"lint-markdown": "markdownlint **/*.md --ignore node_modules && mdspell --en-us -r **/*.md !**/node_modules/**/*.md",
"check-formatting": "npx bsfmt --check", "check-formatting": "npx bsfmt --check",
"format": "npx bsfmt --write" "format": "npx bsfmt --write"
}, },