Skip to content

Commit

Permalink
workspaces (#60)
Browse files Browse the repository at this point in the history
use npm workspaces and just
  • Loading branch information
wydengyre authored Jan 30, 2024
1 parent 71f0d16 commit d948772
Showing 10 changed files with 156 additions and 389 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,10 @@ jobs:
with:
node-version-file: '.node-version'
cache: 'npm'
- uses: extractions/setup-just@69d82fb0233557aec017ef13706851d0694e0f1d # v1.6.0
with:
just-version: 1.23.0
- name: Install npm dependencies
run: npm ci
- name: Build and test
run: npm run ci
run: just ci
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.idea
*.iml
node_modules
dist
cf/.wrangler
cf/dist
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
}
},
"files": {
"include": ["rai/**/*.ts", "rai/**/*.json", "server/**/*.ts", "server/**/*.json", "cf/**/*.ts", "cf/**/*.json"],
"include": ["*.json", "rai/**/*.ts", "rai/**/*.json", "server/**/*.ts", "server/**/*.json", "cf/**/*.ts", "cf/**/*.json"],
"ignore": ["cf/.wrangler"]
}
}
26 changes: 26 additions & 0 deletions cf/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "cf",
"version": "0.0.0",
"description": "",
"private": true,
"scripts": {
"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'",

"typecheck": "npm run typecheck-prod && npm run typecheck-test",
"typecheck-prod": "tsc",
"typecheck-test": "tsc --project tsconfig.test.json"
},
"type": "module",
"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"
}
}
3 changes: 1 addition & 2 deletions cf/worker.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { strict as assert } from "node:assert";
import { writeFile } from "node:fs/promises";
import { Server, createServer } from "node:http";
import { test } from "node:test";
import { getPodcastFromFeed } from "@podverse/podcast-feed-parser";
@@ -187,7 +186,7 @@ class Servers {
};

const experimental = { disableExperimentalWarning: true };
const worker = await unstable_dev("cf/worker.ts", {
const worker = await unstable_dev("worker.ts", {
// uncomment for help debugging
// logLevel,
experimental,
22 changes: 22 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env just --justfile

default:
just --list --justfile {{justfile()}}

check: lint typecheck

ci: ci-check test

ci-check: ci-lint typecheck

ci-lint:
npm run ci-lint

lint:
npm run lint

test:
npm test --workspaces

typecheck:
npm run typecheck --workspaces
Loading

0 comments on commit d948772

Please sign in to comment.