@@ -4,7 +4,7 @@ const fs = require('fs/promises')
44const { readFileSync } = require ( 'fs' )
55const path = require ( 'path' )
66const { log, info, debug, warn, NRlog } = require ( './logging/log' )
7- const { copyDir , hasProperty } = require ( './utils' )
7+ const { hasProperty } = require ( './utils' )
88const { States } = require ( './states' )
99const { default : got } = require ( 'got' )
1010
@@ -55,7 +55,6 @@ class Launcher {
5555 credentials : path . join ( this . projectDir , 'flows_cred.json' ) ,
5656 settings : path . join ( this . projectDir , 'settings.js' ) ,
5757 userSettings : path . join ( this . projectDir , 'settings.json' ) ,
58- themeDir : path . join ( this . projectDir , 'node_modules' , '@flowfuse' , 'nr-theme' ) ,
5958 npmrc : path . join ( this . projectDir , '.npmrc' )
6059 }
6160 }
@@ -80,11 +79,11 @@ class Launcher {
8079 packageData . dependencies [ '@flowfuse/nr-assistant' ] = `file:${ devPath } `
8180 }
8281 }
83- if ( ! packageData . dependencies [ '@flowfuse/nr-theme' ] ) {
84- // Ensure the theme package is in package.json so that its resources
85- // don't get removed by npm.
86- packageData . dependencies [ '@flowfuse/nr-theme' ] = '*'
87- }
82+ // if (!packageData.dependencies['@flowfuse/nr-theme']) {
83+ // // Ensure the theme package is in package.json so that its resources
84+ // // don't get removed by npm.
85+ // packageData.dependencies['@flowfuse/nr-theme'] = '*'
86+ // }
8887 packageData . version = `0.0.0-${ this . snapshot . id } `
8988 packageData . name = this . snapshot . env . FF_PROJECT_NAME
9089 if ( this . snapshot . name && this . snapshot . description ) {
@@ -393,26 +392,6 @@ class Launcher {
393392 }
394393 }
395394
396- async writeThemeFiles ( ) {
397- info ( 'Updating theme files' )
398- const sourceDir1 = path . join ( __dirname , '..' , 'node_modules' , '@flowfuse' , 'nr-theme' )
399- const sourceDir2 = path . join ( __dirname , '..' , '..' , 'nr-theme' )
400- const sourceDir = existsSync ( sourceDir1 ) ? sourceDir1 : sourceDir2
401- const targetDir = path . join ( this . projectDir , 'node_modules' , '@flowfuse' , 'nr-theme' )
402- try {
403- if ( ! existsSync ( sourceDir ) ) {
404- info ( `Could not write theme files. Theme not found: '${ sourceDir } '` )
405- return
406- }
407- if ( ! existsSync ( targetDir ) ) {
408- await fs . mkdir ( targetDir , { recursive : true } )
409- }
410- await copyDir ( sourceDir , targetDir , { recursive : true } )
411- } catch ( error ) {
412- info ( `Could not write theme files to disk: '${ targetDir } '` )
413- }
414- }
415-
416395 async logAuditEvent ( event , body ) {
417396 const data = {
418397 timestamp : Date . now ( ) ,
@@ -459,13 +438,6 @@ class Launcher {
459438 await this . writeSettings ( )
460439 }
461440
462- if ( ! existsSync ( this . files . themeDir ) ) {
463- // As the theme may not present (due to earlier versions of the agent launcher),
464- // we will independently write the theme files to the device project
465- // (if the directory is not present)
466- await this . writeThemeFiles ( )
467- }
468-
469441 const filterEnv = ( env ) =>
470442 Object . entries ( env ) . reduce ( ( acc , [ key , value ] ) =>
471443 key . startsWith ( 'FORGE' ) ? acc : { ...acc , [ key ] : value } , { } )
0 commit comments