File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 77## ** WORK IN PROGRESS**
88* (@Apollon77 /@copilot ) Add validation for JSON files in admin/ and admin/i18n/ directories
99* (@Apollon77 /@copilot ) Logs npm and installation errors to console for easier debugging
10+ * (@Apollon77 /@copilot ) Add validation to fail if iobroker.js-controller is listed as a package.json dependency
1011* (@Apollon77 /@copilot ) Add support for TypeScript-only adapters that use .ts files as main entry point without transpilation
1112* (@Apollon77 /@copilot ) Re-enabled validation checks for README.md and LICENSE files in packageFiles tests
1213
Original file line number Diff line number Diff line change @@ -166,6 +166,19 @@ function validatePackageFiles(adapterDir) {
166166 }
167167 }
168168 } ) ;
169+ it ( 'iobroker.js-controller is not listed as a dependency' , ( ) => {
170+ for ( const depType of [
171+ 'dependencies' ,
172+ 'devDependencies' ,
173+ 'optionalDependencies' ,
174+ 'peerDependencies' ,
175+ ] ) {
176+ if ( ( 0 , typeguards_1 . isObject ) ( packageContent [ depType ] ) && 'iobroker.js-controller' in packageContent [ depType ] ) {
177+ // eslint-disable-next-line @typescript-eslint/only-throw-error
178+ throw new chai_1 . AssertionError ( `iobroker.js-controller must not be listed in ${ depType } , found "${ packageContent [ depType ] [ 'iobroker.js-controller' ] } "!` ) ;
179+ }
180+ }
181+ } ) ;
169182 } ) ;
170183 describe ( `Check contents of io-package.json` , ( ) => {
171184 beforeEach ( function ( ) {
Original file line number Diff line number Diff line change @@ -154,6 +154,22 @@ export function validatePackageFiles(adapterDir: string): void {
154154 }
155155 }
156156 } ) ;
157+
158+ it ( 'iobroker.js-controller is not listed as a dependency' , ( ) => {
159+ for ( const depType of [
160+ 'dependencies' ,
161+ 'devDependencies' ,
162+ 'optionalDependencies' ,
163+ 'peerDependencies' ,
164+ ] as const ) {
165+ if ( isObject ( packageContent [ depType ] ) && 'iobroker.js-controller' in packageContent [ depType ] ) {
166+ // eslint-disable-next-line @typescript-eslint/only-throw-error
167+ throw new AssertionError (
168+ `iobroker.js-controller must not be listed in ${ depType } , found "${ packageContent [ depType ] [ 'iobroker.js-controller' ] } "!` ,
169+ ) ;
170+ }
171+ }
172+ } ) ;
157173 } ) ;
158174
159175 describe ( `Check contents of io-package.json` , ( ) => {
You can’t perform that action at this time.
0 commit comments