-
-
Notifications
You must be signed in to change notification settings - Fork 29
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 #50 from appcelerator/timob-11869
Lots of updates
- Loading branch information
Showing
112 changed files
with
7,813 additions
and
1,864 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
._* | ||
.DS_Store | ||
node_modules | ||
npm-debug*.log | ||
lib-cov | ||
coverage.html | ||
en-us.js |
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 |
---|---|---|
|
@@ -3,3 +3,10 @@ | |
node_modules | ||
*.sublime-project | ||
*.sublime-workspace | ||
docs | ||
tests | ||
lib-cov | ||
coverage.html | ||
forge | ||
forge-tools | ||
en-us.js |
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 |
---|---|---|
@@ -1,22 +1,66 @@ | ||
## Overview | ||
|
||
This is a common library used by Appcelerator Node.js-based software products such as the | ||
This is a common library used by Appcelerator Node.js-based software products such as the | ||
[Titanium CLI](http://github.com/appcelerator/titanium). | ||
|
||
<a name="Installation"></a> | ||
## Prerequisites | ||
|
||
node-appc requires [Node.js 0.8.x](http://nodejs.org/dist/) or newer. | ||
|
||
## Installation | ||
|
||
[sudo] npm install node-appc -g | ||
|
||
<a name="License"></a> | ||
## License | ||
### Running Unit Tests | ||
|
||
To run the unit tests, simply run: | ||
|
||
node forge test | ||
|
||
### Running Code Coverage | ||
|
||
To generate the code coverage, you first must install | ||
[node-jscoverage](https://github.com/visionmedia/node-jscoverage). The easist | ||
way to do this is run: | ||
|
||
git clone git@github.com:visionmedia/node-jscoverage.git | ||
cd node-jscoverage | ||
./configure | ||
make | ||
sudo make install | ||
|
||
This project is open source and provided under the Apache Public License (version 2). Please make sure you see the `LICENSE` file | ||
included in this distribution for more details on the license. Also, please take notice of the privacy notice at the end of the file. | ||
Then run: | ||
|
||
### imgscalr | ||
node forge test-cov | ||
|
||
It will generate a file called _coverage.html_ in the node-appc directory. | ||
|
||
## Contributing | ||
|
||
Titanium is an open source project. Titanium wouldn't be where it is now without | ||
contributions by the community. Please consider forking this repo to improve, | ||
enhance or fix issues. If you feel like the community will benefit from your | ||
fork, please open a pull request. | ||
|
||
To protect the interests of the Titanium contributors, Appcelerator, customers | ||
and end users we require contributors to sign a Contributors License Agreement | ||
(CLA) before we pull the changes into the main repository. Our CLA is simple and | ||
straightforward - it requires that the contributions you make to any | ||
Appcelerator open source project are properly licensed and that you have the | ||
legal authority to make those changes. This helps us significantly reduce future | ||
legal risk for everyone involved. It is easy, helps everyone, takes only a few | ||
minutes, and only needs to be completed once. | ||
|
||
[You can digitally sign the CLA](http://bit.ly/app_cla) online. Please indicate | ||
your e-mail address in your first pull request so that we can make sure that | ||
will locate your CLA. Once you've submitted it, you no longer need to send one | ||
for subsequent submissions. | ||
|
||
## License | ||
|
||
The [imgscalr](https://github.com/thebuzzmedia/imgscalr) Java-based image-scaling library is licensed under the Apache v2.0 license. | ||
Copyright 2011 The Buzz Media, LLC. | ||
This project is open source and provided under the Apache Public License | ||
(version 2). Please make sure you see the `LICENSE` file included in this | ||
distribution for more details on the license. Also, please take notice of the | ||
privacy notice at the end of the file. | ||
|
||
#### (C) Copyright 2012-2013, [Appcelerator](http://www.appcelerator.com) Inc. All Rights Reserved. | ||
#### (C) Copyright 2012-2013, [Appcelerator](http://www.appcelerator.com/) Inc. All Rights Reserved. |
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,63 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* forge - make-like tool | ||
* | ||
* @copyright | ||
* Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved. | ||
* | ||
* @license | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
|
||
var toolsDir = './forge-tools', | ||
spawn = require('child_process').spawn, | ||
fs = require('fs'), | ||
path = require('path'), | ||
colors = require('colors'); | ||
|
||
global.which = function which(program, fn) { | ||
if (process.platform == 'win32') { | ||
fn(); // no 'which' on windows | ||
} else { | ||
spawn('which', [ program ]).on('exit', fn); | ||
} | ||
}; | ||
|
||
global.rootDir = __dirname; | ||
|
||
var tools = {}; | ||
fs.readdirSync(toolsDir = path.resolve(toolsDir)).forEach(function (name) { | ||
var m, file = path.join(toolsDir, name); | ||
if (fs.statSync(file).isDirectory()) { | ||
if (fs.existsSync(m = path.join(file, 'index.js'))) { | ||
tools[name] = m; | ||
} | ||
} else if (m = name.match(/^(?!\.|_)(.+)\.js$/)) { | ||
tools[m[1]] = file; | ||
} | ||
}); | ||
|
||
function help(err) { | ||
console.log('Forge'.cyan.bold + ' - Copyright (c) 2012-' + (new Date).getFullYear() + ', Appcelerator, Inc. All Rights Reserved.\n'); | ||
console.log('Usage: ' + 'forge <tool> [options]'.cyan + '\n'); | ||
err && console.error(err.red + '\n'); | ||
console.error('Available tools:'); | ||
Object.keys(tools).sort().forEach(function (t) { | ||
console.log(' ' + t.cyan); | ||
}); | ||
console.log(); | ||
process.exit(err ? 1 : 0); | ||
} | ||
|
||
var args = process.argv.slice(2), | ||
tool = args.shift(); | ||
|
||
if (tool && !tools[tool]) { | ||
help('ERROR: Invalid tool "' + tool + '"'); | ||
} else if (!tool) { | ||
help(); | ||
} | ||
|
||
require(tools[tool]).apply(null, args); |
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,93 @@ | ||
/** | ||
* Generates API docs in both markdown and html. | ||
* | ||
* @copyright | ||
* Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved. | ||
* | ||
* @license | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
|
||
module.exports = function () { | ||
var spawn = require('child_process').spawn, | ||
async = require('async'), | ||
wrench = require('wrench'), | ||
colors = require('colors'), | ||
startTime = Date.now(); | ||
|
||
console.log('Documentation Tool'.cyan.bold + ' - Copyright (c) 2012-' + (new Date).getFullYear() + ', Appcelerator, Inc. All Rights Reserved.\n'); | ||
|
||
spawn('which', [ 'jsdoc' ]).on('exit', function (code) { | ||
if (code) { | ||
console.error('ERROR: Unable to find "jsdoc".\n\n'.red | ||
+ 'Please install it by running "npm install -g jsdoc".\n'); | ||
process.exit(1); | ||
} else { | ||
var docsdir = path.join(rootDir, 'docs'), | ||
libdir = path.join(rootDir, 'lib'), | ||
jsdox = require("jsdox"), | ||
jsfile = /\.js$/, | ||
ignore = /^[\.|_]/; | ||
|
||
wrench.rmdirSyncRecursive(docsdir, true); | ||
wrench.mkdirSyncRecursive(docsdir); | ||
|
||
async.series(wrench.readdirSyncRecursive(libdir).map(function (file) { | ||
return function (cb) { | ||
if (jsfile.test(file) && !ignore.test(file)) { | ||
var src = path.join(libdir, file), | ||
dest = path.join(docsdir, path.dirname(file)); | ||
fs.existsSync(dest) || wrench.mkdirSyncRecursive(dest); | ||
console.log(src, '=>', path.join(dest, file.replace(jsfile, '.md'))); | ||
jsdox.generateForDir(src, dest, function () { | ||
cb(); | ||
}); | ||
} else { | ||
cb(); | ||
} | ||
}; | ||
}), function () { | ||
console.log('Docs generated successfully in ' + ((Date.now() - startTime) / 1000).toFixed(1) + ' seconds\n'); | ||
}); | ||
|
||
/* | ||
var apidox = require('apidox'), | ||
jsfile = /\.js$/, | ||
ignore = /^[\.|_]/; | ||
wrench.mkdirSyncRecursive(docsdir); | ||
wrench.readdirSyncRecursive(libdir).forEach(function (n) { | ||
if (jsfile.test(n) && !ignore.test(n)) { | ||
var src = path.join(libdir, n), | ||
dest = path.join(docsdir, n.replace(jsfile, '.md')); | ||
fs.existsSync(path.dirname(dest)) || wrench.mkdirSyncRecursive(path.dirname(dest)); | ||
fs.writeFileSync(path.join(docsdir, n.replace(jsfile, '.md')), apidox.create() | ||
.set('input', src) | ||
.parse() | ||
.convert()); | ||
} | ||
}); | ||
*/ | ||
|
||
/* | ||
var child = spawn('jsdoc', [ '-c', path.join('tools', 'docs', 'conf.json') ], params), | ||
out = '', | ||
outFn = function (data) { out += data.toString(); }; | ||
child.stdout.on('data', outFn); | ||
child.stderr.on('data', outFn); | ||
child.on('exit', function (code) { | ||
if (code) { | ||
console.error('Error building docs:\n' + out + '\n'); | ||
} else { | ||
console.log('Docs generated successfully in ' + (Math.round((Date.now() - startTime) / 100) / 10) + ' seconds\n'); | ||
} | ||
}); | ||
*/ | ||
//console.log('Docs generated successfully in ' + (Math.round((Date.now() - startTime) / 100) / 10) + ' seconds\n'); | ||
} | ||
}); | ||
}; |
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,42 @@ | ||
# i18n Tool | ||
|
||
This i18n tool makes it easy to analyze projects for i18n information and to sync that data with | ||
webtranslateit.com. | ||
|
||
## Usage | ||
|
||
forge i18n <action> [options] | ||
|
||
## Configuration | ||
|
||
This tool is configured via a config file located at `<home-directory>/.titanium/i18n-sync.json`. | ||
The file contains Appcelerator's webtranslateit.com private key and a list of projects locations. | ||
|
||
Copy the `i18n-sync.example.json` file to `<home-directory>/.titanium/i18n-sync.json`, then | ||
edit the file and specify the private key and the correct local path for each project. | ||
|
||
## Actions | ||
|
||
### analyze | ||
|
||
forge i18n analyze [--write] | ||
|
||
This will scan all projects listed in the config file for all __(), __n(), and __f() function | ||
calls. If `--write` is specified, then the strings passed into the i18n functions are updated | ||
into each project's `<project-location>/locales/en.js` file. | ||
|
||
### prepare | ||
|
||
forge i18n prepare [--write] | ||
|
||
This will scan all projects listed in the config file for all __(), __n(), and __f() function | ||
calls, then assemble all strings into a single master locale file that can be manually uploaded | ||
to the "Titanium CLI" webtranslateit.com project. This performs an `analyze` action prior to | ||
assembling the master locale file. | ||
|
||
### pull | ||
|
||
forge i18n pull [--write] | ||
|
||
Downloads the i18n strings from the "Titanium CLI" webtranslateit.com project and updates each | ||
project's i18n string files defined in the project's `<project-location>/locales/` directory. |
File renamed without changes.
Oops, something went wrong.