Skip to content

Commit 0e2c654

Browse files
Initial commit
0 parents  commit 0e2c654

20 files changed

+396
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Companion Module Checks
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
check:
8+
name: Check module
9+
10+
if: ${{ !contains(github.repository, 'companion-module-template-') }}
11+
12+
permissions:
13+
packages: read
14+
15+
uses: bitfocus/actions/.github/workflows/module-checks.yaml@main
16+
# with:
17+
# upload-artifact: true # uncomment this to upload the built package as an artifact to this workflow that you can download and share with others
18+

.github/workflows/node.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Node CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags:
8+
- 'v[0-9]+.[0-9]+.[0-9]+*'
9+
pull_request:
10+
11+
jobs:
12+
lint:
13+
name: Lint
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 15
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Use Node.js 22.x
20+
# This should match the version of Node.js you have defined in the manifest.json runtime field
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 22.x
24+
- name: Prepare Environment
25+
run: |
26+
corepack enable
27+
- name: Prepare Environment (For template repository)
28+
# Only run this step if the repository is a template repository
29+
# If you are using this in a module, you can remove this step
30+
if: ${{ contains(github.repository, 'companion-module-template-') }}
31+
run: |
32+
# Perform an install to generate the lockfile
33+
yarn install
34+
env:
35+
CI: false
36+
- name: Prepare module
37+
run: |
38+
yarn install
39+
env:
40+
CI: true
41+
- name: Build and check types
42+
run: |
43+
yarn build
44+
env:
45+
CI: true
46+
- name: Run lint
47+
run: |
48+
yarn lint
49+
env:
50+
CI: true
51+
52+
# Uncomment this to enable running unit tests
53+
# test:
54+
# name: Test
55+
# runs-on: ubuntu-latest
56+
# timeout-minutes: 15
57+
58+
# steps:
59+
# - uses: actions/checkout@v4
60+
# - name: Use Node.js 22.x
61+
# uses: actions/setup-node@v4
62+
# with:
63+
# node-version: 22.x
64+
# - name: Prepare Environment
65+
# run: |
66+
# corepack enable
67+
# yarn install
68+
# env:
69+
# CI: true
70+
# - name: Run tests
71+
# run: |
72+
# yarn test
73+
# env:
74+
# CI: true
75+
# - name: Send coverage
76+
# uses: codecov/codecov-action@v5

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
package-lock.json
3+
/pkg
4+
/pkg.tgz
5+
/dist
6+
DEBUG-*
7+
/.yarn

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lint-staged

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package.json
2+
/LICENSE.md

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Bitfocus AS - Open Source
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# companion-module-[replace with module name]
2+
3+
See [HELP.md](./companion/HELP.md) and [LICENSE](./LICENSE)
4+
5+
## Getting started
6+
7+
Executing a `yarn` command should perform all necessary steps to develop the module, if it does not then follow the steps below.
8+
9+
The module can be built once with `yarn build`. This should be enough to get the module to be loadable by companion.
10+
11+
While developing the module, by using `yarn dev` the compiler will be run in watch mode to recompile the files on change.

companion/HELP.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Your module
2+
3+
Write some help for your users here!

companion/manifest.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"id": "your-module-name",
3+
"name": "your-module-name",
4+
"shortname": "module-shortname",
5+
"description": "A short one line description of your module",
6+
"version": "0.0.0",
7+
"license": "MIT",
8+
"repository": "git+https://github.com/bitfocus/companion-module-your-module-name.git",
9+
"bugs": "https://github.com/bitfocus/companion-module-your-module-name/issues",
10+
"maintainers": [
11+
{
12+
"name": "Your name",
13+
"email": "Your email"
14+
}
15+
],
16+
"runtime": {
17+
"type": "node22",
18+
"api": "nodejs-ipc",
19+
"apiVersion": "0.0.0",
20+
"entrypoint": "../dist/main.js"
21+
},
22+
"legacyIds": [],
23+
"manufacturer": "Your company",
24+
"products": ["Your product"],
25+
"keywords": []
26+
}

0 commit comments

Comments
 (0)