Fix npm jank

This commit is contained in:
Calvin Montgomery 2020-10-23 11:51:59 -07:00
parent 801e54afa2
commit 3f9a0aaf05
9 changed files with 24 additions and 18 deletions

View File

@ -9,5 +9,6 @@ addons:
env: env:
- CXX="g++-4.8" - CXX="g++-4.8"
node_js: node_js:
- "15"
- "14" - "14"
- "12" - "12"

View File

@ -2,10 +2,10 @@
const ver = process.version.match(/v(\d+)\.\d+\.\d+/); const ver = process.version.match(/v(\d+)\.\d+\.\d+/);
if (parseInt(ver[1], 10) < 10) { if (parseInt(ver[1], 10) < 12) {
console.error( console.error(
`node.js ${process.version} is not supported. ` + `node.js ${process.version} is not supported. ` +
'CyTube requires node v10 or later.' 'CyTube requires node v12 or later.'
) )
process.exit(1); process.exit(1);
} }

View File

@ -10,6 +10,7 @@
"dependencies": { "dependencies": {
"@calzoneman/express-babel-decorators": "^1.0.0", "@calzoneman/express-babel-decorators": "^1.0.0",
"@calzoneman/jsli": "^2.0.1", "@calzoneman/jsli": "^2.0.1",
"@cytube/mediaquery": "0.0.24",
"bcrypt": "^5.0.0", "bcrypt": "^5.0.0",
"bluebird": "^3.5.1", "bluebird": "^3.5.1",
"body-parser": "^1.18.2", "body-parser": "^1.18.2",
@ -19,8 +20,7 @@
"cookie-parser": "^1.4.0", "cookie-parser": "^1.4.0",
"create-error": "^0.3.1", "create-error": "^0.3.1",
"csrf": "^3.0.0", "csrf": "^3.0.0",
"cytube-mediaquery": "git://github.com/CyTube/mediaquery", "cytubefilters": "github:calzoneman/cytubefilters#b8b515fb749a38a830d3439c59363a62b35a180c",
"cytubefilters": "git://github.com/calzoneman/cytubefilters.git#c6df180eeb226eaffc7909cf047d3667dc58ef67",
"express": "^4.16.2", "express": "^4.16.2",
"express-minify": "^1.0.0", "express-minify": "^1.0.0",
"graceful-fs": "^4.1.2", "graceful-fs": "^4.1.2",

View File

@ -2,8 +2,13 @@
set -e set -e
if ! command -v npm >/dev/null; then
echo "Could not find npm in \$PATH"
exit 1
fi
echo "Building from src/ to lib/" echo "Building from src/ to lib/"
$npm_package_scripts_build_server npm run build-server
echo "Building from player/ to www/js/player.js" echo "Building from player/ to www/js/player.js"
$npm_package_scripts_build_player npm run build-player
echo "Done" echo "Done"

View File

@ -1,4 +1,4 @@
var Vimeo = require("cytube-mediaquery/lib/provider/vimeo"); var Vimeo = require("@cytube/mediaquery/lib/provider/vimeo");
var ChannelModule = require("./module"); var ChannelModule = require("./module");
var Config = require("../config"); var Config = require("../config");

View File

@ -401,7 +401,7 @@ function preprocessConfig(cfg) {
} }
if (cfg["youtube-v3-key"]) { if (cfg["youtube-v3-key"]) {
require("cytube-mediaquery/lib/provider/youtube").setApiKey( require("@cytube/mediaquery/lib/provider/youtube").setApiKey(
cfg["youtube-v3-key"]); cfg["youtube-v3-key"]);
} else { } else {
LOGGER.warn("No YouTube v3 API key set. YouTube links will " + LOGGER.warn("No YouTube v3 API key set. YouTube links will " +
@ -411,9 +411,9 @@ function preprocessConfig(cfg) {
} }
if (cfg["twitch-client-id"]) { if (cfg["twitch-client-id"]) {
require("cytube-mediaquery/lib/provider/twitch-vod").setClientID( require("@cytube/mediaquery/lib/provider/twitch-vod").setClientID(
cfg["twitch-client-id"]); cfg["twitch-client-id"]);
require("cytube-mediaquery/lib/provider/twitch-clip").setClientID( require("@cytube/mediaquery/lib/provider/twitch-clip").setClientID(
cfg["twitch-client-id"]); cfg["twitch-client-id"]);
} else { } else {
LOGGER.warn("No Twitch Client ID set. Twitch VOD links will " + LOGGER.warn("No Twitch Client ID set. Twitch VOD links will " +

View File

@ -85,7 +85,7 @@ module.exports.init = function (newDB) {
.then(() => { .then(() => {
require('./database/update').checkVersion(); require('./database/update').checkVersion();
module.exports.loadAnnouncement(); module.exports.loadAnnouncement();
require('cytube-mediaquery/lib/provider/youtube').setCache( require('@cytube/mediaquery/lib/provider/youtube').setCache(
new MetadataCacheDB(db) new MetadataCacheDB(db)
); );
}).catch(error => { }).catch(error => {

View File

@ -1,7 +1,7 @@
import { Summary } from 'prom-client'; import { Summary } from 'prom-client';
import { createMySQLDuplicateKeyUpdate } from '../util/on-duplicate-key-update'; import { createMySQLDuplicateKeyUpdate } from '../util/on-duplicate-key-update';
const Media = require('cytube-mediaquery/lib/media'); const Media = require('@cytube/mediaquery/lib/media');
const LOGGER = require('@calzoneman/jsli')('metadata-cache'); const LOGGER = require('@calzoneman/jsli')('metadata-cache');
// TODO: these fullname-vs-shortcode hacks really need to be abolished // TODO: these fullname-vs-shortcode hacks really need to be abolished

View File

@ -3,12 +3,12 @@ const Media = require("./media");
const CustomEmbedFilter = require("./customembed").filter; const CustomEmbedFilter = require("./customembed").filter;
const Config = require("./config"); const Config = require("./config");
const ffmpeg = require("./ffmpeg"); const ffmpeg = require("./ffmpeg");
const mediaquery = require("cytube-mediaquery"); const mediaquery = require("@cytube/mediaquery");
const YouTube = require("cytube-mediaquery/lib/provider/youtube"); const YouTube = require("@cytube/mediaquery/lib/provider/youtube");
const Vimeo = require("cytube-mediaquery/lib/provider/vimeo"); const Vimeo = require("@cytube/mediaquery/lib/provider/vimeo");
const Streamable = require("cytube-mediaquery/lib/provider/streamable"); const Streamable = require("@cytube/mediaquery/lib/provider/streamable");
const TwitchVOD = require("cytube-mediaquery/lib/provider/twitch-vod"); const TwitchVOD = require("@cytube/mediaquery/lib/provider/twitch-vod");
const TwitchClip = require("cytube-mediaquery/lib/provider/twitch-clip"); const TwitchClip = require("@cytube/mediaquery/lib/provider/twitch-clip");
import { Counter } from 'prom-client'; import { Counter } from 'prom-client';
import { lookup as lookupCustomMetadata } from './custom-media'; import { lookup as lookupCustomMetadata } from './custom-media';