mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 11:51:30 +00:00
refactor: moved sample collection JSON to resources folder inside bruno-electron and updated electron-builder-config (#5581)
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}`);
|
||||
|
||||
@@ -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": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user