Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: CI

on:
push:
branches: ['main']
pull_request:
branches: ['main']

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7.0.0
- name: Install Node.js
uses: actions/setup-node@v6.4.0
with:
node-version: 22.20.0
- name: Install Dependencies
run: npm install --no-fund
- parallel:
- name: Typecheck
run: npm run test:types
- name: Lint
run: npm run lint
- name: Unit Test
run: npm run test:unit
- name: Build
run: npm run build
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
"type": "module",
"scripts": {
"build": "vite build",
"deploy": "npm run type-check && npm run lint && devvit upload",
"deploy": "npm run test:types && npm run lint && devvit upload",
"dev": "devvit playtest",
"launch": "npm run deploy && devvit publish",
"lint": "eslint 'src/**/*.{ts,tsx}'",
"login": "devvit login",
"prettier": "prettier --write .",
"type-check": "tsc --build"
"test:types": "tsc --build",
"test:unit": "node --experimental-strip-types --no-warnings=ExperimentalWarning --test \"src/**/*.test.ts\""
},
"engines": {
"node": ">=22.2.0"
"node": ">=22.12.0"
},
"dependencies": {
"@devvit/start": "0.13.10",
Expand All @@ -30,7 +31,7 @@
"eslint": "10.8.0",
"globals": "17.8.0",
"prettier": "3.9.6",
"typescript": "7.0.2",
"typescript": "6.0.3",
"typescript-eslint": "8.65.0",
"vite": "8.1.5"
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/nuke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function* getAllCommentsInPost(

export async function handleNukePost(props: NukePostProps) {
const startTime = Date.now();
let success = true;
let success: boolean;
let message: string;

const shouldLock = props.lock;
Expand Down Expand Up @@ -133,7 +133,7 @@ export async function handleNukePost(props: NukePostProps) {

export async function handleNuke(props: NukeProps) {
const startTime = Date.now();
let success = true;
let success: boolean;
let message: string;

const shouldLock = props.lock;
Expand Down