Skip to content

Commit

Permalink
chore: switch to rollup-plugin-data-files (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey committed Jan 21, 2021
1 parent e86dcae commit 8f69b45
Show file tree
Hide file tree
Showing 61 changed files with 96 additions and 166 deletions.
28 changes: 28 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"scripts": {
"build-test": "cross-env-shell TEST_BUNDLE_ONLY=1 'npm run build'",
"build-prod": "cross-env-shell NO_TEST_BUNDLE=1 'npm run build'",
"build-test-data": "node scripts/m3u8.js",
"build": "npm-run-all -s clean build-test-data -p build:*",
"build": "npm-run-all -s clean -p build:*",
"build:js": "rollup -c scripts/rollup.config.js",
"clean": "shx rm -rf ./dist ./test/dist && shx mkdir -p ./dist ./test/dist",
"lint": "vjsstandard",
Expand Down Expand Up @@ -76,6 +75,7 @@
"@videojs/generator-helpers": "~2.0.1",
"karma": "^5.2.3",
"rollup": "^2.36.1",
"rollup-plugin-data-files": "^0.1.0",
"sinon": "^9.2.3",
"videojs-generate-karma-config": "~7.0.0",
"videojs-generate-rollup-config": "~6.1.0",
Expand Down
83 changes: 0 additions & 83 deletions scripts/export-m3u8s.js

This file was deleted.

22 changes: 0 additions & 22 deletions scripts/m3u8.js

This file was deleted.

7 changes: 7 additions & 0 deletions scripts/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const generate = require('videojs-generate-rollup-config');
const replace = require('@rollup/plugin-replace');
const dataFiles = require('rollup-plugin-data-files');

// see https://github.com/videojs/videojs-generate-rollup-config
// for options
Expand All @@ -20,10 +21,16 @@ const options = {
'require("@videojs/vhs-utils/es': 'require("@videojs/vhs-utils/cjs'
});

defaults.dataFiles = dataFiles({
expecteds: {include: 'test/fixtures/integration/*.js', transform: 'js', extensions: false},
manifests: {include: 'test/fixtures/integration/*.m3u8', transform: 'string', extensions: false}
});

return defaults;
},
plugins(defaults) {
defaults.module.unshift('replace');
defaults.test.unshift('dataFiles');

return defaults;
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/absoluteUris.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/allowCache.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/allowCacheInvalid.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/alternateAudio.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
allowCache: true,
discontinuityStarts: [],
mediaGroups: {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/alternateVideo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
allowCache: true,
discontinuityStarts: [],
mediaGroups: {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/brightcove.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"playlists": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/byteRange.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/dateTime.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": false,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/disallowCache.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": false,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/disc-sequence.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"discontinuitySequence": 3,
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/discontinuity.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"discontinuitySequence": 0,
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/domainUris.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/empty.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"discontinuityStarts": [],
"segments": []
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/emptyAllowCache.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/emptyMediaSequence.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/emptyPlaylistType.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"segments": [
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/emptyTargetDuration.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"playlists": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/encrypted.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 7794,
"discontinuitySequence": 0,
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/event.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "EVENT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 1,
"segments": [
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/extinf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/fmp4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 1,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/headerOnly.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"discontinuityStarts": [],
"segments": []
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/invalidAllowCache.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/invalidMediaSequence.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/invalidPlaylistType.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"segments": [
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/invalidTargetDuration.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/liveMissingSegmentDuration.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"playlistType": "VOD",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/liveStart30sBefore.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"segments": [
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/llhls.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"dateTimeObject": new Date("2019-02-14T02:13:36.106Z"),
"dateTimeString": "2019-02-14T02:13:36.106Z",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/llhlsDelta.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"dateTimeObject": new Date("2019-02-14T02:14:00.106Z"),
"dateTimeString": "2019-02-14T02:14:00.106Z",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"segments": [
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/manifestExtXEndlistEarly.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"segments": [
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/manifestNoExtM3u.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"mediaSequence": 0,
"segments": [
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/master-fmp4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
allowCache: true,
discontinuityStarts: [],
mediaGroups: {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/integration/master.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"allowCache": true,
"playlists": [
{
Expand Down
Loading

0 comments on commit 8f69b45

Please sign in to comment.