Skip to content
This repository has been archived by the owner on May 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #66 from Deathspike/dev/resurrect
Browse files Browse the repository at this point in the history
  • Loading branch information
Roel van Uden authored May 18, 2017
2 parents fbe978d + aa72c3e commit e2e32ee
Show file tree
Hide file tree
Showing 226 changed files with 1,446 additions and 6,091 deletions.
16 changes: 16 additions & 0 deletions .ezpz.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var fs = require('fs');
var path = require('path');

if (path.basename(__dirname) !== 'node_modules') {
console.log('ERROR: The containing folder must be named \'node_modules\'.');
process.exit(1);
}

fs.readdirSync(__dirname)
.sort()
.filter(folderName => /^mangarack-/.test(folderName))
.concat('mangarack')
.forEach(function(folderName) {
var directoryPath = path.join(__dirname, folderName);
require('./.ezpz/' + process.argv[2])(directoryPath, folderName);
});
5 changes: 5 additions & 0 deletions .ezpz/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var childProcess = require('child_process');

module.exports = function(directoryPath, folderName) {
childProcess.execSync('npm install --silent', {cwd: directoryPath, stdio: [0, 1, 2]});
};
5 changes: 5 additions & 0 deletions .ezpz/outdated.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var childProcess = require('child_process');

module.exports = function(directoryPath, folderName) {
childProcess.execSync('npm outdated --depth 0', {cwd: directoryPath, stdio: [0, 1, 2]});
};
11 changes: 11 additions & 0 deletions .ezpz/publish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var childProcess = require('child_process');
var fs = require('fs');
var path = require('path');

module.exports = function(directoryPath, folderName) {
var packagePath = path.join(directoryPath, 'package.json');
var package = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
if (!package.private) {
childProcess.execSync('npm publish --silent', {cwd: directoryPath, stdio: [0, 1, 2]});
}
};
26 changes: 26 additions & 0 deletions .ezpz/watch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var childProcess = require('child_process');
var readline = require('readline');
var totalCompiling = 0;

module.exports = function(directoryPath, folderName) {
if (folderName !== 'mangarack') {
var tsc = childProcess.spawn('node', ['node_modules/typescript/bin/tsc', '-w', '-p', '.'], {cwd: directoryPath});
var rl = readline.createInterface({input: tsc.stdout});
rl.on('line', processLine);
totalCompiling++;
}
};

function processLine(line) {
switch (true) {
case /Compilation complete/.test(line):
if (--totalCompiling == 0) console.log(line);
break;
case /File change detected/.test(line):
if (totalCompiling++ == 0) console.log(line);
break;
default:
console.log(line);
break;
}
}
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/.bin/
/*/dist/
/*/node_modules/
/*/typings
*/dist/
*/node_modules/
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [{
"console": "integratedTerminal",
"name": "Launch Program",
"outFiles": ["${workspaceRoot}/**/dist/**/*.js"],
"program": "${workspaceRoot}/mangarack-runnable-cli/dist/app",
"request": "launch",
"type": "node"
}]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.fontSize": 16,
"editor.tabSize": 2,
"files.exclude": {
"/.bin/": true,
"*/dist/": true,
"*/node_modules/": true
}
}
9 changes: 9 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"args": [".ezpz", "watch"],
"command": "node",
"isBackground": true,
"isShellCommand": true,
"problemMatcher": "$tsc-watch",
"showOutput": "silent",
"version": "0.1.0"
}
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

*MangaRack* is a console line application capable of downloading manga series from popular manga scanlation sites. Each downloaded chapter is stored on your computer as a comic book archive and contains additional embedded meta information. The embedded meta information is compatible with the popular *ComicRack* application suite.

## History/Upgrading

It has been three years since the release of *MangaRack.cs*, the predecessor of *MangaRack.js*. Managing hundreds of series, thousands of chapters and millions of pages has been an incredible learning experience. There have been major changes going from `2.x` to `3.x`, and similarly, in the `4.x` version. A library will not change much, but the *mangarack everywhere!*-philosophy has been enhanced with a "*dependable and predictable behaviour*"-approach. If you are upgrading, delete your persistence files, and check for deprecated command line switches.

## Prerequisites

* NodeJS >= `5.x` (http://nodejs.org/)
* NPM >= `2.x` (https://www.npmjs.org/)
* NodeJS >= `6.x` (http://nodejs.org/)
* NPM >= `3.x` (https://www.npmjs.org/)
* GraphicsMagick >= `1.3.x` (http://www.graphicsmagick.org/)

## Supported Sites
Expand All @@ -24,7 +20,7 @@ Use the applicable instructions to install. Is your operating system not listed?

### Debian (Mint, Ubuntu, etc)

1. Run in *Terminal*: `curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -`
1. Run in *Terminal*: `curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -`
2. Run in *Terminal*: `sudo apt-get install nodejs graphicsmagick`
3. Run in *Terminal*: `sudo npm install -g mangarack`

Expand Down Expand Up @@ -87,9 +83,10 @@ Each module has its own package definition, but none of the modules specify inte

If you wish to contribute to this repository:

1. Clone this repository into a folder named `node_modules` (for module resolution).
2. Run `node ezpz-install` in the folder using *Command Prompt*/*Terminal*.
3. Open the folder with *Atom* (using the *TypeStrong* plugin) or *VSCode*.
4. To test a *runnable*, run `node mangarack-runnable-*/dist/app` (replace `*`).
1. Clone this repository into a folder named `node_modules`.
2. Run `node .ezpz install` in the folder using *Command Prompt*/*Terminal*.
3. Open the folder with *[Visual Studio Code](https://code.visualstudio.com/)*.
4. Press `CTRL+SHIFT+B` to start the compiler. You can edit the code now and test your changes.
5. Press `F5` to start the debugger. You can enter series addresses into the terminal.

Please open an issue for further questions.
18 changes: 0 additions & 18 deletions ezpz-install.js

This file was deleted.

22 changes: 0 additions & 22 deletions ezpz-publish.js

This file was deleted.

16 changes: 0 additions & 16 deletions ezpz-version.js

This file was deleted.

4 changes: 1 addition & 3 deletions mangarack-component-common/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/src/
/typings/
/src
/tsconfig.json
/typings.json
15 changes: 8 additions & 7 deletions mangarack-component-common/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"author": "Roel van Uden",
"description": "Part of the MangaRack suite.",
"keywords": [
"mangarack"
],
"keywords": ["mangarack"],
"license": "MIT",
"main": "dist/default",
"name": "mangarack-component-common",
"repository": "git://github.com/Deathspike/mangarack",
"typings": "dist/default",
"version": "4.0.11",
"version": "4.1.0",
"dependencies": {
"tslib": "1.7.1"
},
"devDependencies": {
"npm-build-tools": "2.2.5",
"typescript": "1.9.0-dev.20160527-1.0"
"rimraf": "2.6.1",
"typescript": "2.3.2"
},
"scripts": {
"prepublish": "n-clean dist && tsc"
"prepublish": "rimraf dist && tsc"
}
}
7 changes: 3 additions & 4 deletions mangarack-component-common/src/default.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// common
// Export 'common'
export * from './dependency';
export * from './option';
export * from './promise';
export * from './functions';

// common/typings
// Export 'common/typings'
export * from './typings/IBlob';
export * from './typings/IDictionary';
export * from './typings/IOption';
4 changes: 2 additions & 2 deletions mangarack-component-common/src/dependency.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let dependencies: {[key: string]: any} = {};
let resolvers: {[key: string]: () => any} = {};
const dependencies: {[key: string]: any} = {};
const resolvers: {[key: string]: () => any} = {};

/**
* Represents the dependency helper.
Expand Down
48 changes: 48 additions & 0 deletions mangarack-component-common/src/functions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import * as mio from './default';

/**
* Creates a promise and invokes the action with a callback.
* @param action The action.
* @return The promise.
*/
export function promise<T>(action: (callback: (error?: any, value?: T) => void) => void): Promise<mio.IOption<T>> {
return new Promise<mio.IOption<T>>((resolve, reject) => {
try {
action((error?: any, value?: T) => {
if (error) {
reject(error);
} else {
resolve(value);
}
});
} catch (error) {
reject(error);
}
});
}

/**
* Creates a trackable method with which to define an unsafe promise.
* @param action The action.
* @return The promise.
*/
export function promiseUnsafe<T>(action: (callback: (error: any, value: any) => void) => void): Promise<T> {
return mio.promise<T>(callback => {
action((error, value) => {
if (error || !value) {
callback(error);
} else {
callback(undefined, unsafe<T>(value));
}
});
})
}

/**
* Provides a trackable method with which to define an unsafe type definition.
* @param value The value.
* @return The value
*/
export function unsafe<T>(value: any): T {
return value as T;
}
20 changes: 0 additions & 20 deletions mangarack-component-common/src/option.ts

This file was deleted.

22 changes: 0 additions & 22 deletions mangarack-component-common/src/promise.ts

This file was deleted.

2 changes: 1 addition & 1 deletion mangarack-component-common/src/typings/IBlob.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
* Represents a blob.
*/
export interface IBlob {}
export type IBlob = {[key: string]: never}
12 changes: 1 addition & 11 deletions mangarack-component-common/src/typings/IOption.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
/**
* Represents an option value.
*/
export interface IOption<T> {
/**
* Indicates whether the option contains a value.
*/
hasValue: boolean;

/**
* Contains the value.
*/
value: T;
}
export type IOption<T> = T | undefined;
Loading

0 comments on commit e2e32ee

Please sign in to comment.