From 719824eada8ffa4c526d07effb2117db03bbcbaa Mon Sep 17 00:00:00 2001 From: Matt Leon <108271225+wydengyre@users.noreply.github.com> Date: Tue, 30 Jan 2024 16:30:27 +0700 Subject: [PATCH] declare workspace deps (#62) --- package-lock.json | 45 ++++++++++++++------ package.json | 2 +- packages/cf/package.json | 8 +++- packages/cf/{ => test}/declarations.d.ts | 0 packages/cf/tsconfig.json | 4 +- packages/cf/tsconfig.test.json | 2 +- packages/cf/worker.test.ts | 4 +- packages/rai/package.json | 2 +- packages/rai/{ => test}/declarations.d.ts | 0 packages/rai/tsconfig.json | 2 +- packages/rai/tsconfig.test.json | 2 +- packages/server/feed-handler.test.ts | 10 ++--- packages/server/feed-handler.ts | 4 +- packages/server/handler.test.ts | 8 ++-- packages/server/handler.ts | 6 +-- packages/server/package.json | 5 ++- packages/server/{ => test}/declarations.d.ts | 0 packages/server/tsconfig.json | 2 +- packages/server/tsconfig.test.json | 2 +- 19 files changed, 64 insertions(+), 44 deletions(-) rename packages/cf/{ => test}/declarations.d.ts (100%) rename packages/rai/{ => test}/declarations.d.ts (100%) rename packages/server/{ => test}/declarations.d.ts (100%) diff --git a/package-lock.json b/package-lock.json index 319725f..0e59231 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "raiplayrss", + "name": "@raiplayrss/raiplayrss", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "raiplayrss", + "name": "@raiplayrss/raiplayrss", "version": "0.0.0", "license": "ISC", "workspaces": [ @@ -754,6 +754,18 @@ "xml2js": "^0.4.19" } }, + "node_modules/@raiplayrss/cf": { + "resolved": "packages/cf", + "link": true + }, + "node_modules/@raiplayrss/rai": { + "resolved": "packages/rai", + "link": true + }, + "node_modules/@raiplayrss/server": { + "resolved": "packages/server", + "link": true + }, "node_modules/@supercharge/promise-pool": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@supercharge/promise-pool/-/promise-pool-3.1.0.tgz", @@ -935,10 +947,6 @@ "tslib": "^2.2.0" } }, - "node_modules/cf": { - "resolved": "packages/cf", - "link": true - }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -6197,10 +6205,6 @@ "integrity": "sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==", "dev": true }, - "node_modules/rai": { - "resolved": "packages/rai", - "link": true - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -6297,10 +6301,6 @@ "node": ">=10" } }, - "node_modules/server": { - "resolved": "packages/server", - "link": true - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -7376,17 +7376,29 @@ } }, "packages/cf": { + "name": "@raiplayrss/cf", "version": "0.0.0", + "dependencies": { + "@raiplayrss/server": "*" + }, "devDependencies": { "@cloudflare/workers-types": "^4.20240129.0", "@podverse/podcast-feed-parser": "^1.1.1", + "@raiplayrss/rai": "*", "@types/node": "^20.11.10", "tsx": "^4.7.0", "typescript": "^5.3.3", "wrangler": "^3.25.0" } }, + "packages/cf/@raiplayrss/rai": { + "extraneous": true + }, + "packages/cf/@raiplayrss/server": { + "extraneous": true + }, "packages/rai": { + "name": "@raiplayrss/rai", "version": "0.0.0", "dependencies": { "@supercharge/promise-pool": "^3.1.0", @@ -7400,8 +7412,10 @@ } }, "packages/server": { + "name": "@raiplayrss/server", "version": "0.0.0", "dependencies": { + "@raiplayrss/rai": "*", "itty-router": "^4.0.27" }, "devDependencies": { @@ -7412,6 +7426,9 @@ "typescript": "^5.3.3" } }, + "packages/server/@raiplayrss/rai": { + "extraneous": true + }, "rai": { "version": "0.0.0", "extraneous": true, diff --git a/package.json b/package.json index ba0a3f5..59f621f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "raiplayrss", + "name": "@raiplayrss/raiplayrss", "version": "0.0.0", "description": "", "private": true, diff --git a/packages/cf/package.json b/packages/cf/package.json index c33d19d..6843490 100644 --- a/packages/cf/package.json +++ b/packages/cf/package.json @@ -1,5 +1,5 @@ { - "name": "cf", + "name": "@raiplayrss/cf", "version": "0.0.0", "description": "", "private": true, @@ -21,6 +21,10 @@ "@types/node": "^20.11.10", "tsx": "^4.7.0", "typescript": "^5.3.3", - "wrangler": "^3.25.0" + "wrangler": "^3.25.0", + "@raiplayrss/rai": "*" + }, + "dependencies": { + "@raiplayrss/server": "*" } } diff --git a/packages/cf/declarations.d.ts b/packages/cf/test/declarations.d.ts similarity index 100% rename from packages/cf/declarations.d.ts rename to packages/cf/test/declarations.d.ts diff --git a/packages/cf/tsconfig.json b/packages/cf/tsconfig.json index a491981..3e3c5c2 100644 --- a/packages/cf/tsconfig.json +++ b/packages/cf/tsconfig.json @@ -5,7 +5,5 @@ "types": ["@cloudflare/workers-types"] }, "include": ["*.ts"], - "exclude": ["*.test.ts", - "declarations.d.ts" - ] + "exclude": ["*.test.ts"] } diff --git a/packages/cf/tsconfig.test.json b/packages/cf/tsconfig.test.json index 5820e96..17f14f5 100644 --- a/packages/cf/tsconfig.test.json +++ b/packages/cf/tsconfig.test.json @@ -4,6 +4,6 @@ "compilerOptions": { "types": ["node"] }, - "include": ["*.test.ts", "declarations.d.ts"], + "include": ["*.test.ts", "test/*.ts"], "exclude": [] } diff --git a/packages/cf/worker.test.ts b/packages/cf/worker.test.ts index 41a743e..355ac30 100644 --- a/packages/cf/worker.test.ts +++ b/packages/cf/worker.test.ts @@ -2,11 +2,11 @@ import { strict as assert } from "node:assert"; import { Server, createServer } from "node:http"; import { test } from "node:test"; import { getPodcastFromFeed } from "@podverse/podcast-feed-parser"; +import genresJson from "@raiplayrss/rai/test/generi.json" with { type: "json" }; +import { assertItalian } from "@raiplayrss/server/test/headers.js"; import { createServerAdapter } from "@whatwg-node/server"; import { Router, RouterType, error, json } from "itty-router"; import { UnstableDevWorker, unstable_dev } from "wrangler"; -import genresJson from "../rai/test/generi.json" with { type: "json" }; -import { assertItalian } from "../server/test/headers.js"; import feedJson from "./test/lastoriaingiallo.json" with { type: "json" }; import expectedJson from "./test/lastoriaingiallo.parsed.json" with { type: "json", diff --git a/packages/rai/package.json b/packages/rai/package.json index 91d748e..571827a 100644 --- a/packages/rai/package.json +++ b/packages/rai/package.json @@ -1,5 +1,5 @@ { - "name": "rai", + "name": "@raiplayrss/rai", "version": "0.0.0", "description": "", "private": true, diff --git a/packages/rai/declarations.d.ts b/packages/rai/test/declarations.d.ts similarity index 100% rename from packages/rai/declarations.d.ts rename to packages/rai/test/declarations.d.ts diff --git a/packages/rai/tsconfig.json b/packages/rai/tsconfig.json index 96cc119..fd5c642 100644 --- a/packages/rai/tsconfig.json +++ b/packages/rai/tsconfig.json @@ -13,5 +13,5 @@ "types": [] }, "include": ["*.ts"], - "exclude": ["*.test.ts", "declarations.d.ts"] + "exclude": ["*.test.ts"] } diff --git a/packages/rai/tsconfig.test.json b/packages/rai/tsconfig.test.json index 5820e96..17f14f5 100644 --- a/packages/rai/tsconfig.test.json +++ b/packages/rai/tsconfig.test.json @@ -4,6 +4,6 @@ "compilerOptions": { "types": ["node"] }, - "include": ["*.test.ts", "declarations.d.ts"], + "include": ["*.test.ts", "test/*.ts"], "exclude": [] } diff --git a/packages/server/feed-handler.test.ts b/packages/server/feed-handler.test.ts index c7c731a..88d6892 100644 --- a/packages/server/feed-handler.test.ts +++ b/packages/server/feed-handler.test.ts @@ -1,12 +1,12 @@ import { strict as assert } from "node:assert"; import test from "node:test"; -import { json } from "itty-router"; -import { FetchWithErr, NotOk, OkResponse } from "../rai/fetch.js"; -import genresJson from "../rai/test/generi.json"; -import feedJson from "../rai/test/lastoriaingiallo.json"; -import expectedJson from "../rai/test/lastoriaingiallo.parsed.json" with { +import { FetchWithErr, NotOk, OkResponse } from "@raiplayrss/rai/fetch.js"; +import genresJson from "@raiplayrss/rai/test/generi.json"; +import feedJson from "@raiplayrss/rai/test/lastoriaingiallo.json"; +import expectedJson from "@raiplayrss/rai/test/lastoriaingiallo.parsed.json" with { type: "json", }; +import { json } from "itty-router"; import { parseFeed } from "../rai/test/parse-feed.js"; import { feedHandler } from "./feed-handler.js"; import * as logger from "./logger.js"; diff --git a/packages/server/feed-handler.ts b/packages/server/feed-handler.ts index 958d412..a8cc122 100644 --- a/packages/server/feed-handler.ts +++ b/packages/server/feed-handler.ts @@ -1,6 +1,6 @@ +import { feedToRss } from "@raiplayrss/rai/feed.js"; +import { FetchWithErr, NotOk } from "@raiplayrss/rai/fetch.js"; import { createResponse } from "itty-router"; -import { feedToRss } from "../rai/feed.js"; -import { FetchWithErr, NotOk } from "../rai/fetch.js"; import { Logger } from "./logger.js"; export { Config, feedHandler }; diff --git a/packages/server/handler.test.ts b/packages/server/handler.test.ts index ab5618b..52d8c1c 100644 --- a/packages/server/handler.test.ts +++ b/packages/server/handler.test.ts @@ -1,11 +1,11 @@ import { strict as assert } from "node:assert"; import test from "node:test"; -import { error, json } from "itty-router"; -import genresJson from "../rai/test/generi.json" with { type: "json" }; -import feedJson from "../rai/test/lastoriaingiallo.json"; -import expectedJson from "../rai/test/lastoriaingiallo.parsed.json" with { +import genresJson from "@raiplayrss/rai/test/generi.json" with { type: "json" }; +import feedJson from "@raiplayrss/rai/test/lastoriaingiallo.json"; +import expectedJson from "@raiplayrss/rai/test/lastoriaingiallo.parsed.json" with { type: "json", }; +import { error, json } from "itty-router"; import { parseFeed } from "../rai/test/parse-feed.js"; import { FetchHandler, mkFetchHandler } from "./handler.js"; import * as logger from "./logger.js"; diff --git a/packages/server/handler.ts b/packages/server/handler.ts index c5212cb..2d0097c 100644 --- a/packages/server/handler.ts +++ b/packages/server/handler.ts @@ -1,6 +1,6 @@ -import { Router, createResponse, error, html, text } from "itty-router"; -import { mkFetchWithErr } from "../rai/fetch.js"; -import { genresHtml } from "../rai/genres.js"; +import { mkFetchWithErr } from "@raiplayrss/rai/fetch.js"; +import { genresHtml } from "@raiplayrss/rai/genres.js"; +import { Router, error, html } from "itty-router"; import { feedHandler } from "./feed-handler.js"; import { Logger } from "./logger.js"; diff --git a/packages/server/package.json b/packages/server/package.json index e032564..6557eec 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,5 +1,5 @@ { - "name": "server", + "name": "@raiplayrss/server", "version": "0.0.0", "description": "", "private": true, @@ -20,6 +20,7 @@ "typescript": "^5.3.3" }, "dependencies": { - "itty-router": "^4.0.27" + "itty-router": "^4.0.27", + "@raiplayrss/rai": "*" } } diff --git a/packages/server/declarations.d.ts b/packages/server/test/declarations.d.ts similarity index 100% rename from packages/server/declarations.d.ts rename to packages/server/test/declarations.d.ts diff --git a/packages/server/tsconfig.json b/packages/server/tsconfig.json index 2bc7432..b697bd8 100644 --- a/packages/server/tsconfig.json +++ b/packages/server/tsconfig.json @@ -2,5 +2,5 @@ "$schema": "https://json.schemastore.org/tsconfig", "extends": "../rai/tsconfig.json", "include": ["*.ts"], - "exclude": ["*.test.ts", "declarations.d.ts"] + "exclude": ["*.test.ts"] } diff --git a/packages/server/tsconfig.test.json b/packages/server/tsconfig.test.json index 5820e96..17f14f5 100644 --- a/packages/server/tsconfig.test.json +++ b/packages/server/tsconfig.test.json @@ -4,6 +4,6 @@ "compilerOptions": { "types": ["node"] }, - "include": ["*.test.ts", "declarations.d.ts"], + "include": ["*.test.ts", "test/*.ts"], "exclude": [] }