Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aa03c83407 | |||
| ed3f97f17a | |||
| 3a78d49974 | |||
| 0d53a6ccde | |||
| 6ecc03a670 | |||
| 3f0121a9ff | |||
| 021f714b06 | |||
| b0e4a10b3e | |||
| 12862b4f85 | |||
| 16d5e834a5 |
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@@ -14,6 +14,13 @@ jobs:
|
|||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
nodever:
|
||||||
|
[
|
||||||
|
'latest',
|
||||||
|
'lts/*',
|
||||||
|
'lts/hydrogen'
|
||||||
|
]
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
@@ -23,6 +30,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup nodejs
|
- name: Setup nodejs
|
||||||
uses: https://github.com/actions/setup-node@v4
|
uses: https://github.com/actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "${{ matrix.nodever }}"
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -103,3 +103,5 @@ config/config.json5
|
|||||||
distribution/
|
distribution/
|
||||||
.env
|
.env
|
||||||
test/*.js*
|
test/*.js*
|
||||||
|
output.wav
|
||||||
|
output.mp3
|
||||||
|
|||||||
18
.tangled/workflows/audit.yml
Normal file
18
.tangled/workflows/audit.yml
Normal 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
|
||||||
24
.tangled/workflows/test.yml
Normal file
24
.tangled/workflows/test.yml
Normal 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
551
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "morning-report",
|
"name": "morning-report",
|
||||||
"version": "0.0.1",
|
"version": "0.0.5",
|
||||||
"description": "Procedurally generates a radio weather report",
|
"description": "Procedurally generates a radio weather report",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"weather",
|
"weather",
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
"openweather-api-node": "3.1.5"
|
"openweather-api-node": "3.1.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "5.9.2",
|
"typescript": "5.9.3",
|
||||||
"@types/node": "24.3.0",
|
"@types/node": "24.10.1",
|
||||||
"vitest": "3.2.4",
|
"vitest": "3.2.4",
|
||||||
"@vitest/coverage-v8": "3.2.4"
|
"@vitest/coverage-v8": "3.2.4"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { OpenWeatherAPI, type DailyWeather } from 'openweather-api-node';
|
|||||||
import { voiceLines } from './voice.js';
|
import { voiceLines } from './voice.js';
|
||||||
import type { Config } from './index.js';
|
import type { Config } from './index.js';
|
||||||
import type { Voice } from './voice.js';
|
import type { Voice } from './voice.js';
|
||||||
|
import crypto from 'crypto';
|
||||||
|
|
||||||
type SegmentName = string;
|
type SegmentName = string;
|
||||||
type SequenceName = string;
|
type SequenceName = string;
|
||||||
@@ -16,7 +17,7 @@ type Sequences = { [sequence: SequenceName]: Sequence };
|
|||||||
let config: Config = null;
|
let config: Config = null;
|
||||||
|
|
||||||
function selectOne<T>(arr: T[]): T {
|
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) {
|
function resolveSide(side: string, currentWeather: DailyWeather) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ async function Stitcher(files: string[]) {
|
|||||||
const args: string[] = [];
|
const args: string[] = [];
|
||||||
files.forEach(f => args.push('-i', f));
|
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('-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);
|
await ffmpeg(args, files.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { describe, expect, it, vi } from 'vitest';
|
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 { Sequencer } from '../src/sequencer.js';
|
||||||
import type { Config } from '../src/index.js';
|
|
||||||
|
|
||||||
const dummyWeather: Options = { key: 'dummy' };
|
const dummyWeather: Options = { key: 'dummy' };
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ describe('stitcher', () => {
|
|||||||
'2',
|
'2',
|
||||||
'-c:a',
|
'-c:a',
|
||||||
'pcm_s16le',
|
'pcm_s16le',
|
||||||
'output.wav'
|
'output.wav',
|
||||||
|
'-y'
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -62,7 +63,8 @@ describe('stitcher', () => {
|
|||||||
'2',
|
'2',
|
||||||
'-c:a',
|
'-c:a',
|
||||||
'pcm_s16le',
|
'pcm_s16le',
|
||||||
'output.wav'
|
'output.wav',
|
||||||
|
'-y'
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -81,7 +83,8 @@ describe('stitcher', () => {
|
|||||||
'2',
|
'2',
|
||||||
'-c:a',
|
'-c:a',
|
||||||
'pcm_s16le',
|
'pcm_s16le',
|
||||||
'output.wav'
|
'output.wav',
|
||||||
|
'-y'
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user