From 73cfcdbbb6cc9d8b7505ee9fe4ee1032ad36ae9d Mon Sep 17 00:00:00 2001 From: oweitman Date: Sat, 26 Oct 2024 19:59:53 +0200 Subject: [PATCH 1/7] adding the ability to run the script locally and testing the local repository --- DEBUGGING.md | 44 ++++++ README.md | 8 + index.js | 12 +- lib/M000_PackageJson.js | 48 +++--- lib/M100_IOPackageJson.js | 141 +++++++++-------- lib/M250_Npm.js | 10 +- lib/M300_Testing.js | 2 +- lib/M400_Repository.js | 24 +-- lib/M500_Code.js | 180 ++++++++++++--------- lib/M700_License.js | 7 +- lib/M800_Github.js | 6 +- lib/M900_GitNpmIgnore.js | 10 +- lib/common.js | 69 ++++---- scripts/createIssuesForAdapter.js | 5 +- scripts/updateAllIssues.js | 251 +++++++++++++++--------------- 15 files changed, 468 insertions(+), 349 deletions(-) create mode 100644 DEBUGGING.md diff --git a/DEBUGGING.md b/DEBUGGING.md new file mode 100644 index 0000000..66de003 --- /dev/null +++ b/DEBUGGING.md @@ -0,0 +1,44 @@ +# Debugging + +## Local Debugging + +To test the repochecker and debug into the script under vscode: + +1. Clone the repository to your local machine.\ +Best is that the directory is on the same level than your adapter repository. + +2. run npm install in the repochecker directory. + +3. switch to your adapter repository and create a new launch configuration: + +```json5 + { + "name": "Launch Program", + "program": "../iobroker.repochecker/index.js", // path to the repochecker repo + // args as entered on the commandline, arguments as a array + "args": ["https://github.com/klein0r/ioBroker.luftdaten","--local"], + "request": "launch", + "stopOnEntry": true, + "runtimeExecutable": "", //optional if needed + "skipFiles": [ + "/**" + ], + "type": "node" + }, +``` + +## Local Testing without debugging + +To test the repochecker under vscode: + +1. Clone the repository to your local machine.\ +Best is that the directory is on the same level than your adapter repository. + +2. run npm install in the repochecker directory. + +3. switch to your adapter repository and enter the following commandline in a new terminal + +```bash +node ..\ioBroker.repochecker\index.js https://github.com/klein0r/ioBroker.luftdaten --local +``` + diff --git a/README.md b/README.md index 275b99c..15e17ab 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,14 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript master Branch (`master/main/dev`) is optional. +For a local test you can pass the `--local` parameter. Most of the files are read localy. +The link to the github repository is still necessary because data from the project settings on github is also checked. + +Example: +``` +npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript master +``` + ## Changelog + ### 3.1.3 (2024-10-11) + * (mcm1957) Checker no longer crash id no npm package exists. ### 3.1.2 (2024-10-04) + * (mcm1957) Require node 18 minimum as engines clause. ### 3.1.1 (2024-10-04) + * (mcm1957) "[E166] 'common.mode: extension' is unknown" has been fixed [#308] * (mcm1957) "[E904] file iob_npm.done found in repository, but not found in .gitignore" removed as covered by [E503]. [#309] * (mcm1957) "[E500] node_modules found" has been retricted to adapetr root. [#297] -* (mcm1957) Do not check main entry if common.mode none or extension. +* (mcm1957) Do not check main entry if common.mode none or extension. * (mcm1957) Change "[W113] Adapter should support compact mode" text and honor common.compact set to false. [#300] ### 3.1.0 (2024-09-29) + * (mcm1957) "@iobroker/plugin-sentry" blacklisted as dependency [#301] * (mcm1957) Accept .ts files as main file too. [#303] * (mcm1957) [E405] and [E426] incorrect path has been corrected. [#299] ### 3.0.7 (2024-09-19) + * (mcm1957) "[W523] 'package-lock.json"'not found in repo!" reduced to suggestion. [#298] ### 3.0.6 (2024-09-13) + * (mcm1957) "[E124] Main file not found" no longer raised if common.nogit is set * (mcm1957) 'Text of "common.main" is deprecated' has been adapted. [#266] * (mcm1957) Ignore errors caused by complex .gitignor/.npmignore. [#288] ### 3.0.5 (2024-09-13) + * (mcm1957) '@iobroker/dev-server' is valid as dev-dependency. [#260] ### 3.0.4 (2024-09-12) + * (mcm1957) Abort with incorrect dependency definition fixed [#287] * (mcm1957) Improve handling of malformed dependency definitions [#284] * (mcm1957) Improve handling of malformed .releaseconfig.json files [#283] @@ -67,28 +79,34 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript master * (mcm1957) Do no longer require a js-controller dependecy for wwwOnly adapters. [#250] ### 3.0.3 (2024-09-12) + * (mcm1957) Check for iob_npm.done at .npmignore has been removed [#294] ### 3.0.2 (2024-09-11) + * (mcm1957) Handling of missing LICENSE file corrected. [#282] * (mcm1957) [W126] Missing mandatory translation is error now. [#293] * (mcm1957) Record repochcker version used for tests. * (mcm1957) Record github commit-sha of last commit used for tests. ### 3.0.0 (2024-09-10) + * (mcm1957) Error and warning numbering has been reviewed and duplicates removed. * (mcm1957) index.js has been split into seperated modules. ### 2.10.0 (2024-08-19) + * (mcm1957) Suggestions ([Sxxx] have been added). ### 2.9.1 (2024-08-12) + * (mcm1957) E162 - correct dependency check for js-controller. [#267]. * (mcm1957) E605 - copyright year range including whitespaces is now accepted. [#269]. * (mcm1957) E016 - missing vaiableexpansion has been added. [#263]. * (mcm1957) E114 - typo at error message has been fixed [#261]. ### 2.9.0 (2024-07-29) + * (mcm1957) Adapt text if sources-dist(-stable).json need a correction [#97]. * (mcm1957) Missing "common.mode" error text corrected [#249]. * (mcm1957) Files "iob" and "iobroker" are disallowed now [#248]. @@ -96,10 +114,12 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript master * (mcm1957) Text of E114 (missing adminUI) adapted. ### 2.8.1 (2024-07-28) + * (mcm1957) Check of js-controller version has been corrected [#247]. * (mcm1957) Honor '>' at dependency checks too [#246]. ### 2.8.0 (2024-07-28) + * (mcm1957) Copyright year check has been fixed for single year entries. * (mcm1957) js-controller version check added [#233]. * (mcm1957) Check for fixed version dependencies and for github dependencies [#233]. @@ -109,12 +129,15 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript master * (mcm1957) "common.noConfig" must match "common.adminUI" setting [#170]. ### 2.7.2 (2024-07-26) + * (mcm1957) package-lock.json check fixed. ### 2.7.1 (2024-07-26) + * (mcm1957) Reduce setTimeout/setInterval error to warning temporary. ### 2.7.0 (2024-07-26) + * (mcm1957) Some non trivial keywords related to adapter are enforced now [#234]. * (mcm1957) Severity if [E105] / [W105] has been corrected [#204]. * (mcm1957) Disallow 'globalDependencies' at package.json [#204]. @@ -128,29 +151,36 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript master * (mcm1957) Copyright year now honors commit year and npm publish year too [#237]. ### 2.6.1 (2024-06-24) + * (mcm1957) Check "[W156] Adapter should support admin 5 UI (jsonConfig)" checks for reactUi now. ### 2.6.0 (2024-06-24) + * (mcm1957) Check has been aded to ensure keywords and common.keywords are present. [#200] * (mcm1957) Detection of react has been added, gulpfile.js is accepted for react based UIs now. [#223] ### 2.5.1 (2024-06-24) + * (mcm1957) Suggestion to update dependencies to recommended version added. * (mcm1957) Adapter-core recommended set to 3.1.6 [#220] ### 2.5.0 (2024-05-30) + * (mcm1957) Check to ensure that dependency revisions are available at repository added. [#180] ### 2.4.0 (2024-05-30) + * (mcm1957) Add check to protect sensitive data. [#195] * (mcm1957) Add check to verify that dependencies and globalDepencies are of type array. [#90] ### 2.3.1 (2024-05-07) + * (mcm1957) Reduce number of missing translation warnings. * (mcm1957) Seperate between required and recommended translations. * (mcm1957) Log missing translations in detail. ### 2.3.0 (2024-05-07) + * (mcm1957) Elements marked as deprectaed added to blacklist. * (mcm1957) Blacklist added to block elements at package.json and io-package.json. * (mcm1957) Error [E000] will be raised now if repository cannot be accessed at all [#194]. @@ -159,13 +189,16 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript master * (mcm1957) Raise an error if version at package.json is lower than latest release at npmjs [#192] ### 2.2.3 (2024-03-29) + * (mcm1957) Checking of license has been improved -### 2.2.2 (2024-03-29) +### 2.2.2 (2024-03-29) + * (mcm1957) Checking of adapter-core has been fixed * (mcm1957) Load all potential interesting files, fixes [#149] ### 2.2.1 (2024-03-26) + * (mcm1957) Added check that own adapter is not listed at common.restartAdapters * (mcm1957) Added check of version strings at common.news * (mcm1957) Added check for recommended node version (node 18 for now) @@ -174,43 +207,55 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript master * (mcm1957) Added check for adapter-core version (>= 3.0.6) ### 2.2.0 (2024-03-24) + * (klein0r) Added check for licenseInformation * (klein0r) Added check for deprecated license * (klein0r) Added check for required attribute common.tier * (klein0r) Added check for disallowed attribute common.automaticUpgrade ### 2.1.13 (2024-01-02) + * (bluefox) Corrected rule W156: adminUI.config === 'none' is allowed ### 2.1.12 (2023-09-21) + * (bluefox) Added check of using '_' in adapter name ### 2.1.11 (2023-09-05) + * (bluefox) Added check of iobroker.js-controller in dependencies ### 2.1.7 (2023-08-14) + * (mcm57) Update index.js - fix typo in error message (packet.json) * (mcm57) Update index.js - renumber E504/1 to 519 - fixes #112 ### 2.1.6 (2022-12-08) + * (bluefox) added better error logging ### 2.1.5 (2022-12-07) + * (bluefox) added check of `.releaseconfig.json` file ### 2.1.4 (2022-08-19) + * (bluefox) Added check for adapter name: it may not start with '_' ### 2.1.2 (2022-07-14) + * (bluefox) Fixed some errors ### 2.1.0 (2022-05-26) + * (bluefox) Added support for jsonConfig.json5 and jsonCustom.json5 ### 2.0.5 (2022-05-22) + * (bluefox) Made it possible to run with npx ## License + The MIT License (MIT) Copyright (c) 2014-2024 Denis Haev From 03036e0aaa89724f7d40e0141dfb49101313e764 Mon Sep 17 00:00:00 2001 From: oweitman Date: Sat, 26 Oct 2024 20:15:15 +0200 Subject: [PATCH 3/7] some clearifications --- lib/M100_IOPackageJson.js | 2 +- lib/M500_Code.js | 2 +- lib/M700_License.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/M100_IOPackageJson.js b/lib/M100_IOPackageJson.js index 381ec23..4fca095 100644 --- a/lib/M100_IOPackageJson.js +++ b/lib/M100_IOPackageJson.js @@ -123,7 +123,7 @@ async function checkIOPackageJson(context) { if (!context.ioPackageJson.common) { context.errors.push('[E102] io-package.json must have common object'); - // Todo 'resolve' is not defined. + // Todo-oliverio 'resolve' is not defined. return resolve(context); } else { context.checks.push('"common" found in io-package.json'); diff --git a/lib/M500_Code.js b/lib/M500_Code.js index 0cc0f8d..4ccf892 100644 --- a/lib/M500_Code.js +++ b/lib/M500_Code.js @@ -167,7 +167,7 @@ async function checkCode(context) { // https://github.com/userName/ioBroker.adaptername/archive/${context.branch}.zip if (common.isLocal()) { - //todo check a list of all files in the current path and all subdirectories + // check a list of all files in the current path and all subdirectories context.readFiles = readFiles; context.filesList = []; getAllFiles(context, process.cwd(), '', context.filesList); diff --git a/lib/M700_License.js b/lib/M700_License.js index 4e3072f..12cb090 100644 --- a/lib/M700_License.js +++ b/lib/M700_License.js @@ -27,7 +27,7 @@ async function checkLicenseFile(context) { try { data = await common.downloadFile(context.githubUrl, '/LICENSE'); } catch (e) { - // Todo Expected a conditional expression and instead saw an assignment. + // Todo-oliverio Expected a conditional expression and instead saw an assignment. if (e.status = 404) { context.errors.push('[E700] File LICENSE not found. Please add.'); } else { From db8714e79ee8b0d7104f6511779de64dbf0c7325 Mon Sep 17 00:00:00 2001 From: oweitman Date: Sun, 27 Oct 2024 23:12:55 +0100 Subject: [PATCH 4/7] add documentation for start without installing --- DEBUGGING.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/DEBUGGING.md b/DEBUGGING.md index cdccb9a..f5b5303 100644 --- a/DEBUGGING.md +++ b/DEBUGGING.md @@ -5,7 +5,7 @@ To test the repochecker and debug into the script under vscode: 1. Clone the repository to your local machine.\ -Best is that the directory is on the same level than your adapter repository. + Best is that the directory is on the same level than your adapter repository. 2. run npm install in the repochecker directory. @@ -13,10 +13,10 @@ Best is that the directory is on the same level than your adapter repository. ```json5 { - "name": "Launch Program", + "name": "Launch Program", "program": "../iobroker.repochecker/index.js", // path to the repochecker repo // args as entered on the commandline, arguments as a array - "args": ["https://github.com/klein0r/ioBroker.luftdaten","--local"], + "args": ["https://github.com/klein0r/ioBroker.luftdaten","--local"], "request": "launch", "stopOnEntry": true, "runtimeExecutable": "", //optional if needed @@ -32,7 +32,7 @@ Best is that the directory is on the same level than your adapter repository. To test the repochecker under vscode: 1. Clone the repository to your local machine.\ -Best is that the directory is on the same level than your adapter repository. + Best is that the directory is on the same level than your adapter repository. 2. run npm install in the repochecker directory. @@ -41,3 +41,11 @@ Best is that the directory is on the same level than your adapter repository. ```bash node ..\ioBroker.repochecker\index.js https://github.com/klein0r/ioBroker.luftdaten --local ``` + +## Testing without installing + +The following command should be entered in the root of your repository: + +```bash +npx github:oweitman/iobroker.repochecker https://github.com/oweitman/ioBroker.luftdaten --local +``` From 67d12dc9b99fd2d6e343c39f475529d9a930fdbe Mon Sep 17 00:00:00 2001 From: oweitman Date: Mon, 28 Oct 2024 00:57:42 +0100 Subject: [PATCH 5/7] prepare for release --- README.md | 222 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 114 insertions(+), 108 deletions(-) diff --git a/README.md b/README.md index 7018e51..a2cdd72 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you want to add your adapter to the public ioBroker repository, all tests on You can pass your repository as a parameter to test -``npx @iobroker/repochecker [branch]`` +`npx @iobroker/repochecker [branch]` ```bash npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript master @@ -31,234 +31,240 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript --loca --> ## Changelog + +### **WORK IN PROGRESS** + +- (oweitman) extension that the script also uses the local data for checking. + ### 3.1.4 (2024-10-26) -* (mcm1957) linter has been activated and issues reported have been fixed. -* (mcm1957) Blacklist for package/dependencies has been extended. -* (mcm1957) Recommend adapter-core 3.2.2 now. -* (mcm1957) Clearify test for "[E952] .npmignore not found". [#320] -* (mcm1957) Abort processing if iobroker.live not reachable. [#321] + +- (mcm1957) linter has been activated and issues reported have been fixed. +- (mcm1957) Blacklist for package/dependencies has been extended. +- (mcm1957) Recommend adapter-core 3.2.2 now. +- (mcm1957) Clearify test for "[E952] .npmignore not found". [#320] +- (mcm1957) Abort processing if iobroker.live not reachable. [#321] ### 3.1.3 (2024-10-11) -* (mcm1957) Checker no longer crash id no npm package exists. +- (mcm1957) Checker no longer crash id no npm package exists. ### 3.1.2 (2024-10-04) -* (mcm1957) Require node 18 minimum as engines clause. +- (mcm1957) Require node 18 minimum as engines clause. ### 3.1.1 (2024-10-04) -* (mcm1957) "[E166] 'common.mode: extension' is unknown" has been fixed [#308] -* (mcm1957) "[E904] file iob_npm.done found in repository, but not found in .gitignore" removed as covered by [E503]. [#309] -* (mcm1957) "[E500] node_modules found" has been retricted to adapetr root. [#297] -* (mcm1957) Do not check main entry if common.mode none or extension. -* (mcm1957) Change "[W113] Adapter should support compact mode" text and honor common.compact set to false. [#300] +- (mcm1957) "[E166] 'common.mode: extension' is unknown" has been fixed [#308] +- (mcm1957) "[E904] file iob_npm.done found in repository, but not found in .gitignore" removed as covered by [E503]. [#309] +- (mcm1957) "[E500] node_modules found" has been retricted to adapetr root. [#297] +- (mcm1957) Do not check main entry if common.mode none or extension. +- (mcm1957) Change "[W113] Adapter should support compact mode" text and honor common.compact set to false. [#300] ### 3.1.0 (2024-09-29) -* (mcm1957) "@iobroker/plugin-sentry" blacklisted as dependency [#301] -* (mcm1957) Accept .ts files as main file too. [#303] -* (mcm1957) [E405] and [E426] incorrect path has been corrected. [#299] +- (mcm1957) "@iobroker/plugin-sentry" blacklisted as dependency [#301] +- (mcm1957) Accept .ts files as main file too. [#303] +- (mcm1957) [E405] and [E426] incorrect path has been corrected. [#299] ### 3.0.7 (2024-09-19) -* (mcm1957) "[W523] 'package-lock.json"'not found in repo!" reduced to suggestion. [#298] +- (mcm1957) "[W523] 'package-lock.json"'not found in repo!" reduced to suggestion. [#298] ### 3.0.6 (2024-09-13) -* (mcm1957) "[E124] Main file not found" no longer raised if common.nogit is set -* (mcm1957) 'Text of "common.main" is deprecated' has been adapted. [#266] -* (mcm1957) Ignore errors caused by complex .gitignor/.npmignore. [#288] +- (mcm1957) "[E124] Main file not found" no longer raised if common.nogit is set +- (mcm1957) 'Text of "common.main" is deprecated' has been adapted. [#266] +- (mcm1957) Ignore errors caused by complex .gitignor/.npmignore. [#288] ### 3.0.5 (2024-09-13) -* (mcm1957) '@iobroker/dev-server' is valid as dev-dependency. [#260] +- (mcm1957) '@iobroker/dev-server' is valid as dev-dependency. [#260] ### 3.0.4 (2024-09-12) -* (mcm1957) Abort with incorrect dependency definition fixed [#287] -* (mcm1957) Improve handling of malformed dependency definitions [#284] -* (mcm1957) Improve handling of malformed .releaseconfig.json files [#283] -* (mcm1957) Missing mandatory translations are considered an error now. [#277, #278] -* (mcm1957) '.npmignore found but "files" is used' is a warning now. [#274] -* (mcm1957) '@iobroker/dev-server' has been blacklisted as any dependency. [#260] -* (mcm1957) Do no longer require a js-controller dependecy for wwwOnly adapters. [#250] +- (mcm1957) Abort with incorrect dependency definition fixed [#287] +- (mcm1957) Improve handling of malformed dependency definitions [#284] +- (mcm1957) Improve handling of malformed .releaseconfig.json files [#283] +- (mcm1957) Missing mandatory translations are considered an error now. [#277, #278] +- (mcm1957) '.npmignore found but "files" is used' is a warning now. [#274] +- (mcm1957) '@iobroker/dev-server' has been blacklisted as any dependency. [#260] +- (mcm1957) Do no longer require a js-controller dependecy for wwwOnly adapters. [#250] ### 3.0.3 (2024-09-12) -* (mcm1957) Check for iob_npm.done at .npmignore has been removed [#294] +- (mcm1957) Check for iob_npm.done at .npmignore has been removed [#294] ### 3.0.2 (2024-09-11) -* (mcm1957) Handling of missing LICENSE file corrected. [#282] -* (mcm1957) [W126] Missing mandatory translation is error now. [#293] -* (mcm1957) Record repochcker version used for tests. -* (mcm1957) Record github commit-sha of last commit used for tests. +- (mcm1957) Handling of missing LICENSE file corrected. [#282] +- (mcm1957) [W126] Missing mandatory translation is error now. [#293] +- (mcm1957) Record repochcker version used for tests. +- (mcm1957) Record github commit-sha of last commit used for tests. ### 3.0.0 (2024-09-10) -* (mcm1957) Error and warning numbering has been reviewed and duplicates removed. -* (mcm1957) index.js has been split into seperated modules. +- (mcm1957) Error and warning numbering has been reviewed and duplicates removed. +- (mcm1957) index.js has been split into seperated modules. ### 2.10.0 (2024-08-19) -* (mcm1957) Suggestions ([Sxxx] have been added). +- (mcm1957) Suggestions ([Sxxx] have been added). ### 2.9.1 (2024-08-12) -* (mcm1957) E162 - correct dependency check for js-controller. [#267]. -* (mcm1957) E605 - copyright year range including whitespaces is now accepted. [#269]. -* (mcm1957) E016 - missing vaiableexpansion has been added. [#263]. -* (mcm1957) E114 - typo at error message has been fixed [#261]. +- (mcm1957) E162 - correct dependency check for js-controller. [#267]. +- (mcm1957) E605 - copyright year range including whitespaces is now accepted. [#269]. +- (mcm1957) E016 - missing vaiableexpansion has been added. [#263]. +- (mcm1957) E114 - typo at error message has been fixed [#261]. ### 2.9.0 (2024-07-29) -* (mcm1957) Adapt text if sources-dist(-stable).json need a correction [#97]. -* (mcm1957) Missing "common.mode" error text corrected [#249]. -* (mcm1957) Files "iob" and "iobroker" are disallowed now [#248]. -* (mcm1957) Checks related to @alcalzone/releasescript modified [#71]. -* (mcm1957) Text of E114 (missing adminUI) adapted. +- (mcm1957) Adapt text if sources-dist(-stable).json need a correction [#97]. +- (mcm1957) Missing "common.mode" error text corrected [#249]. +- (mcm1957) Files "iob" and "iobroker" are disallowed now [#248]. +- (mcm1957) Checks related to @alcalzone/releasescript modified [#71]. +- (mcm1957) Text of E114 (missing adminUI) adapted. ### 2.8.1 (2024-07-28) -* (mcm1957) Check of js-controller version has been corrected [#247]. -* (mcm1957) Honor '>' at dependency checks too [#246]. +- (mcm1957) Check of js-controller version has been corrected [#247]. +- (mcm1957) Honor '>' at dependency checks too [#246]. ### 2.8.0 (2024-07-28) -* (mcm1957) Copyright year check has been fixed for single year entries. -* (mcm1957) js-controller version check added [#233]. -* (mcm1957) Check for fixed version dependencies and for github dependencies [#233]. -* (mcm1957) Missing language files reduced to warning [#203]. -* (mcm1957) Missing .gitignore is considered an error now. -* (mcm1957) "common.noConfig" no longer reported as error if "common.adminUI" is present [#245]. -* (mcm1957) "common.noConfig" must match "common.adminUI" setting [#170]. +- (mcm1957) Copyright year check has been fixed for single year entries. +- (mcm1957) js-controller version check added [#233]. +- (mcm1957) Check for fixed version dependencies and for github dependencies [#233]. +- (mcm1957) Missing language files reduced to warning [#203]. +- (mcm1957) Missing .gitignore is considered an error now. +- (mcm1957) "common.noConfig" no longer reported as error if "common.adminUI" is present [#245]. +- (mcm1957) "common.noConfig" must match "common.adminUI" setting [#170]. ### 2.7.2 (2024-07-26) -* (mcm1957) package-lock.json check fixed. +- (mcm1957) package-lock.json check fixed. ### 2.7.1 (2024-07-26) -* (mcm1957) Reduce setTimeout/setInterval error to warning temporary. +- (mcm1957) Reduce setTimeout/setInterval error to warning temporary. ### 2.7.0 (2024-07-26) -* (mcm1957) Some non trivial keywords related to adapter are enforced now [#234]. -* (mcm1957) Severity if [E105] / [W105] has been corrected [#204]. -* (mcm1957) Disallow 'globalDependencies' at package.json [#204]. -* (mcm1957) Several false positives for wwwOnly widgetadapters have been fixed [#230, #222]. -* (mcm1957) Missing .npmignore is now considered an error [#229]. -* (mcm1957) Usage of package.json 'files' section is now recommended. -* (mcm1957) If more than 7 common.news entries are present a warning is issued now [#232]. -* (mcm1957) Versions listed at common.news are checked to exist at npm now [#226]. -* (mcm1957) 'package-lock.json' is checked to exist at GitHub now [#188]. -* (mcm1957) travis checks have been removed [#237]. -* (mcm1957) Copyright year now honors commit year and npm publish year too [#237]. +- (mcm1957) Some non trivial keywords related to adapter are enforced now [#234]. +- (mcm1957) Severity if [E105] / [W105] has been corrected [#204]. +- (mcm1957) Disallow 'globalDependencies' at package.json [#204]. +- (mcm1957) Several false positives for wwwOnly widgetadapters have been fixed [#230, #222]. +- (mcm1957) Missing .npmignore is now considered an error [#229]. +- (mcm1957) Usage of package.json 'files' section is now recommended. +- (mcm1957) If more than 7 common.news entries are present a warning is issued now [#232]. +- (mcm1957) Versions listed at common.news are checked to exist at npm now [#226]. +- (mcm1957) 'package-lock.json' is checked to exist at GitHub now [#188]. +- (mcm1957) travis checks have been removed [#237]. +- (mcm1957) Copyright year now honors commit year and npm publish year too [#237]. ### 2.6.1 (2024-06-24) -* (mcm1957) Check "[W156] Adapter should support admin 5 UI (jsonConfig)" checks for reactUi now. +- (mcm1957) Check "[W156] Adapter should support admin 5 UI (jsonConfig)" checks for reactUi now. ### 2.6.0 (2024-06-24) -* (mcm1957) Check has been aded to ensure keywords and common.keywords are present. [#200] -* (mcm1957) Detection of react has been added, gulpfile.js is accepted for react based UIs now. [#223] +- (mcm1957) Check has been aded to ensure keywords and common.keywords are present. [#200] +- (mcm1957) Detection of react has been added, gulpfile.js is accepted for react based UIs now. [#223] ### 2.5.1 (2024-06-24) -* (mcm1957) Suggestion to update dependencies to recommended version added. -* (mcm1957) Adapter-core recommended set to 3.1.6 [#220] +- (mcm1957) Suggestion to update dependencies to recommended version added. +- (mcm1957) Adapter-core recommended set to 3.1.6 [#220] ### 2.5.0 (2024-05-30) -* (mcm1957) Check to ensure that dependency revisions are available at repository added. [#180] +- (mcm1957) Check to ensure that dependency revisions are available at repository added. [#180] ### 2.4.0 (2024-05-30) -* (mcm1957) Add check to protect sensitive data. [#195] -* (mcm1957) Add check to verify that dependencies and globalDepencies are of type array. [#90] +- (mcm1957) Add check to protect sensitive data. [#195] +- (mcm1957) Add check to verify that dependencies and globalDepencies are of type array. [#90] ### 2.3.1 (2024-05-07) -* (mcm1957) Reduce number of missing translation warnings. -* (mcm1957) Seperate between required and recommended translations. -* (mcm1957) Log missing translations in detail. +- (mcm1957) Reduce number of missing translation warnings. +- (mcm1957) Seperate between required and recommended translations. +- (mcm1957) Log missing translations in detail. ### 2.3.0 (2024-05-07) -* (mcm1957) Elements marked as deprectaed added to blacklist. -* (mcm1957) Blacklist added to block elements at package.json and io-package.json. -* (mcm1957) Error [E000] will be raised now if repository cannot be accessed at all [#194]. -* (mcm1957) Reading of package.json and io-package.json has been moved to head of tests. -* (mcm1957) Check minimum and recommended node version at package.json (#160) -* (mcm1957) Raise an error if version at package.json is lower than latest release at npmjs [#192] +- (mcm1957) Elements marked as deprectaed added to blacklist. +- (mcm1957) Blacklist added to block elements at package.json and io-package.json. +- (mcm1957) Error [E000] will be raised now if repository cannot be accessed at all [#194]. +- (mcm1957) Reading of package.json and io-package.json has been moved to head of tests. +- (mcm1957) Check minimum and recommended node version at package.json (#160) +- (mcm1957) Raise an error if version at package.json is lower than latest release at npmjs [#192] ### 2.2.3 (2024-03-29) -* (mcm1957) Checking of license has been improved +- (mcm1957) Checking of license has been improved ### 2.2.2 (2024-03-29) -* (mcm1957) Checking of adapter-core has been fixed -* (mcm1957) Load all potential interesting files, fixes [#149] +- (mcm1957) Checking of adapter-core has been fixed +- (mcm1957) Load all potential interesting files, fixes [#149] ### 2.2.1 (2024-03-26) -* (mcm1957) Added check that own adapter is not listed at common.restartAdapters -* (mcm1957) Added check of version strings at common.news -* (mcm1957) Added check for recommended node version (node 18 for now) -* (mcm1957) Disallow common.mode == subscribe -* (mcm1957) Deprecate common.wakeup -* (mcm1957) Added check for adapter-core version (>= 3.0.6) +- (mcm1957) Added check that own adapter is not listed at common.restartAdapters +- (mcm1957) Added check of version strings at common.news +- (mcm1957) Added check for recommended node version (node 18 for now) +- (mcm1957) Disallow common.mode == subscribe +- (mcm1957) Deprecate common.wakeup +- (mcm1957) Added check for adapter-core version (>= 3.0.6) ### 2.2.0 (2024-03-24) -* (klein0r) Added check for licenseInformation -* (klein0r) Added check for deprecated license -* (klein0r) Added check for required attribute common.tier -* (klein0r) Added check for disallowed attribute common.automaticUpgrade +- (klein0r) Added check for licenseInformation +- (klein0r) Added check for deprecated license +- (klein0r) Added check for required attribute common.tier +- (klein0r) Added check for disallowed attribute common.automaticUpgrade ### 2.1.13 (2024-01-02) -* (bluefox) Corrected rule W156: adminUI.config === 'none' is allowed +- (bluefox) Corrected rule W156: adminUI.config === 'none' is allowed ### 2.1.12 (2023-09-21) -* (bluefox) Added check of using '_' in adapter name +- (bluefox) Added check of using '\_' in adapter name ### 2.1.11 (2023-09-05) -* (bluefox) Added check of iobroker.js-controller in dependencies +- (bluefox) Added check of iobroker.js-controller in dependencies ### 2.1.7 (2023-08-14) -* (mcm57) Update index.js - fix typo in error message (packet.json) -* (mcm57) Update index.js - renumber E504/1 to 519 - fixes #112 +- (mcm57) Update index.js - fix typo in error message (packet.json) +- (mcm57) Update index.js - renumber E504/1 to 519 - fixes #112 ### 2.1.6 (2022-12-08) -* (bluefox) added better error logging +- (bluefox) added better error logging ### 2.1.5 (2022-12-07) -* (bluefox) added check of `.releaseconfig.json` file +- (bluefox) added check of `.releaseconfig.json` file ### 2.1.4 (2022-08-19) -* (bluefox) Added check for adapter name: it may not start with '_' +- (bluefox) Added check for adapter name: it may not start with '\_' ### 2.1.2 (2022-07-14) -* (bluefox) Fixed some errors +- (bluefox) Fixed some errors ### 2.1.0 (2022-05-26) -* (bluefox) Added support for jsonConfig.json5 and jsonCustom.json5 +- (bluefox) Added support for jsonConfig.json5 and jsonCustom.json5 ### 2.0.5 (2022-05-22) -* (bluefox) Made it possible to run with npx +- (bluefox) Made it possible to run with npx ## License From 4921ebe62a9230f9583b1961b8e1152cbfa80980 Mon Sep 17 00:00:00 2001 From: oweitman Date: Mon, 28 Oct 2024 00:58:08 +0100 Subject: [PATCH 6/7] chore: release v3.2.0 - (oweitman) extension that the script also uses the local data for checking. --- README.md | 3 +-- package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a2cdd72..f975c3e 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,7 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript --loca --> ## Changelog - -### **WORK IN PROGRESS** +### 3.2.0 (2024-10-27) - (oweitman) extension that the script also uses the local data for checking. diff --git a/package.json b/package.json index a293fe7..f8c610b 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "3.1.4", + "version": "3.2.0", "name": "@iobroker/repochecker", "dependencies": { "axios": "^1.7.7", From cc7c124d3f7e448539ac19fb313660b7203d0f3d Mon Sep 17 00:00:00 2001 From: oweitman Date: Mon, 28 Oct 2024 13:56:50 +0100 Subject: [PATCH 7/7] add --debug as a parameter for conditional create extra output --- README.md | 3 +++ index.js | 6 ++++-- lib/common.js | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f975c3e..dac7a86 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript master Branch (`master/main/dev`) is optional. +For extra debugging outputs you can pass the `--debug` parameter. + For a local test you can pass the `--local` parameter. Most of the files are read localy. The link to the github repository is still necessary because data from the project settings on github is also checked. @@ -31,6 +33,7 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript --loca --> ## Changelog + ### 3.2.0 (2024-10-27) - (oweitman) extension that the script also uses the local data for checking. diff --git a/index.js b/index.js index 924b777..4c98089 100644 --- a/index.js +++ b/index.js @@ -191,8 +191,6 @@ function getText(text, lang) { return text; } -common.setDebug(true); /* DEBUG*/ - if (typeof module !== 'undefined' && module.parent) { exports.handler = check; } else { @@ -205,6 +203,10 @@ if (typeof module !== 'undefined' && module.parent) { common.setLocal(true); } + if (process.argv.includes('--debug')) { + process.argv.splice(process.argv.indexOf('--debug'), 1); + common.setDebug(true); + } // Get url from parameters if possible if (process.argv.length > 2) { repoUrl = process.argv[2]; diff --git a/lib/common.js b/lib/common.js index 29cd86a..cca0949 100644 --- a/lib/common.js +++ b/lib/common.js @@ -20,7 +20,7 @@ function setDebug(flag) { } function debug(msg) { - console.log(`[DEBUG] ${msg}`); + gDebug && console.log(`[DEBUG] ${msg}`); } let gLocal = false;