Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the legacy way of creating adapters without classes #1094

Merged
merged 3 commits into from
Feb 12, 2024
Merged
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
3 changes: 1 addition & 2 deletions .github/create_templates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { blue, green, red } from "ansi-colors";
import { execSync, ExecSyncOptions } from "child_process";
import { ExecSyncOptions, execSync } from "child_process";
import * as fs from "fs-extra";
import * as path from "path";
import { createAdapter } from "../src";
Expand Down Expand Up @@ -46,7 +46,6 @@ const adapterAnswers: Answers = {
startMode: "daemon",
features: ["adapter"],
connectionIndicator: "no",
es6class: "yes",
type: "general",
adminFeatures: ["custom", "tab"],
adminUi: "json",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* (theknut) Make ioBroker types available in the test directory (#1091)
* (theknut) Add `licenseInformation` field to `io-package.json` (#1092)
* (AlCalzone) Remove the `subscribe` start mode (#1093)
* (AlCalzone) Remove the legacy way of creating adapters without classes (#1094)

## 2.6.1 (2024-01-15)
* (AlCalzone) Fixed an issue with TypeScript tests caused by #1082 (fixes #1084)
Expand Down
26 changes: 0 additions & 26 deletions src/lib/core/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -770,31 +770,6 @@ export const questionGroups: QuestionGroup[] = [
migrate: async (ctx) =>
(await ctx.analyzeCode('"', "'")) ? "double" : "single",
},
{
condition: { name: "features", contains: "adapter" },
type: "select",
name: "es6class",
label: "ES6 Class",
expert: true,
message: "How should the main adapter file be structured?",
initial: "yes",
choices: [
{
message: "As an ES6 class",
hint: "(recommended)",
value: "yes",
},
{
message: "With some methods",
hint: "(like legacy code)",
value: "no",
},
],
migrate: async (ctx) =>
(await ctx.getMainFileContent()).match(/^[ \t]*class/gm)
? "yes"
: "no",
},
],
},
{
Expand Down Expand Up @@ -1017,7 +992,6 @@ export interface Answers {
devServerPort?: number;
indentation?: "Tab" | "Space (4)";
quotes?: "single" | "double";
es6class?: "yes" | "no";
gitRemoteProtocol: "HTTPS" | "SSH";
gitCommit?: "yes" | "no";
defaultBranch?: "main" | "master";
Expand Down
2 changes: 0 additions & 2 deletions templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ const templates: { name: string, templateFunction: TemplateFunction }[] = [
{ name: "io-package.json.ts", templateFunction: require("./io-package.json") },
{ name: "lib/adapter-config.dts.ts", templateFunction: require("./lib/adapter-config.dts") },
{ name: "LICENSE.ts", templateFunction: require("./LICENSE") },
{ name: "main.es6.js.ts", templateFunction: require("./main.es6.js") },
{ name: "main.js.ts", templateFunction: require("./main.js") },
{ name: "main.test.js.ts", templateFunction: require("./main.test.js") },
{ name: "package.json.ts", templateFunction: require("./package.json") },
{ name: "README.md.ts", templateFunction: require("./README.md") },
{ name: "src/main.es6.ts", templateFunction: require("./src/main.es6") },
{ name: "src/main.test.ts.ts", templateFunction: require("./src/main.test.ts") },
{ name: "src/main.ts.ts", templateFunction: require("./src/main.ts") },
{ name: "test/_eslintrc.json.ts", templateFunction: require("./test/_eslintrc.json") },
Expand Down
192 changes: 0 additions & 192 deletions templates/main.es6.js.ts

This file was deleted.

Loading
Loading