Skip to content

Commit 14567ad

Browse files
committed
feat: allow core service to vendor adapters
1 parent 62dd4d6 commit 14567ad

File tree

19 files changed

+1442
-61
lines changed

19 files changed

+1442
-61
lines changed

apps/chrome-extension/hello.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body>
3+
<h1>Hello Extensions</h1>
4+
<script src="popup.js"></script>
5+
</body>
6+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Hello Extensions",
3+
"description": "Base Level Extension",
4+
"version": "1.0",
5+
"manifest_version": 3,
6+
"action": {
7+
"default_popup": "hello.html"
8+
}
9+
}

apps/chrome-extension/popup.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
console.log('This is a popup!');

apps/vue-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"devDependencies": {
3636
"@commitlint/cli": "^19.3.0",
3737
"@commitlint/config-conventional": "^19.2.2",
38+
"@creedengo/core-services": "workspace: *",
3839
"@creedengo/sonar-services": "workspace: *",
3940
"@creedengo/vue-ui": "workspace: *",
4041
"@creedengo/eslint-config": "workspace: *",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { sonarMswHandler } from '@creedengo/sonar-services'
1+
import sonar from '@creedengo/sonar-services'
22

3-
export const handlers = [...sonarMswHandler]
3+
export const handlers = [...sonar.handlers]

apps/vue-app/src/components/Widgets/Score/ScoreWidget.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@
1616
import { onMounted, reactive } from 'vue';
1717
1818
import { AbcdeScore } from '@creedengo/vue-ui'
19+
import SonarAPI from '@creedengo/sonar-services'
20+
import core from '@creedengo/core-services';
1921
20-
import { calculateProjectScore } from './score.service';
22+
const { api, calculateProjectScore } = core;
23+
24+
api.init(SonarAPI)
2125
2226
const props = defineProps({
2327
project: {

apps/web-extension/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<link rel="icon" href="/favicon.ico">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Creedengo</title>
8+
</head>
9+
<body>
10+
<div id="app"> bla bla </div>
11+
<script type="module">
12+
import "./compat/browser-polyfill.js"
13+
import "@creedengo/vue-dashboard/script"
14+
import "@creedengo/vue-dashboard/stylesheet"
15+
</script>
16+
</body>
17+
</html>

apps/web-extension/manifest.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
"permissions": ["storage"],
66
"description": "Environment dashboard",
77
"action": {
8-
"default_popup": "src/index.html",
9-
"default_icon": "src/images/icon.png"
8+
"default_popup": "index.html"
109
},
1110
"options_page": "src/options.html",
1211
"background": {
13-
"scripts": ["compat/browser-polyfill.js", "src/background.js"]
12+
"service_worker": "src/background.js",
13+
"type": "module"
14+
},
15+
"content_security_policy": {
16+
"extension_pages": "default-src 'self' http://localhost:5173"
1417
},
1518
"browser_specific_settings": {
1619
"gecko": {

apps/web-extension/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
},
1818
"devDependencies": {
1919
"@creedengo/vue-dashboard": "workspace:*",
20-
"vite": "^6.3.5",
21-
"vitest": "^3.2.4",
20+
"@vitejs/plugin-vue": "^5.2.4",
2221
"web-ext": "^8.9.0",
2322
"webextension-polyfill": "^0.12.0"
2423
},
24+
"peerDependencies": {
25+
"vite": "^6.3.5",
26+
"vitest": "^3.2.4"
27+
},
2528
"packageManager": "[email protected]"
2629
}
Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
//import configuration from '../configuration-sample.js'
22

3-
browser.runtime.onInstalled.addListener(() => {
4-
browser.contextMenus.create({
3+
//import '../compat/browser-polyfill'
4+
5+
//const browser = chrome;
6+
7+
chrome.runtime.onInstalled.addListener(async () => {
8+
/*
9+
await chrome.contextMenus.create({
510
id: 'openSidePanel',
611
title: 'Open side panel',
712
contexts: ['all']
813
});
9-
browser.tabs.create({ url: 'index.html' });
14+
*/
15+
await chrome.tabs.create({ url: 'http://localhost:5173' });
16+
/*
17+
chrome.contextMenus.onClicked.addListener((info, tab) => {
18+
if (info.menuItemId === 'openSidePanel') {
19+
// This will open the panel in all the pages on the current window.
20+
chrome.sidebarAction.open({ windowId: tab.windowId });
21+
}
22+
});
23+
*/
1024
});
11-
12-
browser.contextMenus.onClicked.addListener((info, tab) => {
13-
if (info.menuItemId === 'openSidePanel') {
14-
// This will open the panel in all the pages on the current window.
15-
browser.sidebarAction.open({ windowId: tab.windowId });
16-
}
17-
});
25+

0 commit comments

Comments
 (0)