Skip to content

Commit 1fe122d

Browse files
committed
Move classrooms out of webreg-scraping
And switch to using Deno tasks
1 parent 2504723 commit 1fe122d

39 files changed

+67
-83
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dist
1+
/dist

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"deno.enable": true,
33
"deno.lint": false,
44
"deno.unstable": false,
5+
"deno.config": "./deno.jsonc",
56
"deno.suggest.imports.hosts": {
67
"https://deno.land": true
78
}

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ from WebReg (by pasting some JS in the console, probably).
4949
[Live](https://sheeptester.github.io/hello-world/bookmarklet.html?../uxdy/bookmarklet/open-classes)
5050

5151
```sh
52-
# In the base directory
52+
# In the repo root directory
5353
# Build
54-
$ ./webreg-scraping/bookmarklet/build.sh
54+
$ deno task bookmarklet:build
5555
# Deploy built version
5656
$ ./scripts/deploy.sh webreg-scraping/bookmarklet/dist/ bookmarklet
5757
```
@@ -78,18 +78,15 @@ import(
7878
[Live](https://sheeptester.github.io/uxdy/classrooms/)
7979

8080
```sh
81-
# In webreg-scraping/
82-
# To create cache
83-
$ rm cache-sp22/*.json # or mkdir cache-sp22
84-
$ deno run --allow-all scrape.ts <UqZBpD3n> <jlinksessionidx> SP22
81+
# In the repo root directory
8582
# Build
86-
$ deno run --allow-read classrooms/to-file.ts ./cache-wi22/ > classrooms/dist/classrooms-wi22.txt
87-
$ deno run --allow-read classrooms/to-file.ts ./cache-sp22/ > classrooms/dist/classrooms-sp22.txt
88-
$ ./classrooms/build.sh
83+
$ deno run --allow-net scheduleofclasses/scrape.ts WI23 > scheduleofclasses/terms/WI23.json
84+
$ deno run --allow-read classrooms/to-file.ts WI23 > classrooms/dist/classrooms-WI23.txt
85+
$ deno task classrooms:build
8986
# Develop
90-
$ ./classrooms/dev.sh
91-
# Deploy built version (run build.sh first to minify)
92-
$ ../scripts/deploy.sh webreg-scraping/classrooms/dist/ classrooms
87+
$ deno task classrooms:watch
88+
# Deploy built version (run classrooms:build first to minify)
89+
$ ./scripts/deploy.sh ./classrooms/dist/ classrooms
9390
```
9491

9592
Map image was made with [this tool](https://sheeptester.github.io/words-go-here/misc/ucsd-map.html) (zoom 16, x: -3 to 3, y: -3 to 3)
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
!dist
21
dist/index.min.js
32
dist/classrooms-*.txt

webreg-scraping/classrooms/components/BackIcon.tsx renamed to classrooms/components/BackIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @jsxImportSource https://esm.sh/preact@10.6.6 */
1+
/** @jsxImportSource preact */
22

33
/** The Material Design Arrow Back icon. */
44
export function BackIcon () {

webreg-scraping/classrooms/components/Building.tsx renamed to classrooms/components/Building.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/** @jsxImportSource https://esm.sh/preact@10.6.6 */
1+
/** @jsxImportSource preact */
22
/// <reference no-default-lib="true"/>
33
/// <reference lib="dom" />
44
/// <reference lib="deno.ns" />
55

6-
import { useCallback } from 'https://esm.sh/preact@10.6.6/hooks'
6+
import { useCallback } from 'preact/hooks'
77
import {
88
colleges,
99
latLongToPixel,

webreg-scraping/classrooms/components/CloseIcon.tsx renamed to classrooms/components/CloseIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @jsxImportSource https://esm.sh/preact@10.6.6 */
1+
/** @jsxImportSource preact */
22

33
/** The Material Design Close icon. */
44
export function CloseIcon () {

webreg-scraping/classrooms/components/InfoPanel.tsx renamed to classrooms/components/InfoPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @jsxImportSource https://esm.sh/preact@10.6.6 */
1+
/** @jsxImportSource preact */
22
/// <reference no-default-lib="true"/>
33
/// <reference lib="dom" />
44
/// <reference lib="deno.ns" />

webreg-scraping/classrooms/components/RoomList.tsx renamed to classrooms/components/RoomList.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
/** @jsxImportSource https://esm.sh/preact@10.6.6 */
1+
/** @jsxImportSource preact */
22
/// <reference no-default-lib="true"/>
33
/// <reference lib="dom" />
44
/// <reference lib="deno.ns" />
55

6-
import { useState } from 'https://esm.sh/[email protected]/hooks'
7-
import { meetingTypes } from '../../meeting-types.ts'
6+
import { useState } from 'preact/hooks'
87
import { colleges } from '../building-locations.ts'
98
import { Building, compareRoomNums } from '../from-file.ts'
109
import { Now, used } from '../now.ts'

0 commit comments

Comments
 (0)