Skip to content

Commit b466b41

Browse files
committed
let it be
1 parent f34a28b commit b466b41

11 files changed

+70
-190
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/node_modules/
22
/public/build/
3-
3+
*.zip
44
.DS_Store

Makefile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ZIP_CHROME_FILE="extension.chrome.zip"
2+
3+
clean:
4+
rm -rf ./node_modules ./public/build
5+
6+
install:
7+
npm i -g pnpm
8+
pnpm i
9+
10+
dev:
11+
npx rollup -c -w
12+
13+
prod:
14+
npx svelte-check
15+
npx rollup -c
16+
17+
zip_chrome:
18+
rm -rf $(ZIP_CHROME_FILE)
19+
zip -r $(ZIP_CHROME_FILE) ./public ./manifest.json > /dev/null
20+
21+
all:
22+
make prod
23+
make zip_chrome
24+
25+
.PHONY: clean install dev prod zip_chrome all

README.md

+11-100
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,18 @@
1-
# This repo is no longer maintained. Consider using `npm init vite` and selecting the `svelte` option or — if you want a full-fledged app framework — use [SvelteKit](https://kit.svelte.dev), the official application framework for Svelte.
1+
# <img src="./public/img/icon.svg" width="26"/> Browser API Monitor
22

3-
---
3+
Browser extension to monitor browser API calls
4+
🚧 work in progress 🚧
45

5-
# svelte app
6+
### Build requirements
67

7-
This is a project template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/sveltejs/template.
8+
- OS: Linux
9+
- Node: LTS version
810

9-
To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit):
11+
### Build instructions
1012

1113
```bash
12-
npx degit sveltejs/template svelte-app
13-
cd svelte-app
14-
```
15-
16-
*Note that you will need to have [Node.js](https://nodejs.org) installed.*
17-
18-
19-
## Get started
20-
21-
Install the dependencies...
22-
23-
```bash
24-
cd svelte-app
25-
npm install
26-
```
27-
28-
...then start [Rollup](https://rollupjs.org):
29-
30-
```bash
31-
npm run dev
32-
```
33-
34-
Navigate to [localhost:8080](http://localhost:8080). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes.
35-
36-
By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`.
37-
38-
If you're using [Visual Studio Code](https://code.visualstudio.com/) we recommend installing the official extension [Svelte for VS Code](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode). If you are using other editors you may need to install a plugin in order to get syntax highlighting and intellisense.
39-
40-
## Building and running in production mode
41-
42-
To create an optimised version of the app:
43-
44-
```bash
45-
npm run build
46-
```
47-
48-
You can run the newly built app with `npm run start`. This uses [sirv](https://github.com/lukeed/sirv), which is included in your package.json's `dependencies` so that the app will work when you deploy to platforms like [Heroku](https://heroku.com).
49-
50-
51-
## Single-page app mode
52-
53-
By default, sirv will only respond to requests that match files in `public`. This is to maximise compatibility with static fileservers, allowing you to deploy your app anywhere.
54-
55-
If you're building a single-page app (SPA) with multiple routes, sirv needs to be able to respond to requests for *any* path. You can make it so by editing the `"start"` command in package.json:
56-
57-
```js
58-
"start": "sirv public --single"
59-
```
60-
61-
## Using TypeScript
62-
63-
This template comes with a script to set up a TypeScript development environment, you can run it immediately after cloning the template with:
64-
65-
```bash
66-
node scripts/setupTypeScript.js
67-
```
68-
69-
Or remove the script via:
70-
71-
```bash
72-
rm scripts/setupTypeScript.js
73-
```
74-
75-
If you want to use `baseUrl` or `path` aliases within your `tsconfig`, you need to set up `@rollup/plugin-alias` to tell Rollup to resolve the aliases. For more info, see [this StackOverflow question](https://stackoverflow.com/questions/63427935/setup-tsconfig-path-in-svelte).
76-
77-
## Deploying to the web
78-
79-
### With [Vercel](https://vercel.com)
80-
81-
Install `vercel` if you haven't already:
82-
83-
```bash
84-
npm install -g vercel
85-
```
86-
87-
Then, from within your project folder:
88-
89-
```bash
90-
cd public
91-
vercel deploy --name my-project
92-
```
93-
94-
### With [surge](https://surge.sh/)
95-
96-
Install `surge` if you haven't already:
97-
98-
```bash
99-
npm install -g surge
100-
```
101-
102-
Then, from within your project folder:
103-
104-
```bash
105-
npm run build
106-
surge public my-project.surge.sh
14+
make install # install dependencies
15+
make dev # build for development and recompile the changes
16+
make prod # build in production mode
17+
make all # make all in production mode and extension.zip for publishing
10718
```

manifest.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2+
"version": "1.0.0",
3+
"name": "API Monitor",
24
"manifest_version": 3,
3-
"name": "spy-api",
4-
"version": "0.0.1",
5-
"description": "Spy on SPA api",
6-
"minimum_chrome_version": "120.0",
7-
"homepage_url": "https://github.com/zendive/spy-api",
5+
"description": "Monitor browser API usage",
6+
"minimum_chrome_version": "122.0",
7+
"homepage_url": "https://github.com/zendive/browser-api-monitor",
88
"author": "[email protected]",
99
"host_permissions": ["*://*/*"],
1010
"devtools_page": "public/devtools.html",

package.json

+19-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
{
2-
"name": "svelte-app",
3-
"version": "1.0.0",
2+
"version": "1.0.0-alfa",
3+
"name": "browser-api-monitor",
4+
"description": "Monitor browser API usage",
5+
"author": "Block Alexander",
6+
"license": "MIT",
47
"private": true,
5-
"type": "module",
6-
"scripts": {
7-
"build": "rollup -c",
8-
"dev": "rollup -c -w",
9-
"start": "sirv public --no-clear",
10-
"check": "svelte-check"
8+
"keywords": [
9+
"browser",
10+
"extension",
11+
"devtools",
12+
"API",
13+
"monitor"
14+
],
15+
"repository": {
16+
"type": "git",
17+
"url": "git+https://github.com/zendive/browser-api-monitor.git"
18+
},
19+
"bugs": {
20+
"url": "https://github.com/zendive/browser-api-monitor/issues"
1121
},
22+
"type": "module",
1223
"devDependencies": {
1324
"@rollup/plugin-commonjs": "^25.0.7",
1425
"@rollup/plugin-node-resolve": "^15.2.3",
@@ -25,8 +36,5 @@
2536
"svelte-preprocess": "^5.1.3",
2637
"tslib": "^2.6.2",
2738
"typescript": "^5.3.3"
28-
},
29-
"dependencies": {
30-
"sirv-cli": "^2.0.2"
3139
}
3240
}

pnpm-lock.yaml

+2-73
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/favicon.png

-3.05 KB
Binary file not shown.

public/img/icon.svg

+7
Loading

public/img/panel-icon128.png

1.52 KB
Loading

public/img/panel-icon28.png

-279 Bytes
Loading

public/img/panel-icon64.png

-1.83 KB
Loading

0 commit comments

Comments
 (0)