Skip to content

Commit

Permalink
Generate the chrome extension files
Browse files Browse the repository at this point in the history
  • Loading branch information
igorfv committed Jun 2, 2022
1 parent c4f371f commit 1e2c1cd
Show file tree
Hide file tree
Showing 19 changed files with 1,228 additions and 989 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@

## How to run

### `npm dev` or `npm start`
### `npm start`

Runs the app in the development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.
Runs the app in the development mode. Once the app is running it will update the `dist` on every change.
Open the [chrome://extensions](chrome://extensions) and click `load unpacked` to add the local extension, once the prompt opens select the `dist` folder.

### `npm run build`

Expand Down
Binary file added assets/icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions devtools/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<script type="module" src="./index.tsx"></script>
</head>
</html>
9 changes: 9 additions & 0 deletions devtools/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
chrome.devtools.panels.create(
"Apollo Tracing",
"assets/icon-16.png",
"devtools/panel.html",
(panel) => {
if (chrome.runtime.lastError) console.error(chrome.runtime.lastError);
console.log("panel", panel);
}
);
12 changes: 12 additions & 0 deletions devtools/panel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>GraphQL Monitor</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="./panel.tsx"></script>
</body>
</html>
14 changes: 14 additions & 0 deletions devtools/panel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { render, MountableElement } from "solid-js/web";
import { onCleanup, createSignal } from "solid-js";

const CountingComponent = () => {
const [count, setCount] = createSignal(0);
const interval = setInterval(() => setCount((count) => count + 1), 1000);
onCleanup(() => clearInterval(interval));
return <div>Count value is {count()}</div>;
};

render(
() => <CountingComponent />,
document.getElementById("root") as MountableElement
);
16 changes: 0 additions & 16 deletions index.html

This file was deleted.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"name": "vite-template-solid",
"version": "0.0.0",
"description": "",
"name": "graphql-monitor",
"version": "2.0.0",
"description": "Monitor GraphQL connections",
"scripts": {
"start": "vite",
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
"build": "vite build"
},
"license": "MIT",
"devDependencies": {
"@crxjs/vite-plugin": "^1.0.7",
"typescript": "^4.6.4",
"vite": "^2.9.9",
"vite-plugin-solid": "^2.2.6"
Expand Down
Loading

0 comments on commit 1e2c1cd

Please sign in to comment.