Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
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
|
50
package-lock.json
generated
50
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "morning-report",
|
"name": "morning-report",
|
||||||
"version": "0.0.1",
|
"version": "0.0.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "morning-report",
|
"name": "morning-report",
|
||||||
"version": "0.0.1",
|
"version": "0.0.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"json5": "2.2.3",
|
"json5": "2.2.3",
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
"morning-report": "distribution/src/index.js"
|
"morning-report": "distribution/src/index.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "24.3.0",
|
"@types/node": "24.7.2",
|
||||||
"@vitest/coverage-v8": "3.2.4",
|
"@vitest/coverage-v8": "3.2.4",
|
||||||
"typescript": "5.9.2",
|
"typescript": "5.9.3",
|
||||||
"vitest": "3.2.4"
|
"vitest": "3.2.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -921,13 +921,14 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "24.3.0",
|
"version": "24.7.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.7.2.tgz",
|
||||||
"integrity": "sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==",
|
"integrity": "sha512-/NbVmcGTP+lj5oa4yiYxxeBjRivKQ5Ns1eSZeB99ExsEQ6rX5XYU1Zy/gGxY/ilqtD4Etx9mKyrPxZRetiahhA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~7.10.0"
|
"undici-types": "~7.14.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vitest/coverage-v8": {
|
"node_modules/@vitest/coverage-v8": {
|
||||||
@@ -1695,6 +1696,7 @@
|
|||||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
@@ -2011,14 +2013,14 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/tinyglobby": {
|
"node_modules/tinyglobby": {
|
||||||
"version": "0.2.14",
|
"version": "0.2.15",
|
||||||
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz",
|
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",
|
||||||
"integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==",
|
"integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fdir": "^6.4.4",
|
"fdir": "^6.5.0",
|
||||||
"picomatch": "^4.0.2"
|
"picomatch": "^4.0.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.0.0"
|
"node": ">=12.0.0"
|
||||||
@@ -2058,9 +2060,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.9.2",
|
"version": "5.9.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||||
"integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
|
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -2072,25 +2074,26 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
"version": "7.10.0",
|
"version": "7.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.14.0.tgz",
|
||||||
"integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==",
|
"integrity": "sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "7.1.3",
|
"version": "7.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/vite/-/vite-7.1.5.tgz",
|
||||||
"integrity": "sha512-OOUi5zjkDxYrKhTV3V7iKsoS37VUM7v40+HuwEmcrsf11Cdx9y3DIr2Px6liIcZFwt3XSRpQvFpL3WVy7ApkGw==",
|
"integrity": "sha512-4cKBO9wR75r0BeIWWWId9XK9Lj6La5X846Zw9dFfzMRw38IlTk2iCcUt6hsyiDRcPidc55ZParFYDXi0nXOeLQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.25.0",
|
"esbuild": "^0.25.0",
|
||||||
"fdir": "^6.5.0",
|
"fdir": "^6.5.0",
|
||||||
"picomatch": "^4.0.3",
|
"picomatch": "^4.0.3",
|
||||||
"postcss": "^8.5.6",
|
"postcss": "^8.5.6",
|
||||||
"rollup": "^4.43.0",
|
"rollup": "^4.43.0",
|
||||||
"tinyglobby": "^0.2.14"
|
"tinyglobby": "^0.2.15"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"vite": "bin/vite.js"
|
"vite": "bin/vite.js"
|
||||||
@@ -2182,6 +2185,7 @@
|
|||||||
"integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==",
|
"integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/chai": "^5.2.2",
|
"@types/chai": "^5.2.2",
|
||||||
"@vitest/expect": "3.2.4",
|
"@vitest/expect": "3.2.4",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "morning-report",
|
"name": "morning-report",
|
||||||
"version": "0.0.1",
|
"version": "0.0.3",
|
||||||
"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.7.2",
|
||||||
"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