diff --git a/packages/bruno-electron/electron-builder-config.js b/packages/bruno-electron/electron-builder-config.js index ea3acf6f3..083f53c94 100644 --- a/packages/bruno-electron/electron-builder-config.js +++ b/packages/bruno-electron/electron-builder-config.js @@ -8,6 +8,12 @@ const config = { buildResources: 'resources', output: 'out' }, + extraResources: [ + { + from: 'resources/data/sample-collection.json', + to: 'data/sample-collection.json' + } + ], files: ['**/*'], afterSign: 'notarize.js', mac: { diff --git a/packages/bruno-electron/resources/data/sample-collection.json b/packages/bruno-electron/resources/data/sample-collection.json new file mode 100644 index 000000000..cc24a6eed --- /dev/null +++ b/packages/bruno-electron/resources/data/sample-collection.json @@ -0,0 +1,56 @@ +{ + "version": "1", + "uid": "1igyn4u00000000000232", + "name": "Sample API Collection", + "items": [ + { + "uid": "1igyn4u00000000000001", + "type": "http-request", + "name": "Get Users", + "seq": 1, + "request": { + "url": "https://jsonplaceholder.typicode.com/users", + "method": "GET", + "headers": [], + "params": [], + "body": { + "mode": "none" + }, + "auth": { + "mode": "none" + }, + "script": { + "req": "", + "res": "" + }, + "vars": { + "req": [], + "res": [] + }, + "assertions": [], + "tests": "", + "docs": "This request retrieves a list of users from the JSONPlaceholder API." + } + } + ], + "environments": [], + "activeEnvironmentUid": null, + "root": { + "request": { + "headers": [], + "auth": { + "mode": "none" + }, + "script": { + "req": "", + "res": "" + }, + "vars": { + "req": [], + "res": [] + }, + "tests": "" + } + } + } + \ No newline at end of file diff --git a/packages/bruno-electron/src/app/onboarding.js b/packages/bruno-electron/src/app/onboarding.js index 05ebe4d4b..5c9e4a492 100644 --- a/packages/bruno-electron/src/app/onboarding.js +++ b/packages/bruno-electron/src/app/onboarding.js @@ -30,8 +30,8 @@ function getDefaultCollectionLocation() { async function importSampleCollection(collectionLocation, mainWindow, lastOpenedCollections) { // Handle both development and production paths const sampleCollectionPath = app.isPackaged - ? path.join(process.resourcesPath, 'sample-collection.json') - : path.join(app.getAppPath(), 'src/assets/sample-collection.json'); + ? path.join(process.resourcesPath, 'data', 'sample-collection.json') + : path.join(app.getAppPath(), 'resources', 'data', 'sample-collection.json'); if (!fs.existsSync(sampleCollectionPath)) { throw new Error(`Sample collection file not found at: ${sampleCollectionPath}`); diff --git a/packages/bruno-electron/src/assets/sample-collection.json b/packages/bruno-electron/src/assets/sample-collection.json deleted file mode 100644 index 869ff4868..000000000 --- a/packages/bruno-electron/src/assets/sample-collection.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "version": "1", - "uid": "1igyn4u00000000000232", - "name": "Sample API Collection", - "items": [ - { - "uid": "1igyn4u00000000000001", - "type": "http-request", - "name": "Get Users", - "seq": 1, - "request": { - "url": "https://jsonplaceholder.typicode.com/users", - "method": "GET", - "headers": [], - "params": [], - "body": { - "mode": "none" - }, - "auth": { - "mode": "none" - }, - "script": { - "req": "", - "res": "" - }, - "vars": { - "req": [], - "res": [] - }, - "assertions": [], - "tests": "", - "docs": "This request retrieves a list of users from the JSONPlaceholder API." - } - } - ], - "environments": [], - "activeEnvironmentUid": null, - "root": { - "request": { - "headers": [], - "auth": { - "mode": "none" - }, - "script": { - "req": "", - "res": "" - }, - "vars": { - "req": [], - "res": [] - }, - "tests": "" - } - } -}