Skip to content

Commit

Permalink
Merge pull request #61 from ufabc-next/chore/replace-gulp
Browse files Browse the repository at this point in the history
Remover gulp
  • Loading branch information
Joabesv authored Feb 11, 2024
2 parents 8fe7082 + 66c12a2 commit 7b9cde2
Show file tree
Hide file tree
Showing 51 changed files with 1,800 additions and 16,963 deletions.
15 changes: 0 additions & 15 deletions .babelrc

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ npm-debug.log

dist/
packages/
extension
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.13.2
v20.10.0
5 changes: 0 additions & 5 deletions gulpfile.babel.js

This file was deleted.

84 changes: 20 additions & 64 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,40 @@
"version": "1.1.7",
"description": "Adiciona funcionalidades novas ao sistema de matricula da UFABC",
"scripts": {
"serve": "node server/app.js",
"start": "yarn build && yarn serve",
"deploy": "caprover deploy",
"build": "yarn build:chrome",
"build:chrome": "gulp pack --production --vendor=chrome",
"build:firefox": "gulp pack --production --vendor=firefox",
"build:opera": "gulp pack --production --vendor=opera",
"build:edge": "gulp pack --production --vendor=edge",
"dev": "yarn dev:chrome",
"staging": "gulp --watch --staging --vendor=chrome",
"dev:chrome": "gulp --watch --vendor=chrome",
"dev:firefox": "gulp --watch --vendor=firefox",
"dev:opera": "gulp --watch --vendor=opera",
"dev:edge": "gulp --watch --vendor=edge",
"lint": "standard"
"dev": "rimraf extension/dev && run-p dev:*",
"dev:prepare": "node --no-warnings=ExperimentalWarning tasks/prepare.dev.mjs 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.mjs build",
"build:web": "vite build",
"build:dev": "tsup src/scripts/background.js src/scripts/contentscript.js --target=node20 --format iife --out-dir extension/dev/dist --no-splitting --onSuccess 'node --no-warnings=ExperimentalWarning tasks/mvsw.dev.mjs'",
"build:prod": "tsup src/scripts/background.js src/scripts/contentscript.js --target=node20 --minify --format iife --out-dir extension/prod/dist --no-splitting --onSuccess 'node --no-warnings=ExperimentalWarning tasks/mvsw.prod.mjs'",
"clear": "rimraf extension/prod"
},
"standard": {
"globals": [
"chrome"
]
},
"devDependencies": {
"babel-cli": "6.x.x",
"babel-core": "6.x.x",
"babel-loader": "7.x.x",
"babel-preset-env": "1.x.x",
"chai": "4.x.x",
"chromereload": "0.x.x",
"debounce": "1.x.x",
"del": "3.x.x",
"gulp": "4.x.x",
"gulp-bump": "2.x.x",
"gulp-cache": "0.x.x",
"gulp-clean-css": "^3.x.x",
"gulp-filter": "^5.x.x",
"gulp-git": "^2.x.x",
"gulp-if": "2.x.x",
"gulp-imagemin": "4.x.x",
"gulp-json-transform": "0.x.x",
"gulp-less": "3.x.x",
"gulp-livereload": "3.x.x",
"gulp-plumber": "1.x.x",
"gulp-sass": "5.1.0",
"gulp-sequence": "1.x.x",
"gulp-sourcemaps": "^2.x.x",
"gulp-tag-version": "1.x.x",
"gulp-util": "3.x.x",
"gulp-zip": "^4.x.x",
"require-dir": "0.x.x",
"sass": "^1.59.3",
"standard": "^10.0.2",
"vinyl-named": "1.x.x",
"webpack": "3.x.x",
"webpack-stream": "3.x.x",
"yargs": "^8.x.x"
"@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",
"rimraf": "^5.0.5",
"tsup": "^8.0.1",
"vite": "^5.1.1"
},
"dependencies": {
"autoprefixer": "^9.3.1",
"axios": "^0.17.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"bluebird": "^3.5.1",
"caprover": "^1.2.0",
"compression": "^1.7.3",
"cors": "^2.8.5",
"css-loader": "^1.0.1",
"element-ui": "^2.4.11",
"express": "^4.16.4",
"extract-text-webpack-plugin": "^3.0.2",
"gulp-cssimport": "^6.0.1",
"gulp-rename": "^1.2.2",
"gulp-vueify": "^0.0.3",
"highcharts": "^6.2.0",
"is_js": "^0.9.0",
"jquery": "^3.2.1",
Expand All @@ -86,19 +48,13 @@
"postcss-load-config": "1.0.0",
"postcss-loader": "1.0.0",
"postcss-url": "8.0.0",
"style-loader": "^0.23.1",
"toastify-js": "^1.9.0",
"toastr": "^2.1.4",
"url-loader": "^1.1.2",
"vue": "2.5.17",
"vue-loader": "^15.3.0",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "2.5.17",
"vue": "2.7.0",
"vue2-highcharts": "^1.2.5",
"vuedraggable": "^2.16.0",
"vueify": "^9.4.1",
"vueify-insert-css": "^1.0.0",
"vuetify": "1.2.6",
"webui-popover": "^1.2.18"
"vuetify": "1.2.6"
}
}
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
81 changes: 0 additions & 81 deletions src/manifest.json

This file was deleted.

95 changes: 95 additions & 0 deletions src/manifest.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import pkg from "../package.json" with { type: "json" };

const isDev = process.env.NODE_ENV !== "prod";

export async function getManifest() {
// update this file to update this manifest.json

const manifest = {
manifest_version: 3,
name: pkg.displayName || pkg.name,
version: pkg.version,
description: pkg.description,
icons: {
16: "./assets/icon-16.png",
128: "./assets/icon-128.png",
},
background: {
service_worker: "background.js",
},
permissions: ["storage"],
host_permissions: [
"http://*.ufabc.edu.br/*",
"https://*.ufabc.edu.br/*",
"http://localhost:8000/*",
"http://*.ufabcnext.com/*",
"https://*.ufabcnext.com/*",
],
content_scripts: [
{
all_frames: true,
js: ["contentscript.js"],
matches: [
"http://*.ufabc.edu.br/*",
"https://*.ufabc.edu.br/*",
"http://localhost:8000/*",
"http://*.ufabcnext.com/*",
"https://*.ufabcnext.com/*",
],
run_at: "document_end",
},
],
key: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlg7ae7OuGQW9cQU3/qbuewZ6DdTjc1yDXtiwdwoOwgF/CByfjX+yf4addlXcxnLjXVBWwSvRj78mv03lLBjkeh63ia4t/BIzzzvciZyZAKEasC5rt0M6+MKVbkKQS9JGGVFsBiBQcQ6kUP8R4cpWX1G9uEhnshdF+u4Nrs7gq9uXIPZ4pf9PhI/IsPyAsv0m5uO4EHhIMtAp8pFyJfECWWSLchlBoGlaaCyf+fT6SYDsWaw53AcwT5jOJfxdQsoGRKGI5UW8V9+Mw+EDdpTpi7f8E5k604EMqZwmzhYLiXcuUqxeXbNZkyTsUNHXTQFcpNUdmisfjiT50kcxVZVc9wIDAQAB",
externally_connectable: {
matches: [
"http://*.ufabc.edu.br/*",
"https://*.ufabc.edu.br/*",
"http://localhost:8000/*",
"http://*.ufabcnext.com/*",
"https://*.ufabcnext.com/*",
],
},
action: {
default_icon: {
19: "assets/icon-19.png",
38: "assets/icon-38.png",
},
default_title: "Next Extension",
default_popup: "./views/Popup/index.html",
},
content_security_policy: {
extension_pages: "script-src 'self'; object-src 'self'",
},
web_accessible_resources: [
{
resources: [
"components/*",
"assets/*",
"lib/*",
"pages/*",
"scripts/*",
"services/*",
"styles/*",
"utils/*",
"views/*",
"html/*",
],
matches: [
"http://*.ufabc.edu.br/*",
"https://*.ufabc.edu.br/*",
"http://localhost:8000/*",
"http://*.ufabcnext.com/*",
"https://*.ufabcnext.com/*",
],
},
],
};

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

return manifest;
}
11 changes: 0 additions & 11 deletions src/pages/popup.html

This file was deleted.

6 changes: 3 additions & 3 deletions src/scripts/contentScriptPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { NextAPI } from "../services/NextAPI";
import Axios from "axios";
import Toastify from "toastify-js";
import "toastify-js/src/toastify.css";
const loading = require("../images/loading.svg");
const errorSVG = require("../images/error.svg");
const logoWhite = require("../images/logo-white.svg");
const loading = require("../assets/loading.svg");
const errorSVG = require("../assets/error.svg");
const logoWhite = require("../assets/logo-white.svg");

const nextApi = NextAPI();

Expand Down
43 changes: 43 additions & 0 deletions src/services/NextStorage.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
export const NextStorage = {
setItem(key, value) {
return new Promise((resolve, reject) => {
try {
const date = Date.now();
const event = new CustomEvent("requestStorage", {
detail: {
method: `setStorage-${key}-${date}`,
date: date,
key: key,
value: value,
},
});
document.addEventListener(`setStorage-${key}-${date}`, (evt) => {
resolve(evt.detail.value);
});
document.dispatchEvent(event);
} catch (err) {
console.error(err);
}
});
},
getItem(key) {
return new Promise((resolve, reject) => {
try {
const date = Date.now();
const event = new CustomEvent("requestStorage", {
detail: {
method: `getStorage-${key}-${date}`,
key: key,
date: date,
},
});
document.addEventListener(`getStorage-${key}-${date}`, (evt) => {
resolve(evt.detail.value);
});
document.dispatchEvent(event);
} catch (err) {
console.error(err);
}
});
},
};
Loading

0 comments on commit 7b9cde2

Please sign in to comment.