Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrigindo a extensao na parte de Matricula da UFABC #67

Merged
merged 24 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@ npm-debug.log

dist/
packages/
extension

src/components.d.ts
extension/manifest.json

*.crx
*.local
*.log
*.pem
*.xpi
*.zip
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
9 changes: 9 additions & 0 deletions extension/pages/iframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!doctype html>
<html>
<head>
<script src="../dist/lib/xdLocalStoragePostMessageApi.min.js"></script>
</head>
<body>
Next Storage
</body>
</html>
File renamed without changes.
10 changes: 10 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*.js"],
"exclude": ["node_modules", "**/node_modules", "dist"]
}
27 changes: 13 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,29 @@
"type": "module",
"description": "Adiciona funcionalidades novas ao sistema de matricula da UFABC",
"scripts": {
"dev": "rimraf extension/dev && run-p dev:*",
"dev:prepare": "node --no-warnings=ExperimentalWarning tasks/prepare.dev.js dev",
"dev": "yarn clear && NODE_ENV=dev run-p dev:*",
"dev:prepare": "node tasks/prepare.js",
"dev:background": "yarn build:background --mode dev",
"dev:web": "vite",
"dev:js": "yarn run build:dev --watch src",
"build": "NODE_ENV=prod run-s clear build:web build:prepare build:prod",
"build:prepare": "node tasks/prepare.prod.js build",
"dev:js": "yarn run build:js --mode dev",
"dev:general": "yarn run build:general --mode dev",
"build": "NODE_ENV=prod run-s clear build:web build:prepare build:background build:js",
"build:prepare": "node tasks/prepare.js",
"build:background": "vite build --config vite.config.background.js",
"build:web": "vite build",
"build:dev": "tsup --onSuccess 'node --no-warnings=ExperimentalWarning tasks/mvsw.dev.js'",
"build:prod": "tsup --onSuccess 'node --no-warnings=ExperimentalWarning tasks/mvsw.prod.js'",
"clear": "rimraf extension/prod"
},
"standard": {
"globals": [
"chrome"
]
"build:js": "vite build --config vite.config.content.js",
"build:general": "vite build --config vite.config.files.js",
"clear": "rimraf --glob extension/dist extension/manifest.json extension.*"
},
"devDependencies": {
"@vitejs/plugin-vue2": "^2.3.1",
"chokidar": "^3.6.0",
"fs-extra": "^11.2.0",
"kolorist": "^1.8.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"tsup": "^8.0.1",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.1.1"
},
"dependencies": {
Expand Down
8 changes: 8 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
printWidth: 80,
tabWidth: 2,
singleQuote: false,
trailingComma: "all",
arrowParens: "always",
semi: true,
};
4 changes: 2 additions & 2 deletions src/lib/init.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { extensionUtils } from "../utils/extensionUtils";
import { extensionUtils } from "@/utils/extensionUtils";

xdLocalStorage.init({
window.xdLocalStorage.init({
/* required */
iframeUrl: extensionUtils.extensionURL("pages/iframe.html"),
//an option function to be called right after the iframe was loaded and ready for action
Expand Down
33 changes: 11 additions & 22 deletions src/manifest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pkg from "../package.json" with { type: "json" };

const isDev = process.env.NODE_ENV !== "prod";
import { isDev, PORT } from "../tasks/utils.js";

export async function getManifest() {
// update this file to update this manifest.json
Expand All @@ -11,11 +10,11 @@ export async function getManifest() {
version: pkg.version,
description: pkg.description,
icons: {
16: "./assets/icon-16.png",
128: "./assets/icon-128.png",
16: "assets/icon-16.png",
128: "assets/icon-128.png",
},
background: {
service_worker: "background.js",
service_worker: "dist/background/background.mjs",
},
permissions: ["storage"],
host_permissions: [
Expand All @@ -28,7 +27,7 @@ export async function getManifest() {
content_scripts: [
{
all_frames: true,
js: ["contentscript.js"],
js: ["dist/contentScripts/contentscript.global.js"],
matches: [
"http://*.ufabc.edu.br/*",
"https://*.ufabc.edu.br/*",
Expand All @@ -55,24 +54,20 @@ export async function getManifest() {
38: "assets/icon-38.png",
},
default_title: "Next Extension",
default_popup: "./views/Popup/index.html",
default_popup: "dist/views/Popup/index.html",
},
content_security_policy: {
extension_pages: "script-src 'self'; object-src 'self'",
extension_pages: isDev
? `script-src 'self' http://localhost:${PORT}; object-src 'self'`
: "script-src 'self'; object-src 'self'",
},
web_accessible_resources: [
{
resources: [
"components/*",
"assets/*",
"lib/*",
"pages/*",
"scripts/*",
"services/*",
"styles/*",
"utils/*",
"views/*",
"html/*",
"dist/contentScripts/style.css",
"dist/lib/*",
],
matches: [
"http://*.ufabc.edu.br/*",
Expand All @@ -85,11 +80,5 @@ export async function getManifest() {
],
};

if (isDev) {
manifest.content_security_policy = {
extension_pages: `script-src 'self' http://localhost:${5001}; object-src 'self'`,
};
}

return manifest;
}
9 changes: 0 additions & 9 deletions src/pages/iframe.html

This file was deleted.

Loading