using esbuild now because it's easier to target specific files

This commit is contained in:
Ryan Breen
2023-01-12 23:27:11 -05:00
parent e4dc8870eb
commit d93fa1aacc
13 changed files with 546 additions and 2664 deletions

View File

@@ -1,4 +0,0 @@
node_modules/
*.build.js*
.parcel-cache/
dist/

View File

@@ -1,6 +1,7 @@
import { generatePrivateKey } from "nostr-tools";
browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
console.log('generating a key!');
console.log(generatePrivateKey());
console.log("Received request: ", request);

View File

@@ -1,3 +1,3 @@
let script = document.createElement('script');
script.setAttribute('src', browser.runtime.getURL('nostr.js'));
script.setAttribute('src', browser.runtime.getURL('nostr.build.js'));
document.body.appendChild(script);

View File

@@ -15,11 +15,12 @@
},
"background": {
"service_worker": "dist/background.js"
"service_worker": "background.build.js",
"type": "module"
},
"content_scripts": [{
"js": [ "dist/content.js" ],
"js": [ "content.build.js" ],
"matches": [ "<all_urls>" ]
}],
@@ -39,7 +40,7 @@
"web_accessible_resources": [
{
"resources": ["dist/nostr.js"],
"resources": ["nostr.build.js", "popup.build.js"],
"matches": ["<all_urls>"]
}
]

File diff suppressed because it is too large Load Diff

View File

@@ -1,22 +0,0 @@
{
"name": "nostore",
"version": "1.0.0",
"description": "",
"source": [
"background.js",
"content.js",
"nostr.js",
"popup.js"
],
"scripts": {
"build": "parcel build",
"watch": "parcel watch",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"nostr-tools": "^1.1.1",
"parcel": "^2.8.2"
}
}

View File

@@ -7,7 +7,6 @@ body {
padding: 10px;
font-family: system-ui;
text-align: center;
}
@media (prefers-color-scheme: dark) {

View File

@@ -6,11 +6,17 @@
</head>
<body>
<form id="priv-key-form">
<label for="profile">Profile</label>
<select id="profile">
<option value="Default">Default</option>
<option value="Next">Next</option>
</select>
<br/>
<label for="priv-key">Private Key</label>
<input type="password" id="priv-key" name="priv-key" />
<button type="submit">Save</button>
</form>
<script src="popup.js"></script>
<script src="popup.build.js"></script>
</body>
</html>