From c6768d0e6c6097bc19bb712498e4f2338a873fc2 Mon Sep 17 00:00:00 2001 From: Matt Leon <108271225+wydengyre@users.noreply.github.com> Date: Tue, 30 Jan 2024 16:10:46 +0700 Subject: [PATCH] packages-dir (#61) packages dir --- .gitignore | 4 +- biome.json | 4 +- package-lock.json | 50 ++++++++++++++++--- package.json | 6 +-- {cf => packages/cf}/declarations.d.ts | 0 {cf => packages/cf}/package.json | 4 +- .../cf}/test/lastoriaingiallo.json | 0 .../cf}/test/lastoriaingiallo.parsed.json | 0 {cf => packages/cf}/test/lastoriaingiallo.xml | 0 {cf => packages/cf}/tsconfig.json | 4 +- {cf => packages/cf}/tsconfig.test.json | 0 {cf => packages/cf}/worker.test.ts | 0 {cf => packages/cf}/worker.ts | 0 {cf => packages/cf}/wrangler.toml | 0 {rai => packages/rai}/declarations.d.ts | 0 {rai => packages/rai}/feed.test.ts | 0 {rai => packages/rai}/feed.ts | 0 {rai => packages/rai}/fetch.ts | 0 {rai => packages/rai}/genres.test.ts | 0 {rai => packages/rai}/genres.ts | 0 {rai => packages/rai}/media.test.ts | 0 {rai => packages/rai}/media.ts | 0 {rai => packages/rai}/package.json | 0 {rai => packages/rai}/test/generi.json | 0 .../rai}/test/lastoriaingiallo.json | 0 .../rai}/test/lastoriaingiallo.parsed.json | 0 {rai => packages/rai}/test/parse-feed.ts | 0 {rai => packages/rai}/tsconfig.json | 0 {rai => packages/rai}/tsconfig.test.json | 0 {server => packages/server}/declarations.d.ts | 0 .../server}/feed-handler.test.ts | 0 {server => packages/server}/feed-handler.ts | 0 {server => packages/server}/handler.test.ts | 0 {server => packages/server}/handler.ts | 0 {server => packages/server}/logger.ts | 0 {server => packages/server}/package.json | 0 {server => packages/server}/test/headers.ts | 0 {server => packages/server}/tsconfig.json | 0 .../server}/tsconfig.test.json | 0 39 files changed, 56 insertions(+), 16 deletions(-) rename {cf => packages/cf}/declarations.d.ts (100%) rename {cf => packages/cf}/package.json (79%) rename {cf => packages/cf}/test/lastoriaingiallo.json (100%) rename {cf => packages/cf}/test/lastoriaingiallo.parsed.json (100%) rename {cf => packages/cf}/test/lastoriaingiallo.xml (100%) rename {cf => packages/cf}/tsconfig.json (78%) rename {cf => packages/cf}/tsconfig.test.json (100%) rename {cf => packages/cf}/worker.test.ts (100%) rename {cf => packages/cf}/worker.ts (100%) rename {cf => packages/cf}/wrangler.toml (100%) rename {rai => packages/rai}/declarations.d.ts (100%) rename {rai => packages/rai}/feed.test.ts (100%) rename {rai => packages/rai}/feed.ts (100%) rename {rai => packages/rai}/fetch.ts (100%) rename {rai => packages/rai}/genres.test.ts (100%) rename {rai => packages/rai}/genres.ts (100%) rename {rai => packages/rai}/media.test.ts (100%) rename {rai => packages/rai}/media.ts (100%) rename {rai => packages/rai}/package.json (100%) rename {rai => packages/rai}/test/generi.json (100%) rename {rai => packages/rai}/test/lastoriaingiallo.json (100%) rename {rai => packages/rai}/test/lastoriaingiallo.parsed.json (100%) rename {rai => packages/rai}/test/parse-feed.ts (100%) rename {rai => packages/rai}/tsconfig.json (100%) rename {rai => packages/rai}/tsconfig.test.json (100%) rename {server => packages/server}/declarations.d.ts (100%) rename {server => packages/server}/feed-handler.test.ts (100%) rename {server => packages/server}/feed-handler.ts (100%) rename {server => packages/server}/handler.test.ts (100%) rename {server => packages/server}/handler.ts (100%) rename {server => packages/server}/logger.ts (100%) rename {server => packages/server}/package.json (100%) rename {server => packages/server}/test/headers.ts (100%) rename {server => packages/server}/tsconfig.json (100%) rename {server => packages/server}/tsconfig.test.json (100%) diff --git a/.gitignore b/.gitignore index 6a06e69..0a16dd8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .idea *.iml node_modules -cf/.wrangler -cf/dist +packages/cf/.wrangler +packages/cf/dist diff --git a/biome.json b/biome.json index a45b0fd..c676431 100644 --- a/biome.json +++ b/biome.json @@ -10,7 +10,7 @@ } }, "files": { - "include": ["*.json", "rai/**/*.ts", "rai/**/*.json", "server/**/*.ts", "server/**/*.json", "cf/**/*.ts", "cf/**/*.json"], - "ignore": ["cf/.wrangler"] + "include": ["*.json", "packages/**/*.ts", "packages/**/*.json"], + "ignore": ["packages/cf/.wrangler"] } } diff --git a/package-lock.json b/package-lock.json index 6094980..319725f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,7 @@ "version": "0.0.0", "license": "ISC", "workspaces": [ - "./rai", - "./server", - "./cf" + "packages/*" ], "devDependencies": { "@biomejs/biome": "1.5.3" @@ -19,6 +17,7 @@ }, "cf": { "version": "0.0.0", + "extraneous": true, "devDependencies": { "@cloudflare/workers-types": "^4.20240129.0", "@podverse/podcast-feed-parser": "^1.1.1", @@ -937,7 +936,7 @@ } }, "node_modules/cf": { - "resolved": "cf", + "resolved": "packages/cf", "link": true }, "node_modules/chokidar": { @@ -6199,7 +6198,7 @@ "dev": true }, "node_modules/rai": { - "resolved": "rai", + "resolved": "packages/rai", "link": true }, "node_modules/readdirp": { @@ -6299,7 +6298,7 @@ } }, "node_modules/server": { - "resolved": "server", + "resolved": "packages/server", "link": true }, "node_modules/source-map": { @@ -7376,8 +7375,46 @@ "url": "https://github.com/sponsors/colinhacks" } }, + "packages/cf": { + "version": "0.0.0", + "devDependencies": { + "@cloudflare/workers-types": "^4.20240129.0", + "@podverse/podcast-feed-parser": "^1.1.1", + "@types/node": "^20.11.10", + "tsx": "^4.7.0", + "typescript": "^5.3.3", + "wrangler": "^3.25.0" + } + }, + "packages/rai": { + "version": "0.0.0", + "dependencies": { + "@supercharge/promise-pool": "^3.1.0", + "zod": "^3.22.4" + }, + "devDependencies": { + "@podverse/podcast-feed-parser": "^1.1.1", + "@types/node": "^20.11.10", + "tsx": "^4.7.0", + "typescript": "^5.3.3" + } + }, + "packages/server": { + "version": "0.0.0", + "dependencies": { + "itty-router": "^4.0.27" + }, + "devDependencies": { + "@podverse/podcast-feed-parser": "^1.1.1", + "@types/node": "^20.11.10", + "@whatwg-node/server": "^0.9.24", + "tsx": "^4.7.0", + "typescript": "^5.3.3" + } + }, "rai": { "version": "0.0.0", + "extraneous": true, "dependencies": { "@supercharge/promise-pool": "^3.1.0", "zod": "^3.22.4" @@ -7391,6 +7428,7 @@ }, "server": { "version": "0.0.0", + "extraneous": true, "dependencies": { "itty-router": "^4.0.27" }, diff --git a/package.json b/package.json index 8c23f7f..ba0a3f5 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "0.0.0", "description": "", "private": true, - "workspaces": ["./rai", "./server", "./cf"], + "workspaces": ["packages/*"], "scripts": { - "ci-lint": "biome ci rai server cf", - "lint": "biome check --apply rai server cf" + "ci-lint": "biome ci .", + "lint": "biome check --apply ." }, "author": "", "license": "ISC", diff --git a/cf/declarations.d.ts b/packages/cf/declarations.d.ts similarity index 100% rename from cf/declarations.d.ts rename to packages/cf/declarations.d.ts diff --git a/cf/package.json b/packages/cf/package.json similarity index 79% rename from cf/package.json rename to packages/cf/package.json index 367a486..c33d19d 100644 --- a/cf/package.json +++ b/packages/cf/package.json @@ -7,8 +7,8 @@ "deploy": "wrangler --env prod deploy", "deploy-preview": "wrangler deploy --dry-run --outdir dist", - "test": "tsx --tsconfig ./tsconfig.json --test '**/*.test.ts'", - "test-only": "tsx --tsconfig ./tsconfig.json --test --test-only '**/*.test.ts'", + "test": "tsx --tsconfig tsconfig.json --test '**/*.test.ts'", + "test-only": "tsx --tsconfig tsconfig.json --test --test-only '**/*.test.ts'", "typecheck": "npm run typecheck-prod && npm run typecheck-test", "typecheck-prod": "tsc", diff --git a/cf/test/lastoriaingiallo.json b/packages/cf/test/lastoriaingiallo.json similarity index 100% rename from cf/test/lastoriaingiallo.json rename to packages/cf/test/lastoriaingiallo.json diff --git a/cf/test/lastoriaingiallo.parsed.json b/packages/cf/test/lastoriaingiallo.parsed.json similarity index 100% rename from cf/test/lastoriaingiallo.parsed.json rename to packages/cf/test/lastoriaingiallo.parsed.json diff --git a/cf/test/lastoriaingiallo.xml b/packages/cf/test/lastoriaingiallo.xml similarity index 100% rename from cf/test/lastoriaingiallo.xml rename to packages/cf/test/lastoriaingiallo.xml diff --git a/cf/tsconfig.json b/packages/cf/tsconfig.json similarity index 78% rename from cf/tsconfig.json rename to packages/cf/tsconfig.json index ca0f9ae..a491981 100644 --- a/cf/tsconfig.json +++ b/packages/cf/tsconfig.json @@ -5,5 +5,7 @@ "types": ["@cloudflare/workers-types"] }, "include": ["*.ts"], - "exclude": ["*.test.ts", "declarations.d.ts"] + "exclude": ["*.test.ts", + "declarations.d.ts" + ] } diff --git a/cf/tsconfig.test.json b/packages/cf/tsconfig.test.json similarity index 100% rename from cf/tsconfig.test.json rename to packages/cf/tsconfig.test.json diff --git a/cf/worker.test.ts b/packages/cf/worker.test.ts similarity index 100% rename from cf/worker.test.ts rename to packages/cf/worker.test.ts diff --git a/cf/worker.ts b/packages/cf/worker.ts similarity index 100% rename from cf/worker.ts rename to packages/cf/worker.ts diff --git a/cf/wrangler.toml b/packages/cf/wrangler.toml similarity index 100% rename from cf/wrangler.toml rename to packages/cf/wrangler.toml diff --git a/rai/declarations.d.ts b/packages/rai/declarations.d.ts similarity index 100% rename from rai/declarations.d.ts rename to packages/rai/declarations.d.ts diff --git a/rai/feed.test.ts b/packages/rai/feed.test.ts similarity index 100% rename from rai/feed.test.ts rename to packages/rai/feed.test.ts diff --git a/rai/feed.ts b/packages/rai/feed.ts similarity index 100% rename from rai/feed.ts rename to packages/rai/feed.ts diff --git a/rai/fetch.ts b/packages/rai/fetch.ts similarity index 100% rename from rai/fetch.ts rename to packages/rai/fetch.ts diff --git a/rai/genres.test.ts b/packages/rai/genres.test.ts similarity index 100% rename from rai/genres.test.ts rename to packages/rai/genres.test.ts diff --git a/rai/genres.ts b/packages/rai/genres.ts similarity index 100% rename from rai/genres.ts rename to packages/rai/genres.ts diff --git a/rai/media.test.ts b/packages/rai/media.test.ts similarity index 100% rename from rai/media.test.ts rename to packages/rai/media.test.ts diff --git a/rai/media.ts b/packages/rai/media.ts similarity index 100% rename from rai/media.ts rename to packages/rai/media.ts diff --git a/rai/package.json b/packages/rai/package.json similarity index 100% rename from rai/package.json rename to packages/rai/package.json diff --git a/rai/test/generi.json b/packages/rai/test/generi.json similarity index 100% rename from rai/test/generi.json rename to packages/rai/test/generi.json diff --git a/rai/test/lastoriaingiallo.json b/packages/rai/test/lastoriaingiallo.json similarity index 100% rename from rai/test/lastoriaingiallo.json rename to packages/rai/test/lastoriaingiallo.json diff --git a/rai/test/lastoriaingiallo.parsed.json b/packages/rai/test/lastoriaingiallo.parsed.json similarity index 100% rename from rai/test/lastoriaingiallo.parsed.json rename to packages/rai/test/lastoriaingiallo.parsed.json diff --git a/rai/test/parse-feed.ts b/packages/rai/test/parse-feed.ts similarity index 100% rename from rai/test/parse-feed.ts rename to packages/rai/test/parse-feed.ts diff --git a/rai/tsconfig.json b/packages/rai/tsconfig.json similarity index 100% rename from rai/tsconfig.json rename to packages/rai/tsconfig.json diff --git a/rai/tsconfig.test.json b/packages/rai/tsconfig.test.json similarity index 100% rename from rai/tsconfig.test.json rename to packages/rai/tsconfig.test.json diff --git a/server/declarations.d.ts b/packages/server/declarations.d.ts similarity index 100% rename from server/declarations.d.ts rename to packages/server/declarations.d.ts diff --git a/server/feed-handler.test.ts b/packages/server/feed-handler.test.ts similarity index 100% rename from server/feed-handler.test.ts rename to packages/server/feed-handler.test.ts diff --git a/server/feed-handler.ts b/packages/server/feed-handler.ts similarity index 100% rename from server/feed-handler.ts rename to packages/server/feed-handler.ts diff --git a/server/handler.test.ts b/packages/server/handler.test.ts similarity index 100% rename from server/handler.test.ts rename to packages/server/handler.test.ts diff --git a/server/handler.ts b/packages/server/handler.ts similarity index 100% rename from server/handler.ts rename to packages/server/handler.ts diff --git a/server/logger.ts b/packages/server/logger.ts similarity index 100% rename from server/logger.ts rename to packages/server/logger.ts diff --git a/server/package.json b/packages/server/package.json similarity index 100% rename from server/package.json rename to packages/server/package.json diff --git a/server/test/headers.ts b/packages/server/test/headers.ts similarity index 100% rename from server/test/headers.ts rename to packages/server/test/headers.ts diff --git a/server/tsconfig.json b/packages/server/tsconfig.json similarity index 100% rename from server/tsconfig.json rename to packages/server/tsconfig.json diff --git a/server/tsconfig.test.json b/packages/server/tsconfig.test.json similarity index 100% rename from server/tsconfig.test.json rename to packages/server/tsconfig.test.json