Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 178 additions & 25 deletions package-lock.json

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions src/lib/core/actionsAndTransformers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
checkTitle,
transformAdapterName,
transformDescription,
transformKeywords,
} from "./actionsAndTransformers";

const checkAdapterExistence = stub<string[], Promise<CheckResult>>();
Expand Down Expand Up @@ -179,3 +180,35 @@ describe("actionsAndTransformers/checkTitle()", () => {
checkTitle("foo").should.equal(true);
});
});

describe("actionsAndTransformers/transformKeywords()", () => {
it("should split keywords by comma and trim them", () => {
const result = transformKeywords("automation, IoT, integration");
expect(result).to.deep.equal(["ioBroker", "automation", "IoT", "integration"]);
});

it("should ensure 'ioBroker' is always included", () => {
const result = transformKeywords("template, automation");
expect(result).to.deep.equal(["ioBroker", "template", "automation"]);
});

it("should not duplicate 'ioBroker' if already present", () => {
const result = transformKeywords("ioBroker, template, automation");
expect(result).to.deep.equal(["ioBroker", "template", "automation"]);
});

it("should handle 'ioBroker' in different cases", () => {
const result = transformKeywords("iobroker, template");
expect(result).to.deep.equal(["iobroker", "template"]);
});

it("should return undefined for empty keyword string", () => {
const result = transformKeywords("");
expect(result).to.be.undefined;
});

it("should filter out empty keywords after splitting", () => {
const result = transformKeywords("template, , automation, ");
expect(result).to.deep.equal(["ioBroker", "template", "automation"]);
});
});
4 changes: 4 additions & 0 deletions src/lib/core/actionsAndTransformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ export function transformKeywords(keywords: string): string[] | undefined {
if (keywordsArray.length === 0) {
return undefined;
}
// Ensure "ioBroker" is always included in the keywords
if (!keywordsArray.some(k => k.toLowerCase() === "iobroker")) {
keywordsArray.unshift("ioBroker");
}
return keywordsArray;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ export function getDefaultAnswer<T extends keyof Answers>(key: T): Answers[T] |
] as any;
}
case "keywords": {
return ["template", "automation", "IoT", "integration"] as any;
return ["ioBroker", "template", "automation", "IoT", "integration"] as any;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions test/baselines/ReleaseScript_JS/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/ReleaseScript_TS/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/TS_Prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "Apache-2.0",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_JS_OfficialESLint/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_JS_OfficialESLint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_JS_React/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_JS_React/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_TS_OfficialESLint/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_TS_OfficialESLint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_TS_React/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_TS_React/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_TS_VIS_CustomESLint/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_TS_VIS_CustomESLint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_TS_VIS_OfficialESLint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_TS_WithoutBuild/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/adapter_TS_WithoutBuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/connectionIndicator_yes/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/connectionType/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/contributors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/customAdapterSettings/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/description_empty_1/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/description_empty_2/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/description_valid/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/dev-server-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/git_SSH/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/ioBroker.hello-devcontainer/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/ioBroker.hello-devcontainer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.hello-devcontainer",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/keywords/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Al Calzone <al@calzo.ne>"
],
"keywords": [
"ioBroker",
"this",
"adapter",
"uses",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/keywords/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"this",
"adapter",
"uses",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/minNodeVersion_20/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
1 change: 1 addition & 0 deletions test/baselines/minNodeVersion_22/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand Down
3 changes: 2 additions & 1 deletion test/baselines/minNodeVersion_24/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://github.com/AlCalzone/ioBroker.test-adapter",
"license": "MIT",
"keywords": [
"ioBroker",
"template",
"automation",
"IoT",
Expand All @@ -31,7 +32,7 @@
"@iobroker/testing": "^5.2.2",
"@tsconfig/node24": "^24.0.3",
"@types/iobroker": "npm:@iobroker/types@^7.1.0",
"@types/node": "^24.10.6",
"@types/node": "^24.10.7",
"@typescript-eslint/eslint-plugin": "^8.52.0",
"@typescript-eslint/parser": "^8.52.0",
"eslint": "^9.39.2",
Expand Down
Loading