This repository has been archived by the owner on May 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from Deathspike/dev/resurrect
- Loading branch information
Showing
226 changed files
with
1,446 additions
and
6,091 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/.bin/ | ||
/*/dist/ | ||
/*/node_modules/ | ||
/*/typings | ||
*/dist/ | ||
*/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
/src/ | ||
/typings/ | ||
/src | ||
/tsconfig.json | ||
/typings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.