From 676e6faec99f71a5ca75184b13f8dd1c92c14955 Mon Sep 17 00:00:00 2001 From: Eddy Chen <89349085+ecxyzzy@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:41:53 -0800 Subject: [PATCH] =?UTF-8?q?style:=20=F0=9F=8E=A8=20add=20description=20to?= =?UTF-8?q?=20all=20package.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/package.json | 2 +- .../src/routes/v1/rest/calendar/+endpoint.ts | 2 +- .../src/routes/v1/rest/websoc/+endpoint.ts | 2 +- .../routes/v1/rest/websoc/APILambdaClient.ts | 2 +- apps/api/src/routes/v1/rest/websoc/lib.ts | 2 +- apps/docs/package.json | 1 + libs/db/package.json | 1 + libs/lambda/package.json | 1 + libs/uc-irvine-api/tsconfig.json | 3 --- .../package.json | 9 +++----- .../src/registrar/index.ts | 0 .../src/websoc/index.ts | 0 libs/uc-irvine-lib/tsconfig.json | 3 +++ libs/utils/package.json | 1 + libs/websoc-utils/package.json | 3 ++- libs/websoc-utils/src/index.ts | 2 +- packages/types/package.json | 1 + pnpm-lock.yaml | 22 +++++++++---------- services/websoc-proxy/package.json | 2 +- services/websoc-proxy/src/index.ts | 4 ++-- services/websoc-scraper-v2/index.ts | 6 ++--- services/websoc-scraper-v2/package.json | 2 +- tools/grades-updater/package.json | 3 ++- tools/grades-updater/src/populate-ge.ts | 4 ++-- tools/grades-updater/src/sanitize-data.ts | 4 ++-- tools/registrar-scraper/package.json | 1 + 26 files changed, 44 insertions(+), 39 deletions(-) delete mode 100644 libs/uc-irvine-api/tsconfig.json rename libs/{uc-irvine-api => uc-irvine-lib}/package.json (87%) rename libs/{uc-irvine-api => uc-irvine-lib}/src/registrar/index.ts (100%) rename libs/{uc-irvine-api => uc-irvine-lib}/src/websoc/index.ts (100%) create mode 100644 libs/uc-irvine-lib/tsconfig.json diff --git a/apps/api/package.json b/apps/api/package.json index cbaf9626..156582bc 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -27,7 +27,7 @@ "@graphql-tools/utils": "10.0.13", "@libs/db": "workspace:^", "@libs/lambda": "workspace:^", - "@libs/uc-irvine-api": "workspace:^", + "@libs/uc-irvine-lib": "workspace:^", "@libs/utils": "workspace:^", "@libs/websoc-utils": "workspace:^", "@peterportal-api/types": "workspace:^", diff --git a/apps/api/src/routes/v1/rest/calendar/+endpoint.ts b/apps/api/src/routes/v1/rest/calendar/+endpoint.ts index 4340354d..047dd66e 100644 --- a/apps/api/src/routes/v1/rest/calendar/+endpoint.ts +++ b/apps/api/src/routes/v1/rest/calendar/+endpoint.ts @@ -1,6 +1,6 @@ import { PrismaClient } from "@libs/db"; import { createHandler } from "@libs/lambda"; -import { getTermDateData } from "@libs/uc-irvine-api/registrar"; +import { getTermDateData } from "@libs/uc-irvine-lib/registrar"; import type { Quarter, QuarterDates } from "@peterportal-api/types"; import { ZodError } from "zod"; diff --git a/apps/api/src/routes/v1/rest/websoc/+endpoint.ts b/apps/api/src/routes/v1/rest/websoc/+endpoint.ts index d0cc9272..f49ce8a1 100644 --- a/apps/api/src/routes/v1/rest/websoc/+endpoint.ts +++ b/apps/api/src/routes/v1/rest/websoc/+endpoint.ts @@ -1,6 +1,6 @@ import { PrismaClient } from "@libs/db"; import { createHandler } from "@libs/lambda"; -import type { WebsocAPIResponse } from "@libs/uc-irvine-api/websoc"; +import type { WebsocAPIResponse } from "@libs/uc-irvine-lib/websoc"; import { notNull } from "@libs/utils"; import { combineAndNormalizeResponses, sortResponse } from "@libs/websoc-utils"; import { ZodError } from "zod"; diff --git a/apps/api/src/routes/v1/rest/websoc/APILambdaClient.ts b/apps/api/src/routes/v1/rest/websoc/APILambdaClient.ts index 2b3b7cbc..169ea84c 100644 --- a/apps/api/src/routes/v1/rest/websoc/APILambdaClient.ts +++ b/apps/api/src/routes/v1/rest/websoc/APILambdaClient.ts @@ -1,7 +1,7 @@ import type { LambdaClientConfig } from "@aws-sdk/client-lambda"; import { InvokeCommand, LambdaClient } from "@aws-sdk/client-lambda"; import { zeroUUID } from "@libs/lambda"; -import type { WebsocAPIResponse } from "@libs/uc-irvine-api/websoc"; +import type { WebsocAPIResponse } from "@libs/uc-irvine-lib/websoc"; import type { Department, TermData } from "@peterportal-api/types"; import type { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from "aws-lambda"; diff --git a/apps/api/src/routes/v1/rest/websoc/lib.ts b/apps/api/src/routes/v1/rest/websoc/lib.ts index 7121b4ec..6b0bb28b 100644 --- a/apps/api/src/routes/v1/rest/websoc/lib.ts +++ b/apps/api/src/routes/v1/rest/websoc/lib.ts @@ -1,5 +1,5 @@ import type { Prisma } from "@libs/db"; -import type { WebsocAPIOptions } from "@libs/uc-irvine-api/websoc"; +import type { WebsocAPIOptions } from "@libs/uc-irvine-lib/websoc"; import { notNull } from "@libs/utils"; import type { Query } from "./schema"; diff --git a/apps/docs/package.json b/apps/docs/package.json index 30465c28..5220cfdc 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -2,6 +2,7 @@ "name": "@apps/docs", "version": "0.0.0", "private": true, + "description": "The documentation site for API", "scripts": { "build": "docusaurus build", "dev": "docusaurus start" diff --git a/libs/db/package.json b/libs/db/package.json index a3e99336..2a1dc8e7 100644 --- a/libs/db/package.json +++ b/libs/db/package.json @@ -2,6 +2,7 @@ "name": "@libs/db", "version": "0.0.0", "private": true, + "description": "Wrapper package for shared Prisma Client", "license": "MIT", "type": "module", "main": "index.ts", diff --git a/libs/lambda/package.json b/libs/lambda/package.json index 2f2f485f..59fee0b7 100644 --- a/libs/lambda/package.json +++ b/libs/lambda/package.json @@ -2,6 +2,7 @@ "name": "@libs/lambda", "version": "0.0.0", "private": true, + "description": "Helpers for handling Lambda requests", "license": "MIT", "type": "module", "main": "src/index.ts", diff --git a/libs/uc-irvine-api/tsconfig.json b/libs/uc-irvine-api/tsconfig.json deleted file mode 100644 index dc787c60..00000000 --- a/libs/uc-irvine-api/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["../../tsconfig.json"] -} diff --git a/libs/uc-irvine-api/package.json b/libs/uc-irvine-lib/package.json similarity index 87% rename from libs/uc-irvine-api/package.json rename to libs/uc-irvine-lib/package.json index ce09f6a7..0fa180a3 100644 --- a/libs/uc-irvine-api/package.json +++ b/libs/uc-irvine-lib/package.json @@ -1,8 +1,8 @@ { - "name": "@libs/uc-irvine-api", + "name": "@libs/uc-irvine-lib", "version": "0.10.8", "private": true, - "description": "SDK for various UC Irvine services", + "description": "Libraries to interface with various UC Irvine data sources", "keywords": [], "homepage": "https://docs.api-next.peterportal.org", "bugs": { @@ -11,7 +11,7 @@ "repository": { "type": "git", "url": "https://github.com/icssc/peterportal-api-next", - "directory": "libs/uc-irvine-api" + "directory": "libs/uc-irvine-lib" }, "license": "MIT", "type": "module", @@ -55,8 +55,5 @@ "engines": { "node": "20", "pnpm": "8" - }, - "publishConfig": { - "access": "public" } } diff --git a/libs/uc-irvine-api/src/registrar/index.ts b/libs/uc-irvine-lib/src/registrar/index.ts similarity index 100% rename from libs/uc-irvine-api/src/registrar/index.ts rename to libs/uc-irvine-lib/src/registrar/index.ts diff --git a/libs/uc-irvine-api/src/websoc/index.ts b/libs/uc-irvine-lib/src/websoc/index.ts similarity index 100% rename from libs/uc-irvine-api/src/websoc/index.ts rename to libs/uc-irvine-lib/src/websoc/index.ts diff --git a/libs/uc-irvine-lib/tsconfig.json b/libs/uc-irvine-lib/tsconfig.json new file mode 100644 index 00000000..5d9248b2 --- /dev/null +++ b/libs/uc-irvine-lib/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": ["../../tsconfig.json"], +} diff --git a/libs/utils/package.json b/libs/utils/package.json index b1ee9c19..d63c464e 100644 --- a/libs/utils/package.json +++ b/libs/utils/package.json @@ -2,6 +2,7 @@ "name": "@libs/utils", "version": "0.0.0", "private": true, + "description": "Miscellaneous utilities used by the API's components", "license": "MIT", "main": "src/index.ts" } diff --git a/libs/websoc-utils/package.json b/libs/websoc-utils/package.json index 9d414cc9..f5d78005 100644 --- a/libs/websoc-utils/package.json +++ b/libs/websoc-utils/package.json @@ -2,11 +2,12 @@ "name": "@libs/websoc-utils", "version": "0.0.0", "private": true, + "description": "Helper functions for transforming WebSoc JSON responses", "type": "module", "main": "src/index.ts", "types": "src/index.ts", "dependencies": { - "@libs/uc-irvine-api": "workspace:^", + "@libs/uc-irvine-lib": "workspace:^", "@peterportal-api/types": "workspace:^" } } diff --git a/libs/websoc-utils/src/index.ts b/libs/websoc-utils/src/index.ts index 28614390..dd2c36e6 100644 --- a/libs/websoc-utils/src/index.ts +++ b/libs/websoc-utils/src/index.ts @@ -5,7 +5,7 @@ import type { WebsocSchool, WebsocSection, WebsocSectionMeeting, -} from "@libs/uc-irvine-api/websoc"; +} from "@libs/uc-irvine-lib/websoc"; import type { DayOfWeek, WebsocAPIResponse as NormalizedResponse, diff --git a/packages/types/package.json b/packages/types/package.json index e290093a..851e2d72 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,7 @@ { "name": "@peterportal-api/types", "version": "1.0.0-rc.3", + "description": "", "license": "MIT", "type": "module", "main": "index.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a632a351..b1cb29ab 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -107,9 +107,9 @@ importers: '@libs/lambda': specifier: workspace:^ version: link:../../libs/lambda - '@libs/uc-irvine-api': + '@libs/uc-irvine-lib': specifier: workspace:^ - version: link:../../libs/uc-irvine-api + version: link:../../libs/uc-irvine-lib '@libs/utils': specifier: workspace:^ version: link:../../libs/utils @@ -241,7 +241,7 @@ importers: specifier: 8.10.132 version: 8.10.132 - libs/uc-irvine-api: + libs/uc-irvine-lib: dependencies: '@ap0nia/camaro': specifier: 6.2.5 @@ -260,9 +260,9 @@ importers: libs/websoc-utils: dependencies: - '@libs/uc-irvine-api': + '@libs/uc-irvine-lib': specifier: workspace:^ - version: link:../uc-irvine-api + version: link:../uc-irvine-lib '@peterportal-api/types': specifier: workspace:^ version: link:../../packages/types @@ -305,9 +305,9 @@ importers: '@libs/lambda': specifier: workspace:^ version: link:../../libs/lambda - '@libs/uc-irvine-api': + '@libs/uc-irvine-lib': specifier: workspace:^ - version: link:../../libs/uc-irvine-api + version: link:../../libs/uc-irvine-lib '@libs/utils': specifier: workspace:^ version: link:../../libs/utils @@ -333,9 +333,9 @@ importers: '@libs/db': specifier: workspace:^ version: link:../../libs/db - '@libs/uc-irvine-api': + '@libs/uc-irvine-lib': specifier: workspace:^ - version: link:../../libs/uc-irvine-api + version: link:../../libs/uc-irvine-lib '@libs/utils': specifier: workspace:^ version: link:../../libs/utils @@ -386,9 +386,9 @@ importers: '@libs/lambda': specifier: workspace:^ version: link:../../libs/lambda - '@libs/uc-irvine-api': + '@libs/uc-irvine-lib': specifier: workspace:^ - version: link:../../libs/uc-irvine-api + version: link:../../libs/uc-irvine-lib '@libs/utils': specifier: workspace:^ version: link:../../libs/utils diff --git a/services/websoc-proxy/package.json b/services/websoc-proxy/package.json index 871683ae..5c0e51ad 100644 --- a/services/websoc-proxy/package.json +++ b/services/websoc-proxy/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@libs/lambda": "workspace:^", - "@libs/uc-irvine-api": "workspace:^", + "@libs/uc-irvine-lib": "workspace:^", "@libs/utils": "workspace:^", "@libs/websoc-utils": "workspace:^" }, diff --git a/services/websoc-proxy/src/index.ts b/services/websoc-proxy/src/index.ts index 955a7c6f..c59505b0 100644 --- a/services/websoc-proxy/src/index.ts +++ b/services/websoc-proxy/src/index.ts @@ -1,6 +1,6 @@ import { createErrorResult, createOKResult, logger } from "@libs/lambda"; -import { callWebSocAPI, getDepts, getTerms } from "@libs/uc-irvine-api/websoc"; -import type { WebsocAPIResponse, WebsocAPIOptions } from "@libs/uc-irvine-api/websoc"; +import { callWebSocAPI, getDepts, getTerms } from "@libs/uc-irvine-lib/websoc"; +import type { WebsocAPIResponse, WebsocAPIOptions } from "@libs/uc-irvine-lib/websoc"; import { sleep } from "@libs/utils"; import { combineAndNormalizeResponses, fulfilled, sortResponse } from "@libs/websoc-utils"; import type { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from "aws-lambda"; diff --git a/services/websoc-scraper-v2/index.ts b/services/websoc-scraper-v2/index.ts index 11632ece..977b21e6 100644 --- a/services/websoc-scraper-v2/index.ts +++ b/services/websoc-scraper-v2/index.ts @@ -1,5 +1,5 @@ import { PrismaClient } from "@libs/db"; -import { getTermDateData } from "@libs/uc-irvine-api/registrar"; +import { getTermDateData } from "@libs/uc-irvine-lib/registrar"; import type { GE, Quarter, @@ -11,8 +11,8 @@ import type { WebsocSection, WebsocSectionMeeting, sectionTypes, -} from "@libs/uc-irvine-api/websoc"; -import { callWebSocAPI, getDepts, getTerms, geCodes } from "@libs/uc-irvine-api/websoc"; +} from "@libs/uc-irvine-lib/websoc"; +import { callWebSocAPI, getDepts, getTerms, geCodes } from "@libs/uc-irvine-lib/websoc"; import { sleep } from "@libs/utils"; import { createLogger, format, transports } from "winston"; diff --git a/services/websoc-scraper-v2/package.json b/services/websoc-scraper-v2/package.json index 6e9a1c29..24a0e9c9 100644 --- a/services/websoc-scraper-v2/package.json +++ b/services/websoc-scraper-v2/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@libs/db": "workspace:^", - "@libs/uc-irvine-api": "workspace:^", + "@libs/uc-irvine-lib": "workspace:^", "@libs/utils": "workspace:^", "@peterportal-api/types": "workspace:^", "winston": "3.11.0" diff --git a/tools/grades-updater/package.json b/tools/grades-updater/package.json index 88914905..2c89b8e7 100644 --- a/tools/grades-updater/package.json +++ b/tools/grades-updater/package.json @@ -2,6 +2,7 @@ "name": "@tools/grades-updater", "version": "0.0.0", "private": true, + "description": "Scripts for updating the grades cache", "type": "module", "scripts": { "populate": "dotenv -e ../../.env.grades -- tsx src/populate-ge.ts", @@ -11,7 +12,7 @@ "dependencies": { "@libs/db": "workspace:^", "@libs/lambda": "workspace:^", - "@libs/uc-irvine-api": "workspace:^", + "@libs/uc-irvine-lib": "workspace:^", "@libs/utils": "workspace:^", "csv-parse": "5.5.3", "csv-stringify": "6.4.5", diff --git a/tools/grades-updater/src/populate-ge.ts b/tools/grades-updater/src/populate-ge.ts index 4fa687b0..06f4f171 100644 --- a/tools/grades-updater/src/populate-ge.ts +++ b/tools/grades-updater/src/populate-ge.ts @@ -1,6 +1,6 @@ import { PrismaClient } from "@libs/db"; -import type { GE, Quarter } from "@libs/uc-irvine-api/websoc"; -import { callWebSocAPI, geCodes } from "@libs/uc-irvine-api/websoc"; +import type { GE, Quarter } from "@libs/uc-irvine-lib/websoc"; +import { callWebSocAPI, geCodes } from "@libs/uc-irvine-lib/websoc"; import { sleep } from "@libs/utils"; const prisma = new PrismaClient(); diff --git a/tools/grades-updater/src/sanitize-data.ts b/tools/grades-updater/src/sanitize-data.ts index ea2abb56..5d34b202 100644 --- a/tools/grades-updater/src/sanitize-data.ts +++ b/tools/grades-updater/src/sanitize-data.ts @@ -2,8 +2,8 @@ import fs from "fs"; import { basename, resolve } from "node:path"; import { EOL } from "os"; -import { callWebSocAPI } from "@libs/uc-irvine-api/websoc"; -import type { WebsocAPIResponse, WebsocSection } from "@libs/uc-irvine-api/websoc"; +import { callWebSocAPI } from "@libs/uc-irvine-lib/websoc"; +import type { WebsocAPIResponse, WebsocSection } from "@libs/uc-irvine-lib/websoc"; import type { Quarter } from "@peterportal-api/types"; import type { CastingContext, Parser } from "csv-parse"; import { parse } from "csv-parse"; diff --git a/tools/registrar-scraper/package.json b/tools/registrar-scraper/package.json index caf90895..74a36fb4 100644 --- a/tools/registrar-scraper/package.json +++ b/tools/registrar-scraper/package.json @@ -2,6 +2,7 @@ "name": "@tools/registrar-scraper", "version": "0.0.0", "private": true, + "description": "Unified scraper for fetching data from UCI Catalogue and Registrar", "license": "MIT", "type": "module", "main": "index.ts",