chore: get ready for release (#308)

* chore: get ready for release

* chore: update pnpm-lock.yaml

* chore(docs): update CHANGELOG.md

* chore: fix lint warnings and add notes

---------

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>
This commit is contained in:
Razboy20
2024-10-14 22:08:45 -05:00
committed by GitHub
parent d22237d561
commit 2983a0c0fd
19 changed files with 1054 additions and 60 deletions

1
.gitignore vendored
View File

@@ -210,3 +210,4 @@ sketch
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
package-lock.json
storybook-static/
package/

View File

@@ -1,4 +1,4 @@
## 2.0.0-beta4 (2024-10-10)
## 2.0.0 (2024-10-15)
### Features
@@ -11,7 +11,6 @@
- add Calendar Component ([e0212d5](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/e0212d510928e5e95d3ba75e391c34714f1bb035))
- add Calendar schedules component (clicking on storybook not working) ([d1a336e](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/d1a336e903f09b04b89f11ba7ede2f7d26e0ac3c))
- add CalendarHeader and its Storybook, need to resize ([23276e5](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/23276e5c7c907261b1d02e9006d8021d99b43984))
- add changelog logic, component, storybook file, scripts, and update to Node v20.9.0 (LTS) ([4130924](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/413092411993dae6bb65e4702bba67bad9d829dc))
- add check-path-alias custom ESLint rule ([#123](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/123)) ([208103d](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/208103d7081abcf5b31bf36335320aaf7d213464))
- add chrome.storage api mocks for storybook use ([#141](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/141)) ([3839bff](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/3839bff29ef6f0ecfad1e975e685df9a64d96c92))
- add CSS for calendarCell div ([6cdcf49](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/6cdcf4930d9868c0ed45820f66102d89a644cfb6))
@@ -25,7 +24,6 @@
- add MIMEType ([0c76052](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/0c760524781556cf089f1885dc4ff3fd567bfc2b))
- add new db powered by UT_Grade_Parser ([#163](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/163)) ([60d1f48](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/60d1f48bd95132f0517258f017a7644d8aff5101))
- add react-loading-skeleton package ([#244](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/244)) ([b4dd91a](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/b4dd91ad2595d9583a60530c2c2ff6d829d2d5e5))
- add release.ts ([63442d1](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/63442d1ae3f581c3dcecfe195281b85ead234fe7))
- add skeleton loader for course description + distribution ([#267](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/267)) ([c2cab40](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/c2cab407f3a07c1d3073e936c9d23cb1cecc9cb9))
- add story for CalendarGridCell ([fd91c3b](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/fd91c3b12ef5670563e689d190be75ef1f695d1c))
- add Storybook story ([cb3cb5d](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/cb3cb5d5fc18a68ca5a825f97b808b535aa1fe29))
@@ -33,7 +31,6 @@
- add tickmarks to day div ([8b9cb06](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/8b9cb065c28b5dd38b7e1681839a81f55691a3c6))
- add time column to Calendar Component ([9d68211](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/9d6821127e7ff9bf63cef659932ee7408de4c969))
- add timeAndGrid div ([95e0544](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/95e0544b7301d382439b74038fb1b3e25dfe6d30))
- add utils ([e7c9421](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/e7c94217195f5e320f1735f08d0983bac21c36af))
- added flag ;-; ([#195](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/195)) ([9b4d61c](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/9b4d61c2b0d8806b5d4a10296c1cc1266ac4229f))
- added scrapedAt property ([#149](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/149)) ([8e181b3](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/8e181b3010dfe25ea1e4b4ba181cbe9944d6e92e))
- additional changes to [#201](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/201) ([#224](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/224)) ([bc354f3](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/bc354f3798a02e6ebc3c66a8b5eee553c25a19d4))
@@ -106,6 +103,7 @@
- made List more extensible ([cd34601](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/cd34601379d5cd2b53d967afbc954178834823b9))
- match calendar designs & add functionality ([#176](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/176)) ([8027c3d](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/8027c3d1bf228053acbad3e232b030c9ddbaca6a))
- migrate styles to TailwindCSS ([7e2f5ea](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/7e2f5eaed7d782bc886545f7241e0891d55cfae0))
- migration update showing ([#293](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/293)) ([aede681](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/aede681d4bb5b01723eb9d68527f4e64991adfab))
- missed one chip toggle there ([#245](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/245)) ([5ca24da](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/5ca24dab82509d34cf43af4359940476159d052f))
- newer grades and parameterized queries ([#238](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/238)) ([75ad416](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/75ad4167b6639bbcf58e2dc6dafc80ed4656a899))
- one single exclamation mark did all that ([#235](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/235)) ([be87e41](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/be87e4181430e0df41683be5c9d0a1ce992b2c61))
@@ -122,14 +120,17 @@
- refactor all components in injected ([0c44849](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/0c44849e15333c3a5cbdf8972eb31ada0e830b0a))
- refactor calendar ([28f1924](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/28f192472b7f244253b6a0b5339491b9740880f7))
- Refactor database initialization code ([5e98f45](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/5e98f45210346f0e7bb69af5cf25e336c76416ca))
- refactor to use DialogProvider ([ed5730f](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/ed5730f03e3fd512d8d7a566563fb08de14369a2))
- release notes ([#283](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/283)) ([bd17e33](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/bd17e3353792df70ca2e33c8b7a32b5fb9acc7d2))
- report issue popup ([#261](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/261)) ([65ff6bf](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/65ff6bfbbfc6b696621628e448865155d0405f7f))
- rerouted directory to syllabus when click on professor name ([#211](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/211)) ([8959e0d](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/8959e0d9f7fdd82125f391f1ec51aa390ba9450d))
- sam's jokes ([#278](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/278)) ([895cd31](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/895cd31d8eb40e7e99fc0969b543e95bd070f6b7))
- save as PNG functionality ([ad18fbd](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/ad18fbd16235be0c75121b527867fac708670300))
- schedule list item action menu ([#230](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/230)) ([15fc369](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/15fc3699cfda3ad56e5a262bd37dca166e2685dd))
- screenshot whole page, hide certain elements, screenshot fixed size ([#180](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/180)) ([7d4c5d7](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/7d4c5d7be8b266b5f3caf2135c4f3fecb96d75be))
- settings page ([#260](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/260)) ([7a5c3a2](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/7a5c3a2e62c3a726735f9fe921f9e08d4092d0f9))
- show async courses in the bottom bar ([#204](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/204)) ([227de53](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/227de53e8453804f0791f269dae64ec388136390))
- some small changes for colors and font ([#201](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/201)) ([bae1da4](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/bae1da43d3373e12d593682e9fb69e19557b5749))
- splash text additions before v2 release ([#296](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/296)) ([e774f31](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/e774f316e3f92c03e79274a55f1f729178c9a14a))
- splash text has arrived! ([#246](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/246)) ([9971435](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/9971435716dec11e954dc26c14bf7d1505563d0d))
- Storybook for Vite ([#52](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/52)) ([9cc299c](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/9cc299ced6132644a5c2375b95a8a16a3482601b))
- switch button ([#229](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/229)) ([abae7a5](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/abae7a5c22ab944262d66ae897298b008a03c5f1))
@@ -141,18 +142,17 @@
- update badge count when schedule changes ([#150](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/150)) ([a5e9e3c](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/a5e9e3c2145d61d8cc5788eb50fa19718e6d13bf))
- update Button to v2 design ([863521f](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/863521fb3bb268131bd3f369064ae10a442b4fbc))
- update dialog component to headlessui ([#159](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/159)) ([442be8c](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/442be8cbee06ec403467b100d8d5300dd4a7ea72))
- update padding, width, and change font to mono ([9e7e423](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/9e7e423f737231d94b0fd87a509aeece696bef45))
- update with TailwindCSS ([f3a8a7d](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/f3a8a7db560a6b28f96a2e976c8ed33af97fe77a))
- updated calendar page and recruitment banner links ([#219](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/219)) ([a2303ee](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/a2303ee35f10aba5fa7ff5e307d0092a39f18830))
- updated divider component ([#99](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/99)) ([8ab60c9](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/8ab60c9f018143df594e7bfd0d321666289cc28c))
- updated Text component to latest design specification ([#70](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/70)) ([8b8433d](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/8b8433deaf8fe66f917fd66fb56cb0a748bc6e6e))
- updated Text component to latest design specification ([#70](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/70)) ([bb727f7](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/bb727f70bea5a4c2ff5dba7e9b4428c0c84de7b2))
- updating joke styling and updating jokes array ([#277](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/277)) ([0da27e2](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/0da27e2c46e9fc32efb80808715053c1f9f5165a))
- use conventionalcommits for changelog preset ([51bf8e9](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/51bf8e939d05b22cdef352bc3d9dbfbf7c264eee))
- use display: grid for calendarGrid ([b535a6e](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/b535a6eb32ac1091c8b5309ca3cfb6bab0b62526))
- use downloadBlob util ([#186](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/186)) ([2dfb10e](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/2dfb10e57b51a08fcde2dc6638a81b5ec9bbc7ab))
- use filter() instead of pop() ([063349d](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/063349d96d0ad008fa0dc1f0a8c7a27cf3f108ce))
- use React-icons ([8df9ea5](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/8df9ea55a9f0bcb04c90314cb311bba9d1ebf2e3))
- UTRP v2 migration ([#292](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/292)) ([d22237d](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/d22237d561ddf6a2f8ed699ca4c11088a8b408e8))
- working PNG and CAL downloads ([#119](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/119)) ([d9ee23c](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/d9ee23c5bbe27240a0e2849aae2eae81d7960bb5))
### Bug Fixes
@@ -184,6 +184,7 @@
- db with proper insertion order ([8e79d6a](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/8e79d6a6a87210e0a30584c0c9ceb60bd3a33665))
- delete storybook timestamp file ([f93a98e](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/f93a98e46ae76e9b1474c8143bfc3f5076e8b91f))
- dialog movement ([#227](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/227)) ([bc5d68c](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/bc5d68ce18f818c285ef7f5eda03f499365ee2e8))
- disabled [object Object] hover message on dialog popups ([#284](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/284)) ([dcc1d81](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/dcc1d81a74922ba27ad2a6859f978f3f20136178))
- divider usage in HeaderAndActions ([#113](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/113)) ([84e8320](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/84e8320e8fce5961877a5745e89419a722055ed5))
- doesn't autoload on pages that don't have pages to load ([#270](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/270)) ([88eeb62](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/88eeb620aec52d6e4172cc908843339412ade90b))
- don't crash on cultural diversity flag ([#196](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/196)) ([5b1e451](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/5b1e4513e29203a54ed9f4913c227d6c45d2e67a))
@@ -218,6 +219,7 @@
- remote react-window fully (from List component) ([#114](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/114)) ([5f1c023](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/5f1c0231e483bc571ef944bbc0b950ab20d31028))
- remove course name from the syllabi lookup ([#200](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/200)) ([bcb5a8c](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/bcb5a8c469c4b5c1909880ab6789d67d04487ed2))
- remove extra spacing ([#121](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/121)) ([6ba8b68](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/6ba8b68654dc182bd2a084f93b0f4f7d5c132862))
- remove white space after duplicate schedule regex matching ([#286](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/286)) ([d73615e](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/d73615e28129ee7d78604c6b295ec572b11be46e))
- rename to course block and fix line height for styling ([b602b0b](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/b602b0b895416a26214e934f9650a8ec0a10711e))
- revert "chore: add default story" ([aef8c3d](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/aef8c3d9873c6df79f6a54ab4c669ee1849b5ea5))
- revert "rename to course block and fix line height for styling" ([0273a23](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/0273a239139c0f3c0ad773ed8ab1cd4ad8d22fa3))
@@ -227,6 +229,7 @@
- support classes with no location ([#242](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/242)) ([3ff06e0](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/3ff06e043b112bc232c9c173e72b2ea99609cf7a))
- theme colors ([2f537b4](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/2f537b4f3e3946241f2e287d9ae075e5a2aa7087))
- type issues by using correct import ([#111](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/111)) ([19fe070](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/19fe070491be9e2d40f12918561f6f6ac5921237))
- **ui:** unhid settings button ([#288](https://github.com/Longhorn-Developers/UT-Registration-Plus/issues/288)) ([db1eac3](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/db1eac33a2786a3db87f0e6b3679233a85ab923f))
- undefined color case ([9aa78a0](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/9aa78a02a5d4f68daa062e4892875cf5f568306c))
- unocss theme color namings ([79d7832](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/79d7832d0987b8a7c9650b984f72ffd702682423))
- update alignment ([7eb3113](https://github.com/Longhorn-Developers/UT-Registration-Plus/commit/7eb3113adaa0917c0275576c3366c387bfe77440))

35
gulpfile.js Normal file
View File

@@ -0,0 +1,35 @@
// (Thanks go to https://github.com/pnd280/complexity/blob/alpha/gulpfile.js)
import fs from 'fs';
import gulp from 'gulp';
import gulpZip from 'gulp-zip';
import { createRequire } from 'module';
function zip() {
const require = createRequire(import.meta.url);
const manifest = require('./package.json');
const zipFileName = `${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`;
return gulp.src('dist/**').pipe(gulpZip(zipFileName)).pipe(gulp.dest('package'));
}
// Temp fix for CSP on Chrome 130
// Manually remove them because there is no option to disable use_dynamic_url on @crxjs/vite-plugin
function forceDisableUseDynamicUrl(done) {
const require = createRequire(import.meta.url);
const manifest = require('./dist/manifest.json');
manifest.web_accessible_resources.forEach(resource => {
delete resource.use_dynamic_url;
});
if (!fs.existsSync('./dist/manifest.json')) {
return done();
}
fs.writeFileSync('./dist/manifest.json', JSON.stringify(manifest, null, 2));
done();
}
export { forceDisableUseDynamicUrl, zip };

View File

@@ -1,7 +1,7 @@
{
"name": "ut-registration-plus",
"displayName": "UT Registration Plus",
"version": "2.0.0-beta4",
"version": "2.0.0",
"description": "UT Registration Plus is a Chrome extension that allows students to easily register for classes.",
"private": true,
"homepage": "https://github.com/Longhorn-Developers/UT-Registration-Plus",
@@ -10,6 +10,7 @@
"dev": "vite",
"build": "tsc && vite build",
"build:watch": "NODE_ENV='development' vite build --mode development -w",
"zip": "pnpm build && pnpm gulp zip",
"prettier": "prettier src --check",
"prettier:fix": "prettier src --write",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives",
@@ -74,6 +75,8 @@
"@svgr/plugin-jsx": "^8.1.0",
"@types/chrome": "^0.0.273",
"@types/conventional-changelog": "^3.1.5",
"@types/gulp": "^4.0.17",
"@types/gulp-zip": "^4.0.4",
"@types/node": "^22.7.5",
"@types/prompts": "^2.4.9",
"@types/react": "^18.3.11",
@@ -94,6 +97,7 @@
"@vitejs/plugin-react-swc": "^3.7.1",
"@vitest/coverage-v8": "^2.1.2",
"@vitest/ui": "^2.1.2",
"chalk": "^5.3.0",
"chromatic": "^11.12.5",
"cssnano": "^7.0.6",
"cssnano-preset-advanced": "^7.0.6",
@@ -115,6 +119,8 @@
"eslint-plugin-react-refresh": "^0.4.12",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-storybook": "^0.9.0",
"gulp": "^5.0.0",
"gulp-zip": "^6.0.0",
"path": "^0.12.7",
"postcss": "^8.4.47",
"prettier": "^3.3.3",

849
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -31,12 +31,10 @@ chrome.runtime.onInstalled.addListener(details => {
}
});
// migration/login logic
chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
console.log(changeInfo);
if (changeInfo.url === 'https://utdirect.utexas.edu/apps/registrar/course_schedule/utrp_login/') {
console.log('UTDirect detected');
// close the tab, open popup
function openPopupAction() {
chrome.tabs.onActivated.removeListener(openPopupAction);
chrome.action.openPopup();

View File

@@ -7,7 +7,7 @@
<title>UTRP Options</title>
</head>
<body>
<body style="min-height: 100vh; height: 0; margin: 0">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

View File

@@ -9,14 +9,12 @@ import List from '@views/components/common/List';
import Text from '@views/components/common/Text/Text';
import useSchedules, { getActiveSchedule, replaceSchedule, switchSchedule } from '@views/hooks/useSchedules';
import { getUpdatedAtDateTimeString } from '@views/lib/getUpdatedAtDateTimeString';
import clsx from 'clsx';
import useKC_DABR_WASM from 'kc-dabr-wasm';
import React, { useEffect, useState } from 'react';
import AddSchedule from '~icons/material-symbols/add';
import CalendarIcon from '~icons/material-symbols/calendar-month';
import Feedback from '~icons/material-symbols/flag';
import RefreshIcon from '~icons/material-symbols/refresh';
import SettingsIcon from '~icons/material-symbols/settings';
import { Button } from './common/Button';
@@ -182,9 +180,9 @@ export default function PopupMain(): JSX.Element {
{enableDataRefreshing && (
<div className='inline-flex items-center self-center gap-1'>
<Text variant='mini' className='text-ut-gray !font-normal'>
DATA LAST UPDATED: {getUpdatedAtDateTimeString(activeSchedule.updatedAt)}
LAST UPDATED: {getUpdatedAtDateTimeString(activeSchedule.updatedAt)}
</Text>
<button
{/* <button
className='h-4 w-4 bg-transparent p-0 btn'
onClick={() => {
setIsRefreshing(true);
@@ -195,7 +193,7 @@ export default function PopupMain(): JSX.Element {
'animate-spin': isRefreshing,
})}
/>
</button>
</button> */}
</div>
)}
</div>

View File

@@ -6,7 +6,12 @@ import React, { useState } from 'react';
import { Button } from './common/Button';
import Text from './common/Text/Text';
const ReportIssueMain: React.FC = () => {
/**
* ReportIssueMain component renders a feedback form for users to submit their email and feedback.
*
* @returns The rendered component.
*/
export default function ReportIssueMain(): JSX.Element {
const [email, setEmail] = useState('');
const [feedback, setFeedback] = useState('');
const [isSubmitted, setIsSubmitted] = useState(false);
@@ -112,6 +117,4 @@ const ReportIssueMain: React.FC = () => {
</form>
</div>
);
};
export default ReportIssueMain;
}

View File

@@ -11,7 +11,7 @@ import { openTabFromContentScript } from '@views/lib/openNewTabFromContentScript
import React, { useEffect, useState } from 'react';
import MenuIcon from '~icons/material-symbols/menu';
import RefreshIcon from '~icons/material-symbols/refresh';
// import RefreshIcon from '~icons/material-symbols/refresh';
import SettingsIcon from '~icons/material-symbols/settings';
/**
@@ -79,11 +79,11 @@ export default function CalendarHeader({ onSidebarToggle }: CalendarHeaderProps)
{enableDataRefreshing && (
<div className='flex items-center gap-1 screenshot:hidden'>
<Text variant='mini' className='text-nowrap text-ut-gray font-normal!'>
DATA LAST UPDATED: {getUpdatedAtDateTimeString(activeSchedule.updatedAt)}
LAST UPDATED: {getUpdatedAtDateTimeString(activeSchedule.updatedAt)}
</Text>
<button className='inline-block h-4 w-4 bg-transparent p-0 btn'>
{/* <button className='inline-block h-4 w-4 bg-transparent p-0 btn'>
<RefreshIcon className='h-4 w-4 animate-duration-800 text-ut-black' />
</button>
</button> */}
</div>
)}
</div>

View File

@@ -79,6 +79,9 @@ function List<T>({ draggables, itemKey, children, onReordered, gap }: ListProps<
useEffect(() => {
setItems(wrap(draggables, itemKey));
// This is on purpose
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [draggables]);
const onDragEnd: OnDragEndResponder = useCallback(
@@ -92,6 +95,9 @@ function List<T>({ draggables, itemKey, children, onReordered, gap }: ListProps<
setItems(reordered);
onReordered(reordered.map(item => item.content));
},
// This is on purpose
// eslint-disable-next-line react-hooks/exhaustive-deps
[items]
);

View File

@@ -39,6 +39,9 @@ function MigrationButtons({ close }: { close: () => void }): JSX.Element {
};
handleMigration();
// This is on purpose
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [processState]);
return (
@@ -81,6 +84,15 @@ function MigrationButtons({ close }: { close: () => void }): JSX.Element {
);
}
/**
* Custom hook that provides a function to show a migration dialog.
*
* The dialog prompts the user to migrate their saved schedules if there are any courses
* available to migrate. If there are no courses to migrate, it informs the user that
* migration has already been completed.
*
* @returns A function that, when called, checks for courses to migrate and shows the appropriate dialog.
*/
export function useMigrationDialog() {
const showDialog = usePrompt();
@@ -114,6 +126,19 @@ export function useMigrationDialog() {
};
}
/**
* MigrationDialog component.
*
* This component is responsible for checking if a migration has already been attempted
* and if there are any courses from UTRPv1 that need to be migrated. If migration is needed,
* it triggers the migration dialog.
*
* @returns An empty fragment.
*
* @remarks
* The component uses the `useMigrationDialog` hook to show the migration dialog and the
* `useEffect` hook to perform the migration check on component mount.
*/
export function MigrationDialog(): JSX.Element {
const showMigrationDialog = useMigrationDialog();
@@ -126,6 +151,9 @@ export function MigrationDialog(): JSX.Element {
};
checkMigration();
// This is on purpose
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
// (not actually a useless fragment)

View File

@@ -6,7 +6,7 @@ import { initSettings, OptionsStore } from '@shared/storage/OptionsStore';
import { Button } from '@views/components/common/Button';
import { usePrompt } from '@views/components/common/DialogProvider/DialogProvider';
import Divider from '@views/components/common/Divider';
import { SmallLogo } from '@views/components/common/LogoIcon';
import { LargeLogo } from '@views/components/common/LogoIcon';
// import PopupCourseBlock from '@views/components/common/PopupCourseBlock';
import SwitchButton from '@views/components/common/SwitchButton';
import Text from '@views/components/common/Text/Text';
@@ -240,14 +240,14 @@ export default function Settings(): JSX.Element {
}
return (
<div className='min-w-xl bg-white'>
<header className='flex items-center justify-between border-b p-6'>
<div className='flex items-center'>
<SmallLogo className='pr-4' />
<Divider size='2rem' orientation='vertical' />
<h1 className='pl-4 text-xl text-ut-burntorange font-bold'>UTRP SETTINGS & CREDITS PAGE</h1>
</div>
<div className='flex space-x-4'>
<div>
<header className='flex items-center gap-5 overflow-x-auto overflow-y-hidden border-b border-ut-offwhite px-7 py-4 md:overflow-x-hidden'>
<LargeLogo />
<Divider className='mx-2 self-center md:mx-4' size='2.5rem' orientation='vertical' />
<Text variant='h1' className='flex-1 text-ut-burntorange'>
UTRP SETTINGS & CREDITS PAGE
</Text>
<div className='hidden flex-row items-center justify-end gap-6 screenshot:hidden lg:flex'>
<Button variant='single' color='theme-black' onClick={handleChangelogOnClick}>
<IconoirGitFork className='h-6 w-6 text-ut-gray' />
<Text variant='small' className='text-ut-gray font-normal'>
@@ -408,7 +408,7 @@ export default function Settings(): JSX.Element {
<Preview>
<div className='inline-flex items-center self-center gap-1'>
<Text variant='small' className='text-ut-gray !font-normal'>
DATA LAST UPDATED: {getUpdatedAtDateTimeString(activeSchedule.updatedAt)}
LAST UPDATED: {getUpdatedAtDateTimeString(activeSchedule.updatedAt)}
</Text>
</div>
<Text

View File

@@ -16,6 +16,9 @@ export interface DialogInfo {
onClose?: () => void;
}
/**
* Options for configuring the behavior of a dialog.
*/
export interface DialogOptions {
/**
* Whether to show the dialog immediately.

View File

@@ -84,6 +84,9 @@ export default function SentryProvider({
client.init();
}
return [scope, client];
// This is on purpose to only run once
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (

View File

@@ -5,6 +5,8 @@ import React from 'react';
import MaterialSymbolsClose from '~icons/material-symbols/close';
import { Button } from '../components/common/Button';
/**
* Custom hook that provides a function to display a changelog dialog.
*
@@ -16,16 +18,13 @@ export default function useChangelog(): () => void {
const handleOnClick = () => {
showDialog(close => ({
title: (
<div className='flex items-center justify-between p-4'>
<div className='sticky top-0 flex items-center justify-between bg-white p-4'>
<Text variant='h1' className='text-theme-black'>
Changelog
</Text>
<button
onClick={close}
className='text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200'
>
<MaterialSymbolsClose className='text-2xl' />
</button>
<Button variant='single' onClick={close} color='theme-black' className='p-1 text-gray-700'>
<MaterialSymbolsClose className='h-7 w-7' />
</Button>
</div>
),
description: <ChangelogPopup />,

View File

@@ -41,6 +41,7 @@
"postcss.config.cjs",
".storybook",
"unocss.config.ts",
"gulpfile.js",
"@types"
]
}

View File

@@ -0,0 +1,80 @@
// https://github.com/pnd280/complexity/blob/alpha/vite-plugins/vite-plugin-run-command-on-demand.ts
import chalk from 'chalk';
import { exec } from 'child_process';
import type { HmrContext, Plugin } from 'vite';
const pluginName = 'vite-plugin-run-command-on-demand';
const log = (message: string) => console.log(chalk.blue(`\n[${pluginName}]`), chalk.green(message));
const logError = (message: string) => console.error(chalk.blue(`\n[${pluginName}]`), chalk.red(message));
const runCommand = (command: string): Promise<void> =>
new Promise((resolve, reject) => {
exec(command, (error, stdout, stderr) => {
if (error) {
logError(`Error executing command: ${command}\n${stderr}`);
reject(error);
} else {
log(`Command executed successfully: ${command}\n${stdout}`);
resolve();
}
});
});
type CustomCommandsPluginOptions = {
beforeServerStart?: string;
afterServerStart?: string;
onHotUpdate?: string;
beforeBuild?: string;
afterBuild?: string;
closeBundle?: string;
};
const executeCommand = async (command: string | undefined, errorMessage: string) => {
if (command) {
try {
await runCommand(command);
} catch {
logError(errorMessage);
}
}
};
export default function customCommandsPlugin(options: CustomCommandsPluginOptions = {}): Plugin {
return {
name: pluginName,
configureServer(server) {
server.httpServer?.once('listening', async () => {
await executeCommand(
options.beforeServerStart,
`Error running beforeServerStart command: ${options.beforeServerStart}`
);
await executeCommand(
options.afterServerStart,
`Error running afterServerStart command: ${options.afterServerStart}`
);
});
},
async handleHotUpdate(ctx: HmrContext) {
const isPageReload = ctx.modules.some(module => !module.isSelfAccepting);
if (!isPageReload) {
await executeCommand(options.onHotUpdate, `Error running onHotUpdate command: ${options.onHotUpdate}`);
}
return ctx.modules;
},
async buildStart() {
await executeCommand(options.beforeBuild, `Error running beforeBuild command: ${options.beforeBuild}`);
},
async buildEnd() {
await executeCommand(options.afterBuild, `Error running afterBuild command: ${options.afterBuild}`);
},
async closeBundle() {
await executeCommand(options.closeBundle, `Error running closeBundle command: ${options.closeBundle}`);
},
};
}

View File

@@ -10,6 +10,7 @@ import inspect from 'vite-plugin-inspect';
import packageJson from './package.json';
import manifest from './src/manifest';
import vitePluginRunCommandOnDemand from './utils/plugins/run-command-on-demand';
const root = resolve(__dirname, 'src');
const pagesDir = resolve(root, 'pages');
@@ -141,6 +142,10 @@ export default defineConfig({
renameFile('src/pages/options/index.html', 'options.html'),
renameFile('src/pages/calendar/index.html', 'calendar.html'),
renameFile('src/pages/report/index.html', 'report.html'),
vitePluginRunCommandOnDemand({
afterServerStart: 'pnpm gulp forceDisableUseDynamicUrl',
closeBundle: 'pnpm gulp forceDisableUseDynamicUrl',
}),
],
resolve: {
alias: {
@@ -179,6 +184,9 @@ export default defineConfig({
},
},
build: {
target: ['chrome120', 'edge120', 'firefox120'],
emptyOutDir: true,
reportCompressedSize: false,
rollupOptions: {
input: {
debug: 'src/pages/debug/index.html',
@@ -186,11 +194,10 @@ export default defineConfig({
options: 'src/pages/options/index.html',
report: 'src/pages/report/index.html',
},
// output: {
// entryFileNames: `[name].js`, // otherwise it will add the hash
// chunkFileNames: `[name].js`,
// },
// external: ['/@react-refresh'],
output: {
chunkFileNames: `assets/[name]-[hash].js`,
assetFileNames: `assets/[name]-[hash][extname]`,
},
},
},
test: {