File tree Expand file tree Collapse file tree 16 files changed +253
-26
lines changed
Expand file tree Collapse file tree 16 files changed +253
-26
lines changed Original file line number Diff line number Diff line change 33 [" env" , {
44 "targets" : {
55 "electron" : 1.6
6- }
6+ },
7+ "modules" : false
78 }], " react"
89 ]
910}
Original file line number Diff line number Diff line change @@ -35,3 +35,4 @@ jspm_packages
3535
3636# Optional REPL history
3737.node_repl_history
38+ dist
Original file line number Diff line number Diff line change 1919 < script src ="node_modules/videojs-contrib-hls/dist/videojs-contrib-hls.min.js "> </ script >
2020 < script src ="node_modules/videojs-ass/src/videojs.ass.js "> </ script >
2121 < script >
22- require ( 'babel-register' ) ;
23- require ( './src/index.js' ) ;
22+ console . log ( process . env . NODE_ENV ) ;
23+ if ( process . env . NODE_ENV === 'test' ) {
24+ require ( 'babel-register' ) ( {
25+ presets : [
26+ [ 'env' , {
27+ targets : {
28+ electron : 1.6
29+ } ,
30+ } ] ,
31+ 'react' ,
32+ ] ,
33+ } ) ;
34+ require ( './src/index.js' ) ;
35+ } else {
36+ require ( './dist/app.min.js' ) ;
37+ }
2438 </ script >
2539</ html >
Original file line number Diff line number Diff line change 77 "author" : " Tim Ermilov <yamalight@gmail.com>" ,
88 "license" : " MIT" ,
99 "scripts" : {
10- "start" : " electron ." ,
10+ "start" : " NODE_ENV=test electron ." ,
11+ "production" : " electron ." ,
1112 "lint" : " eslint **/*.js" ,
1213 "inspect-main" : " electron-inspector" ,
13- "test" : " mocha"
14+ "build" : " rollup -c" ,
15+ "test" : " NODE_ENV=test mocha"
1416 },
1517 "devDependencies" : {
1618 "babel-core" : " ^6.24.0" ,
2729 "eslint-plugin-react" : " ^6.10.3" ,
2830 "mocha" : " ^3.4.2" ,
2931 "prettier" : " ^0.22.0" ,
32+ "rollup" : " ^0.45.2" ,
33+ "rollup-plugin-babel" : " ^2.7.1" ,
3034 "spectron" : " ^3.7.2"
3135 },
3236 "dependencies" : {
Original file line number Diff line number Diff line change 1+ import babel from 'rollup-plugin-babel' ;
2+
3+ export default {
4+ entry : 'src/index.js' ,
5+ format : 'cjs' ,
6+ dest : 'dist/app.min.js' ,
7+ plugins : [ babel ( { exclude : 'node_modules/**' } ) ] ,
8+ external : [
9+ 'big-integer' ,
10+ 'cheerio' ,
11+ 'crypto' ,
12+ 'electron' ,
13+ 'lodash' ,
14+ 'playlist-parser' ,
15+ 'pouchdb-browser' ,
16+ 'react-dom' ,
17+ 'react-router-dom' ,
18+ 'react' ,
19+ 'request-promise-native' ,
20+ 'rxjs' ,
21+ 'xml2js' ,
22+ 'zlib' ,
23+ ] ,
24+ } ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import cheerio from 'cheerio';
55// base url
66const baseURL = 'http://www.crunchyroll.com' ;
77
8- module . exports = async _id => {
8+ export default async _id => {
99 // load catalogue
1010 const url = `${ baseURL } ${ _id } ` ;
1111 const data = await request ( url ) ;
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ import {M3U} from 'playlist-parser';
66import electron from 'electron' ;
77
88// our packages
9- import db from '../../db' ;
9+ import db from '../../db/index ' ;
1010import parseXml from './parseXml' ;
11- import decode from './subtitles' ;
11+ import decode from './subtitles/index ' ;
1212import bytesToAss from './subtitles/ass' ;
1313import getSeries from './getSeries' ;
1414
Original file line number Diff line number Diff line change 11// plugins
2- import Crunchyroll from './crunchyroll' ;
3- import Youtube from './youtube' ;
2+ import Crunchyroll from './crunchyroll/index ' ;
3+ import Youtube from './youtube/index ' ;
44
55// manager
66import PluginManager from './manager' ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import cheerio from 'cheerio';
55import electron from 'electron' ;
66
77// our packages
8- import db from '../../db' ;
8+ import db from '../../db/index ' ;
99
1010// base URL used for most requests
1111const baseURL = 'http://youtube.com' ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import React from 'react';
33import { withRouter } from 'react-router-dom' ;
44
55// our packages
6- import db from '../../db' ;
6+ import db from '../../db/index ' ;
77
88export default withRouter ( ( { series, history} ) => {
99 const openSeriesPage = async ( ) => {
You can’t perform that action at this time.
0 commit comments