@@ -22,7 +22,8 @@ const profile = {
22
22
maintainedBy : 'Remix' ,
23
23
}
24
24
25
- const configFileName = '.remix/script.config.json'
25
+ const oldConfigFileName = '.remix/script.config.json'
26
+ const configFileName = 'remix.config.json'
26
27
27
28
let baseUrl = 'https://remix-project-org.github.io/script-runner-generator'
28
29
const customBuildUrl = 'http://localhost:4000/build' // this will be used when the server is ready
@@ -259,7 +260,7 @@ export class ScriptRunnerBridgePlugin extends Plugin {
259
260
try {
260
261
const content = await this . plugin . call ( 'fileManager' , 'readFile' , configFileName )
261
262
const parsed = JSON . parse ( content )
262
- this . customConfig = parsed
263
+ this . customConfig = parsed [ 'script-runner' ]
263
264
} catch ( e ) {
264
265
this . customConfig = {
265
266
defaultConfig : 'default' ,
@@ -274,7 +275,7 @@ export class ScriptRunnerBridgePlugin extends Plugin {
274
275
async openCustomConfig ( ) {
275
276
276
277
try {
277
- await this . plugin . call ( 'fileManager' , 'open' , '. remix/script .config.json' )
278
+ await this . plugin . call ( 'fileManager' , 'open' , 'remix.config.json' )
278
279
} catch ( e ) { }
279
280
}
280
281
@@ -297,16 +298,19 @@ export class ScriptRunnerBridgePlugin extends Plugin {
297
298
}
298
299
299
300
async saveCustomConfig ( content : ScriptRunnerConfig ) {
300
- if ( content . customConfig . dependencies . length === 0 && content . defaultConfig === 'default' ) {
301
- try {
302
- const exists = await this . plugin . call ( 'fileManager' , 'exists' , '.remix/script.config.json' )
303
- if ( exists ) {
304
- await this . plugin . call ( 'fileManager' , 'remove' , '.remix/script.config.json' )
305
- }
306
- } catch ( e ) { }
307
- return
308
- }
309
- await this . plugin . call ( 'fileManager' , 'writeFile' , '.remix/script.config.json' , JSON . stringify ( content , null , 2 ) )
301
+ try {
302
+ const exists = await this . plugin . call ( 'fileManager' , 'exists' , 'remix.config.json' )
303
+ if ( exists ) {
304
+ const configContent = await this . plugin . call ( 'fileManager' , 'readFile' , 'remix.config.json' )
305
+ const config = JSON . parse ( configContent )
306
+
307
+ config [ 'script-runner' ] = content
308
+ await this . plugin . call ( 'fileManager' , 'writeFile' , 'remix.config.json' , JSON . stringify ( config , null , 2 ) )
309
+ } else {
310
+ await this . plugin . call ( 'fileManager' , 'writeFile' , 'remix.config.json' , JSON . stringify ( { 'script-runner' : content } , null , 2 ) )
311
+ }
312
+ } catch ( e ) { }
313
+ return
310
314
}
311
315
312
316
async activateCustomScriptRunner ( config : customScriptRunnerConfig ) {
0 commit comments