-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix linting issues and refactor code for better readability
- Loading branch information
1 parent
1428f10
commit 3b26091
Showing
6 changed files
with
72 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
const logoText = | ||
" ____ _\n/ ___| _ _ _ __ ___(_) __ _\n\\___ \\| | | | '_ \\ / __| |/ _` |\n ___) | |_| | | | | (__| | (_| |\n|____/ \\__, |_| |_|\\___|_|\\__,_|\n |___/"; | ||
" ____ _\n/ ___| _ _ _ __ ___(_) __ _\n\\___ \\| | | | '_ \\ / __| |/ _` |\n ___) | |_| | | | | (__| | (_| |\n|____/ \\__, |_| |_|\\___|_|\\__,_|\n |___/" | ||
|
||
const msgText = (msg: string) => `\n${' '.repeat(14 - msg.length / 2)}[${msg}]`; | ||
const msgText = (msg: string) => `\n${' '.repeat(14 - msg.length / 2)}[${msg}]` | ||
|
||
export const contentScriptLog = (item: string) => { | ||
console.log(logoText, msgText(`${item} Script Loaded`)); | ||
}; | ||
console.log(logoText, msgText(`${item} Script Loaded`)) | ||
} | ||
|
||
export const backgroundLog = () => { | ||
console.log(logoText, msgText('Background Loaded')); | ||
}; | ||
console.log(logoText, msgText('Background Loaded')) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
import { defineConfig, UserManifest } from "wxt"; | ||
import { defineConfig, type UserManifest } from 'wxt' | ||
|
||
const generateManifest = () => { | ||
const manifest: UserManifest = { | ||
action: { | ||
default_title: "Syncia - Open Sidebar", | ||
default_title: 'Syncia - Open Sidebar', | ||
}, | ||
commands: { | ||
"open-sidebar": { | ||
'open-sidebar': { | ||
suggested_key: { | ||
default: "Ctrl+Shift+X", | ||
mac: "Command+Shift+X", | ||
default: 'Ctrl+Shift+X', | ||
mac: 'Command+Shift+X', | ||
}, | ||
description: "Open the sidebar", | ||
description: 'Open the sidebar', | ||
}, | ||
}, | ||
externally_connectable: { ids: ["*"] }, | ||
externally_connectable: { ids: ['*'] }, | ||
icons: { | ||
"16": "images/icon-16.png", | ||
"32": "images/icon-32.png", | ||
"48": "images/icon-48.png", | ||
"128": "images/icon-128.png", | ||
'16': 'images/icon-16.png', | ||
'32': 'images/icon-32.png', | ||
'48': 'images/icon-48.png', | ||
'128': 'images/icon-128.png', | ||
}, | ||
permissions: [ | ||
"storage", | ||
"unlimitedStorage", | ||
"contextMenus", | ||
"tabs", | ||
"activeTab", | ||
"clipboardWrite", | ||
'storage', | ||
'unlimitedStorage', | ||
'contextMenus', | ||
'tabs', | ||
'activeTab', | ||
'clipboardWrite', | ||
], | ||
}; | ||
if (import.meta.env.MANIFEST_VERSION != 2) { | ||
} | ||
if (import.meta.env.MANIFEST_VERSION !== 2) { | ||
manifest.web_accessible_resources = [ | ||
{ | ||
resources: ["sidebar.html", "images/robot.png", "options.html"], | ||
matches: ["http://*/*", "https://*/*"], | ||
resources: ['sidebar.html', 'images/robot.png', 'options.html'], | ||
matches: ['http://*/*', 'https://*/*'], | ||
}, | ||
]; | ||
] | ||
} | ||
|
||
return manifest; | ||
}; | ||
return manifest | ||
} | ||
|
||
export default defineConfig({ | ||
extensionApi: "webextension-polyfill", | ||
srcDir: "src", | ||
extensionApi: 'webextension-polyfill', | ||
srcDir: 'src', | ||
manifest: generateManifest(), | ||
hooks: { | ||
"build:manifestGenerated": (wxt, manifest) => { | ||
const version = require("./package.json").version; | ||
const [major, minor, patch, label = "0"] = version | ||
.replace(/[^\d.-]+/g, "") | ||
.split(/[.-]/); | ||
'build:manifestGenerated': (wxt, manifest) => { | ||
const version = require('./package.json').version | ||
const [major, minor, patch, label = '0'] = version | ||
.replace(/[^\d.-]+/g, '') | ||
.split(/[.-]/) | ||
|
||
manifest.name = | ||
wxt.config.mode === "staging" | ||
? "[INTERNAL] Syncia" | ||
: "Syncia - Power of ChatGPT on any website"; | ||
wxt.config.mode === 'staging' | ||
? '[INTERNAL] Syncia' | ||
: 'Syncia - Power of ChatGPT on any website' | ||
|
||
manifest.description = | ||
"Syncia is a browser extension that allows you to use Open AI's GPT in any website."; | ||
manifest.version = `${major}.${minor}.${patch}.${label}`; | ||
manifest.version_name = version; | ||
"Syncia is a browser extension that allows you to use Open AI's GPT in any website." | ||
manifest.version = `${major}.${minor}.${patch}.${label}` | ||
manifest.version_name = version | ||
}, | ||
}, | ||
}); | ||
}) |