Skip to content

Commit

Permalink
running in electron implementing chokidar
Browse files Browse the repository at this point in the history
  • Loading branch information
LinceMathew committed Dec 28, 2023
1 parent d3d342a commit de18258
Show file tree
Hide file tree
Showing 17 changed files with 1,207 additions and 172 deletions.
47 changes: 47 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const { app, BrowserWindow } = require('electron');
const path = require('path');
const url = require('url');

let mainWindow;

function createWindow() {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
webSecurity: false, // Disable web security
},
});

// and load the index.html of the app.
mainWindow.loadURL(
url.format({
pathname: path.join(__dirname, 'build/development/index.html'),
protocol: 'file:',
slashes: true,
})
);

// Open the DevTools.
// mainWindow.webContents.openDevTools();

mainWindow.on('closed', () => {
mainWindow = null;
});
}

app.on('ready', createWindow);

app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});

app.on('activate', () => {
if (mainWindow === null) {
createWindow();
}
});
27 changes: 22 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "firecamp",
"version": "3.2.2",
"private": true,
"private": false,
"description": "DX-first API devtool",
"main": "packages/firecamp-desktop-app/dist/services/Main",
"homepage": "./dev",
"main": "main.js",
"scripts": {
"boot": "pnpm install --shamefully-hoist",
"dev": "pnpm boot && run-p build:workspace webpack:dev",
"old-dev": "pnpm boot && run-p build:workspace webpack:dev",
"dev": "electron .",
"build": "pnpm boot && run-s validate:release build:workspace webpack:prod",
"build:workspace": "pnpm --filter=@firecamp/scripts --filter=@firecamp/rest-executor --filter=@firecamp/ws-executor --filter=@firecamp/socket.io-executor build",
"webpack:dev": "webpack serve --config ./webpack.dev.js",
Expand All @@ -18,14 +18,27 @@
"test": "jest",
"prettify": "prettier --write \"platform/firecamp-platform/src/**/*.(ts|tsx)\" \"packages/firecamp-rest/src/**/*.(ts|tsx)\" \"packages/firecamp-graphql/src/**/*.(ts|tsx)\"",
"precommit": "lint-staged",
"preinstall": "npx only-allow pnpm"
"preinstall": "npx only-allow pnpm",
"build-linux": "electron-builder --linux"
},
"lint-staged": {
"**/*.ts": [
"pnpm prettify",
"git add ."
]
},
"build": {
"appId": "com.lama.app",
"linux": {
"target": [
"deb",
"AppImage"
]
},
"directories": {
"output": "build"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/firecamp-dev/firecamp.git"
Expand Down Expand Up @@ -63,6 +76,8 @@
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"css-modules-require-hook": "^4.2.3",
"electron": "^27.1.2",
"electron-builder": "^24.9.1",
"eslint": "^8.29.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-import": "^2.22.0",
Expand Down Expand Up @@ -104,9 +119,11 @@
},
"dependencies": {
"@react-icons/all-files": "^4.1.0",
"chokidar": "^3.5.3",
"dotenv": "^16.0.1",
"dotenv-vault-core": "^0.7.0",
"lucide-react": "^0.264.0",
"url-loader": "^4.1.1",
"wasm-loader": "^1.3.0"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/firecamp-agent-manager/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export const cancel = async (
case EFirecampAgent.Extension:
return extension.cancel(requestId);
case EFirecampAgent.Web:
restExecutors[requestId].cancel();
// restExecutors[requestId].cancel();

delete restExecutors[requestId];
// delete restExecutors[requestId];

return;
case EFirecampAgent.Cloud:
Expand Down
4 changes: 1 addition & 3 deletions platform/firecamp-platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,18 @@
"@firecamp/agent-manager": "workspace:*",
"@firecamp/cloud-apis": "0.2.11",
"@firecamp/cookie-manager": "^0.0.0",

"@firecamp/rest": "workspace:*",
"@firecamp/rest-executor": "workspace:*",
"@firecamp/scripts": "workspace:*",

"@firecamp/types": "^0.2.2",
"@firecamp/ui": "workspace:*",
"@firecamp/url": "0.0.20",
"@firecamp/utils": "^0.0.24",

"@mantine/form": "^6.0.17",
"@sentry/browser": "7.28.1",
"@sentry/tracing": "7.28.1",
"awesome-notifications": "3.1.3",
"chokidar": "^3.5.3",
"classnames": "^2.1.3",
"clean-deep": "^3.0.2",
"deepdash": "^5.3.9",
Expand Down
Loading

0 comments on commit de18258

Please sign in to comment.