-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from borisbu/develop
Releasing 1.4.0
- Loading branch information
Showing
15 changed files
with
4,060 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master, develop ] | ||
pull_request: | ||
branches: [ master, develop ] | ||
|
||
jobs: | ||
UI: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get yarn cache dir | ||
id: yarnCache | ||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- name: Cache node modules | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-yarn | ||
with: | ||
path: ${{ steps.yarnCache.outputs.dir }} | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} | ||
- name: Install dependencies | ||
working-directory: ts | ||
run: yarn install | ||
- name: Lint | ||
working-directory: ts | ||
run: yarn lint | ||
- name: Test | ||
working-directory: ts | ||
run: yarn test | ||
- name: Build JS | ||
working-directory: ts | ||
run: yarn build | ||
- name: Check changes | ||
# https://unix.stackexchange.com/questions/155046/determine-if-git-working-directory-is-clean-from-a-script | ||
run: | | ||
if output=$(git status --porcelain) && [ -z "$output" ]; then | ||
echo OK | ||
else | ||
echo Building the JS caused changes that has to be committed and pushed manually. | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"env": { | ||
"es6": true, | ||
"browser": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"airbnb-typescript/base", | ||
"prettier", | ||
"plugin:prettier/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "script", | ||
"project": "./tsconfig.json" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"prettier", | ||
"import" | ||
], | ||
"rules": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/// <reference types="jquery" /> | ||
|
||
interface JQuery { | ||
/** @see https://github.com/OctoPrint/OctoPrint/blob/1.9.0/src/octoprint/static/js/lib/bootstrap/bootstrap-modal.js */ | ||
modal(option: "show" | "hide"): JQuery; | ||
} | ||
|
||
interface ViewModel { | ||
construct: (params: object[]) => void; | ||
dependencies: string[]; | ||
} | ||
|
||
declare const OCTOPRINT_VIEWMODELS: Array<ViewModel>; | ||
|
||
/** @see https://github.com/OctoPrint/OctoPrint/blob/1.9.0/docs/jsclientlib/base.rst */ | ||
declare const OctoPrint: { | ||
simpleApiCommand: ( | ||
plugin: string, | ||
command: string, | ||
payload: object, | ||
opts?: object | ||
) => JQuery.Promise<any>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`OctoRelayViewModel Constructor should set its certain properties 1`] = ` | ||
{ | ||
"loginState": { | ||
"login": true, | ||
}, | ||
"onDataUpdaterPluginMessage": [Function], | ||
"settingsViewModel": { | ||
"settings": true, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`OctoRelayViewModel Message handler should process the supplied configuration: $() 1`] = ` | ||
[ | ||
[ | ||
"#relaisr1", | ||
], | ||
[ | ||
"#ralayIconr1", | ||
], | ||
[ | ||
"#relaisr2", | ||
], | ||
[ | ||
"#ralayIconr2", | ||
], | ||
[ | ||
"#relaisr3", | ||
], | ||
[ | ||
"#ralayIconr3", | ||
], | ||
[ | ||
"#relaisr4", | ||
], | ||
[ | ||
"#ralayIconr4", | ||
], | ||
[ | ||
"#relaisr5", | ||
], | ||
[ | ||
"#ralayIconr5", | ||
], | ||
] | ||
`; | ||
|
||
exports[`OctoRelayViewModel Message handler should process the supplied configuration: .attr() 1`] = ` | ||
[ | ||
[ | ||
"title", | ||
"Nozzle Light", | ||
], | ||
[ | ||
"title", | ||
"Printer", | ||
], | ||
[ | ||
"title", | ||
"Fan", | ||
], | ||
[ | ||
"title", | ||
"Chassis Light", | ||
], | ||
[ | ||
"title", | ||
"R5", | ||
], | ||
] | ||
`; | ||
|
||
exports[`OctoRelayViewModel Message handler should process the supplied configuration: .find() 1`] = ` | ||
[ | ||
[ | ||
".modal-title", | ||
], | ||
[ | ||
"#octorelay-confirmation-text", | ||
], | ||
[ | ||
".btn-cancel", | ||
], | ||
[ | ||
".btn-confirm", | ||
], | ||
] | ||
`; | ||
|
||
exports[`OctoRelayViewModel Message handler should process the supplied configuration: .html() 1`] = ` | ||
[ | ||
[ | ||
"<div>💡</div>", | ||
], | ||
[ | ||
"<img src="plugin/dashboard/static/img/printer-icon.png">", | ||
], | ||
[ | ||
"<img src="plugin/dashboard/static/img/fan-icon.png">", | ||
], | ||
[ | ||
"<div>🌞</div>", | ||
], | ||
[ | ||
"ON", | ||
], | ||
] | ||
`; | ||
exports[`OctoRelayViewModel Message handler should process the supplied configuration: .text() 1`] = ` | ||
[ | ||
[ | ||
"Turning Printer off", | ||
], | ||
[ | ||
"Are you sure you want to turn the Printer off?", | ||
], | ||
] | ||
`; | ||
exports[`OctoRelayViewModel Message handler should process the supplied configuration: .toggle() 1`] = ` | ||
[ | ||
[ | ||
true, | ||
], | ||
[ | ||
true, | ||
], | ||
[ | ||
true, | ||
], | ||
[ | ||
true, | ||
], | ||
[ | ||
false, | ||
], | ||
] | ||
`; | ||
exports[`OctoRelayViewModel Should push the model into the registry 1`] = ` | ||
{ | ||
"construct": [Function], | ||
"dependencies": [ | ||
"settingsViewModel", | ||
"loginStateViewModel", | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"transform": { | ||
"^.+\\.ts$": [ | ||
"@swc/jest" | ||
] | ||
}, | ||
"collectCoverage": true, | ||
"coverageReporters": [ | ||
"json", | ||
"lcov", | ||
"text", | ||
"html" | ||
] | ||
} |
Oops, something went wrong.