10 Commits

Author SHA1 Message Date
aa03c83407 bump deps
All checks were successful
Unit tests / Unit tests (lts/hydrogen) (push) Successful in -1m52s
NPM Audit Check / Check NPM audit (push) Successful in -2m8s
Unit tests / Unit tests (latest) (push) Successful in -1m42s
Unit tests / Unit tests (lts/*) (push) Successful in -1m54s
2025-12-01 19:41:45 -05:00
ed3f97f17a patch vite vulnerability that only affects windoze
Some checks failed
Unit tests / Unit tests (latest) (push) Successful in -1m46s
Unit tests / Unit tests (lts/*) (push) Successful in -1m48s
Unit tests / Unit tests (lts/hydrogen) (push) Successful in -1m56s
NPM Audit Check / Check NPM audit (push) Failing after -2m8s
2025-10-27 23:15:00 -05:00
3a78d49974 bump dependencies
Some checks failed
Unit tests / Unit tests (lts/*) (push) Successful in -1m48s
Unit tests / Unit tests (lts/hydrogen) (push) Successful in -1m56s
Unit tests / Unit tests (latest) (push) Successful in -1m44s
NPM Audit Check / Check NPM audit (push) Failing after -2m10s
2025-10-15 00:25:50 -05:00
0d53a6ccde replace Math.random() with crypto.randomInt() 2025-10-15 00:24:59 -05:00
6ecc03a670 bump vite version (dev dependency)
All checks were successful
Unit tests / Unit tests (latest) (push) Successful in -2m4s
Unit tests / Unit tests (lts/*) (push) Successful in -2m4s
Unit tests / Unit tests (lts/hydrogen) (push) Successful in -2m3s
NPM Audit Check / Check NPM audit (push) Successful in -2m11s
2025-09-09 17:50:56 -05:00
3f0121a9ff mirror actions to tangled
All checks were successful
Unit tests / Unit tests (latest) (push) Successful in -2m3s
Unit tests / Unit tests (lts/*) (push) Successful in -2m4s
Unit tests / Unit tests (lts/hydrogen) (push) Successful in -2m4s
NPM Audit Check / Check NPM audit (push) Successful in -2m17s
2025-09-02 21:06:16 -05:00
021f714b06 add lts/hydrogen to test env
All checks were successful
NPM Audit Check / Check NPM audit (push) Successful in -2m17s
Unit tests / Unit tests (latest) (push) Successful in -2m5s
Unit tests / Unit tests (lts/*) (push) Successful in -2m5s
Unit tests / Unit tests (lts/hydrogen) (push) Successful in -1m59s
2025-09-02 20:59:17 -05:00
b0e4a10b3e node version matrix
All checks were successful
NPM Audit Check / Check NPM audit (push) Successful in -2m17s
Unit tests / Unit tests (latest) (push) Successful in -1m57s
Unit tests / Unit tests (lts/*) (push) Successful in -1m59s
2025-09-02 00:21:14 -05:00
12862b4f85 no output files pls
All checks were successful
NPM Audit Check / Check NPM audit (push) Successful in -2m17s
Unit tests / Unit tests (push) Successful in -2m5s
2025-08-31 12:33:30 -05:00
16d5e834a5 overwrite
All checks were successful
NPM Audit Check / Check NPM audit (push) Successful in -2m18s
Unit tests / Unit tests (push) Successful in -2m6s
2025-08-30 11:28:18 -05:00
10 changed files with 358 additions and 270 deletions

View File

@@ -14,6 +14,13 @@ jobs:
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
nodever:
[
'latest',
'lts/*',
'lts/hydrogen'
]
permissions:
contents: read
@@ -23,6 +30,9 @@ jobs:
- name: Setup nodejs
uses: https://github.com/actions/setup-node@v4
with:
node-version: "${{ matrix.nodever }}"
check-latest: true
- name: Install dependencies
run: npm ci

2
.gitignore vendored
View File

@@ -103,3 +103,5 @@ config/config.json5
distribution/
.env
test/*.js*
output.wav
output.mp3

View File

@@ -0,0 +1,18 @@
when:
- event: ["push"]
branch: ["master"]
engine: "nixery"
dependencies:
nixpkgs:
- nodejs
steps:
- name: "NPM Audit"
command: "npm audit"
clone:
skip: false
depth: 3
submodules: false

View File

@@ -0,0 +1,24 @@
when:
- event: ["push"]
branch: ["master"]
engine: "nixery"
dependencies:
nixpkgs:
- nodejs
steps:
- name: "Install dependencies"
command: "npm ci"
- name: "tsc"
command: "npm run build && echo 'done.'"
- name: "tests"
command: "npm test"
clone:
skip: false
depth: 3
submodules: false

551
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "morning-report",
"version": "0.0.1",
"version": "0.0.5",
"description": "Procedurally generates a radio weather report",
"keywords": [
"weather",
@@ -35,8 +35,8 @@
"openweather-api-node": "3.1.5"
},
"devDependencies": {
"typescript": "5.9.2",
"@types/node": "24.3.0",
"typescript": "5.9.3",
"@types/node": "24.10.1",
"vitest": "3.2.4",
"@vitest/coverage-v8": "3.2.4"
}

View File

@@ -2,6 +2,7 @@ import { OpenWeatherAPI, type DailyWeather } from 'openweather-api-node';
import { voiceLines } from './voice.js';
import type { Config } from './index.js';
import type { Voice } from './voice.js';
import crypto from 'crypto';
type SegmentName = string;
type SequenceName = string;
@@ -16,7 +17,7 @@ type Sequences = { [sequence: SequenceName]: Sequence };
let config: Config = null;
function selectOne<T>(arr: T[]): T {
return arr[Math.floor(Math.random() * arr.length)];
return arr[crypto.randomInt(0, arr.length)];
}
function resolveSide(side: string, currentWeather: DailyWeather) {

View File

@@ -26,7 +26,7 @@ async function Stitcher(files: string[]) {
const args: string[] = [];
files.forEach(f => args.push('-i', f));
args.push('-filter_complex', `[0:a][1:a][2:a]concat=n=${files.length}:v=0:a=1[out]`);
args.push('-map', '[out]', '-ar', '44100', '-ac', '2', '-c:a', 'pcm_s16le', 'output.wav');
args.push('-map', '[out]', '-ar', '44100', '-ac', '2', '-c:a', 'pcm_s16le', 'output.wav', '-y');
await ffmpeg(args, files.length);
}

View File

@@ -1,7 +1,6 @@
import { describe, expect, it, vi } from 'vitest';
import { type CurrentWeather, type Options } from 'openweather-api-node';
import { type Options } from 'openweather-api-node';
import { Sequencer } from '../src/sequencer.js';
import type { Config } from '../src/index.js';
const dummyWeather: Options = { key: 'dummy' };

View File

@@ -41,7 +41,8 @@ describe('stitcher', () => {
'2',
'-c:a',
'pcm_s16le',
'output.wav'
'output.wav',
'-y'
]);
});
@@ -62,7 +63,8 @@ describe('stitcher', () => {
'2',
'-c:a',
'pcm_s16le',
'output.wav'
'output.wav',
'-y'
]);
});
@@ -81,7 +83,8 @@ describe('stitcher', () => {
'2',
'-c:a',
'pcm_s16le',
'output.wav'
'output.wav',
'-y'
]);
});
});