Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Welche Umgebung für Entwicklung

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Welche Umgebung für Entwicklung

    This topic has been deleted. Only users with topic management privileges can see it.
    • smoker2604x
      smoker2604x last edited by

      Halo zusammen,

      Welche Entwicklerumgebung benutzt ihr um Adapter zu entwickeln?

      Gesendet von meinem HUAWEI VNS-L31 mit Tapatalk

      1 Reply Last reply Reply Quote 0
      • apollon77
        apollon77 last edited by

        Ich persönlich nutze Atom.io, andere Microsoft vscode und andere noch anderes.

        IDEs die sich erweitern lassen und ne git oder sogar github Integration sind von Vorteil. Ich nutze zb so ein „Remote Sync“ Plugin für Stimmens geänderte files ( vom Laptop) dann auf den Rechner Synct beim speichern auf dem mein Test iobroker läuft.

        1 Reply Last reply Reply Quote 0
        • AlCalzone
          AlCalzone Developer last edited by

          VSCode. Wenn das einmal ordentlich eingerichtet ist, gibts nix einfacheres IMO. Git-Integration, optional Type-Checking, etc…

          1 Reply Last reply Reply Quote 0
          • D
            DeepCore last edited by

            Da möchte ich mich mal einhängen … Kämpfe mit den französischen Texten, weil die so sehr vom Kontext abhängig sind :oops:

            @AlCalzone:

            VSCode. Wenn das einmal ordentlich eingerichtet ist, gibts nix einfacheres IMO. Git-Integration, optional Type-Checking, etc… ` Könntest Du mal Deine Einrichtung erläutern? :?

            @apollon77:

            Ich nutze zb so ein „Remote Sync“ Plugin für Stimmens geänderte files ( vom Laptop) dann auf den Rechner Synct beim speichern auf dem mein Test iobroker läuft. ` Genau so etwas möchte ich benutzen, um die Übersetzungen Schritt-für-Schritt auf dem Test-ioBroker nachzuschauen 😄

            1 Reply Last reply Reply Quote 0
            • AlCalzone
              AlCalzone Developer last edited by

              @DeepCore:

              @AlCalzone:

              VSCode. Wenn das einmal ordentlich eingerichtet ist, gibts nix einfacheres IMO. Git-Integration, optional Type-Checking, etc… Könntest Du mal Deine Einrichtung erläutern?
              Konsole und Git sind ja von Haus aus drin. Mag zwar nicht jeder, aber ich bin damit einfach am schnellsten.

              Installierte Erweiterungen:

              • Auto Close Tag (für HTML/React)

              • Bookmarks

              • Coverage Gutters + Run on Save (Automatische Test-Coverage-Anzeige wenn package.json entsprechend konfiguriert ist)

              • ESLint (JS-Datei-Prüfung)

              • TSLint (TypeScript-Datei-Prüfung auf stilistische und typische Syntax-Fehler)

              TypeChecking erfordert eine entsprechend konfigurierte tsconfig.json-Datei im Projektordner, siehe https://github.com/ioBroker/ioBroker.cl … onfig.json oder https://github.com/AlCalzone/ioBroker.t ... onfig.json und "typescript" als devDependency. Dann meckert VSCode beim Öffnen von Dateien, wenn es Fehler findet, die über einfache Fehler wie ( vergessen hinausgehen.

              Für Adapter-Aktualisierung auf dem Zielhost hab ich auch ein kleines Skript.

              package.json => scripts:

              "deploy_local": "node --require ts-node/register maintenance/deploy_local.ts",
              

              maintenance/deploy_local.ts sieht so aus:

              ! ````
              // tslint:disable:no-var-requires
              /*
              Allows easier local debugging over SSH.
              Running npm run deploy_local updates remote adapter files
              and restarts the instance
              /
              ! /

              CONFIGURATION:
              - provide a deploy_password.json file in the local dir with contents
              {
              "host": "<hostname>",
              "username": "<username>",
              "password": "<password>"
              }
              - specify which dirs and files should be uploaded
              - specify where the root dir is relative to this script
              */
              const uploadDirs = ["admin", "build"];
              const uploadFiles = ["package.json", "io-package.json", "main.js"];
              const rootDir = "../";
              ! // =========================
              // CAN'T TOUCH THIS
              // =========================
              ! import * as nodeSSH from "node-ssh";
              import * as path from "path";
              ! const localRoot = path.resolve(__dirname, rootDir);
              ! const ioPack = require(path.join(rootDir, "io-package.json"));
              const ADAPTER_NAME = ioPack.common.name;
              ! const ssh = new nodeSSH();
              const sshConfig = require(path.join(_dirname, "deploy_password.json"));
              ! const remoteRoot = /opt/iobroker/node_modules/iobroker.${ADAPTER_NAME};
              ! (async function main() {
              await ssh.connect(sshConfig);
              ! for (const dir of uploadDirs) {
              console.log(cleaning ${dir} dir...);
              await ssh.execCommand(rm -rf ${path.join(remoteRoot, dir)});
              console.log(uploading ${dir} dir...);
              try {
              await ssh.putDirectory(path.join(localRoot, dir), path.join(remoteRoot, dir), {
              recursive: true,
              concurrency: 10,
              validate: (pathname) => {
              const basename = path.basename(pathname);
              if (basename.startsWith("deploy
              ")) return false;
              if (basename.endsWith("Thumbs.db")) return false;
              if (basename.endsWith(".map") && basename.indexOf(".bundle.") === -1) return false;
              if (basename.indexOf(".test.") > -1) return false;
              if (basename === "src") return false;
              return true;
              },
              });
              } catch (e) {
              console.error(e);
              }
              }
              for (const file of uploadFiles) {
              console.log(uploading ${file}...);
              await ssh.putFile(path.join(localRoot, file), path.join(remoteRoot, file));
              }
              ! // update in-mem adapter
              let execResult;
              console.log("updating in-mem adapter");
              execResult = await ssh.execCommand(iobroker upload ${ADAPTER_NAME});
              console.log(execResult.stdout);
              console.log(execResult.stderr);
              if (process.argv.indexOf("--norestart") === -1) {
              execResult = await ssh.execCommand(iobroker restart ${ADAPTER_NAME});
              console.log(execResult.stdout);
              console.log(execResult.stderr);
              }
              ! console.log("done");
              process.exit(0);
              })();</password></username></hostname>

              und erfordert in package.json
              

              "devDependencies": {
              "node-ssh": "^5.0.0",
              "ts-node": "^4.1.0",
              "typescript": "^2.6.2",
              }

              Wenn das Skript konfiguriert ist (siehe Kommentare am Skript-Anfang), reicht ein "npm run deploy_local" und die aktualisierten Adapterdateien werden per SSH auf dem Zielhost hochgeladen und der Adapter dort aktualisiert/neu gestartet.
              
              Für dein Vorhaben musst du vermutlich vorher noch 1-2 Skripte lokal ausführen, um die Übersetzungsdateien umzuwandeln.
              1 Reply Last reply Reply Quote 0
              • smoker2604x
                smoker2604x last edited by

                @AlCalzone:

                @DeepCore:

                @AlCalzone:

                VSCode. Wenn das einmal ordentlich eingerichtet ist, gibts nix einfacheres IMO. Git-Integration, optional Type-Checking, etc… Könntest Du mal Deine Einrichtung erläutern?
                Konsole und Git sind ja von Haus aus drin. Mag zwar nicht jeder, aber ich bin damit einfach am schnellsten.

                Installierte Erweiterungen:

                • Auto Close Tag (für HTML/React)

                • Bookmarks

                • Coverage Gutters + Run on Save (Automatische Test-Coverage-Anzeige wenn package.json entsprechend konfiguriert ist)

                • ESLint (JS-Datei-Prüfung)

                • TSLint (TypeScript-Datei-Prüfung auf stilistische und typische Syntax-Fehler)

                TypeChecking erfordert eine entsprechend konfigurierte tsconfig.json-Datei im Projektordner, siehe https://github.com/ioBroker/ioBroker.cl … onfig.json oder https://github.com/AlCalzone/ioBroker.t ... onfig.json und "typescript" als devDependency. Dann meckert VSCode beim Öffnen von Dateien, wenn es Fehler findet, die über einfache Fehler wie ( vergessen hinausgehen.

                Für Adapter-Aktualisierung auf dem Zielhost hab ich auch ein kleines Skript.

                package.json => scripts:

                "deploy_local": "node --require ts-node/register maintenance/deploy_local.ts",
                

                maintenance/deploy_local.ts sieht so aus:

                ! ````
                // tslint:disable:no-var-requires
                /*
                Allows easier local debugging over SSH.
                Running npm run deploy_local updates remote adapter files
                and restarts the instance
                /
                ! /

                CONFIGURATION:
                - provide a deploy_password.json file in the local dir with contents
                {
                "host": "<hostname>",
                "username": "<username>",
                "password": "<password>"
                }
                - specify which dirs and files should be uploaded
                - specify where the root dir is relative to this script
                */
                const uploadDirs = ["admin", "build"];
                const uploadFiles = ["package.json", "io-package.json", "main.js"];
                const rootDir = "../";
                ! // =========================
                // CAN'T TOUCH THIS
                // =========================
                ! import * as nodeSSH from "node-ssh";
                import * as path from "path";
                ! const localRoot = path.resolve(__dirname, rootDir);
                ! const ioPack = require(path.join(rootDir, "io-package.json"));
                const ADAPTER_NAME = ioPack.common.name;
                ! const ssh = new nodeSSH();
                const sshConfig = require(path.join(_dirname, "deploy_password.json"));
                ! const remoteRoot = /opt/iobroker/node_modules/iobroker.${ADAPTER_NAME};
                ! (async function main() {
                await ssh.connect(sshConfig);
                ! for (const dir of uploadDirs) {
                console.log(cleaning ${dir} dir...);
                await ssh.execCommand(rm -rf ${path.join(remoteRoot, dir)});
                console.log(uploading ${dir} dir...);
                try {
                await ssh.putDirectory(path.join(localRoot, dir), path.join(remoteRoot, dir), {
                recursive: true,
                concurrency: 10,
                validate: (pathname) => {
                const basename = path.basename(pathname);
                if (basename.startsWith("deploy
                ")) return false;
                if (basename.endsWith("Thumbs.db")) return false;
                if (basename.endsWith(".map") && basename.indexOf(".bundle.") === -1) return false;
                if (basename.indexOf(".test.") > -1) return false;
                if (basename === "src") return false;
                return true;
                },
                });
                } catch (e) {
                console.error(e);
                }
                }
                for (const file of uploadFiles) {
                console.log(uploading ${file}...);
                await ssh.putFile(path.join(localRoot, file), path.join(remoteRoot, file));
                }
                ! // update in-mem adapter
                let execResult;
                console.log("updating in-mem adapter");
                execResult = await ssh.execCommand(iobroker upload ${ADAPTER_NAME});
                console.log(execResult.stdout);
                console.log(execResult.stderr);
                if (process.argv.indexOf("--norestart") === -1) {
                execResult = await ssh.execCommand(iobroker restart ${ADAPTER_NAME});
                console.log(execResult.stdout);
                console.log(execResult.stderr);
                }
                ! console.log("done");
                process.exit(0);
                })();</password></username></hostname>

                und erfordert in package.json
                

                "devDependencies": {
                "node-ssh": "^5.0.0",
                "ts-node": "^4.1.0",
                "typescript": "^2.6.2",
                }

                Wenn das Skript konfiguriert ist (siehe Kommentare am Skript-Anfang), reicht ein "npm run deploy_local" und die aktualisierten Adapterdateien werden per SSH auf dem Zielhost hochgeladen und der Adapter dort aktualisiert/neu gestartet.
                
                Für dein Vorhaben musst du vermutlich vorher noch 1-2 Skripte lokal ausführen, um die Übersetzungsdateien umzuwandeln. `  Wau danke werde mir das morgen Mal anschauen
                

                Gesendet von meinem HUAWEI VNS-L31 mit Tapatalk

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                Support us

                ioBroker
                Community Adapters
                Donate
                FAQ Cloud / IOT
                HowTo: Node.js-Update
                HowTo: Backup/Restore
                Downloads
                BLOG

                823
                Online

                31.7k
                Users

                79.9k
                Topics

                1.3m
                Posts

                4
                6
                782
                Loading More Posts
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes
                Reply
                • Reply as topic
                Log in to reply
                Community
                Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                The ioBroker Community 2014-2023
                logo