Code Monkey home page Code Monkey logo

tn's Introduction

TiNy CLI Titanium

TiNy is a wrapper for the Appcelerator CLI's run and Titanium CLI's build command that allows you to do the same using less keystrokes. It has built-in recipes, but also allows you to compose and save your own recipes.

WARNING: Version 3.x is once again a wrapper like 1.x and no longer a hook as 2.x

Quick Start npm

  1. Install TiNy via NPM:

    [sudo] npm install -g tn --unsafe-perm
    
    • You probably need sudo on Mac OS.
    • You need --unsafe-perm to allow TiNy to uninstall the 2.x hook if needed.
  2. If for some reason uninstalling the 2.x hook failed, use the TiNY CLI to do so:

    tn uninstall
    
  3. Generate recipes for all connected simulators, emulators and devices:

    tn generate
    
  4. Build a project for iPhone 6 Simulator using the generated recipe:

    tn iphone-6
    tn iphone-6 --another-recipe
    
    • Notice that since 3.0 is no longer a hook and you ned tn instead of ti.
    • Notice that since 4.0 you no longer need tn r or tn b, just use tn.
    • Only the first recipe after tn does not need to start with --.
    • If the recipes does end up giving a command as first arg, it will default to build
  5. Compose a custom recipes mixing others (--ah) and an option value (%s):

    tn save ci \
    -b \
    --pp-uuid 37304C9F-B2E0-490A-9800-0448A33BECE9 \
    --distribution-name "Jeff Haynie (E8978765FC)" \
    --ah \
    --installr --installr-release-notes %s
    
  6. Ship it:

    tn ci "a great update"
    

Recipes

A recipe is simply a flag or option that stands for a group of other arguments, which may in turn include other recipes. There are built-in recipes, but you can also add your own or override built-ins.

  • List all recipes: tn list

Colors will show you which recipes are built-in, user and user-overrides.

Option recipes

Most recipes are flags, but a receipe can also be an option. If a recipe is followed by an argument value, TiNy assumes the recipe to be an option and replace any occurences of %s in the recipe with the value. See step 4 of the Quick Start for an example.

Built-in recipes

These are the current built-in recipes. If you have handy custom recipes you think everybody should have, please send a PR or open a ticket to have them added to the built-ins.

  • Don't forget that since 2.0 recipes are options and start with --.
  • Only the first recipe does not need to start with --.
name recipe
android --platform android
blackberry --platform blackberry
ios --platform ios
mobileweb --platform mobileweb
tizen --platform tizen
ipad --device-family ipad
iphone --device-family iphone
ip --iphone
universal --device-family universal
uni --universal
watch --ios --launch-watch-app
appstore --ios --target dist-appstore
as --appstore
playstore --android --target dist-playstore
play --playstore
ps --playstore
distribute --blackberry --target distribute
dist --distribute
adhoc --ios --target dist-adhoc
ah --adhoc
emulator --target emulator
emu --emulator
simulator --target simulator
sim --simulator
device --target device
ioses --ios --device --device-id all
droid --android --device
desktop -output-dir ~/Desktop
ip7 --sim-version 7.1 --sim-type iphone
ip6 --sim-version 6.1 --sim-type iphone
ipad7 --sim-version 7.1 --sim-type ipad
ipad6 --sim-version 6.1 --sim-type ipad
key-password --key-password %s --key-password %s --platform android
android-sdk --android-sdk %s --platform android
avd-abi --avd-abi %s --platform android
keystore --keystore %s --platform android
alias --alias %s --platform android
store-password --store-password %s --platform android
avd-skin --avd-skin %s --platform android
ip-address --ip-address %s --platform blackberry
debug-token --debug-token %s --platform blackberry
keystore-password --keystore-password %s --platform blackberry
ndk --ndk %s --platform blackberry
password --password %s --platform blackberry
force-copy --force-copy --platform ios
force-copy-all --force-copy-all --platform ios
retina --retina --platform ios
sim-64bit --sim-64bit --platform ios
sim-focus --sim-focus --platform ios
tall --tall --retina --platform ios
device-family --device-family %s --platform ios
ios-version --ios-version %s --platform ios
pp-uuid --pp-uuid %s --platform ios
distribution-name --distribution-name %s --platform ios
sim-version --sim-version %s --target simulator --platform ios
keychain --keychain %s --platform ios
developer-name --developer-name %s --target device --platform ios
sim-type --sim-type %s --target simulator --platform ios

Custom recipes

The user recipes are stored in ~/.tn.json and override built-in recipes sharing the same name. Use the TiNy CLI to edit them:

tn save ios --target android # overrides the built-in ios-recipe
tn rename ios confusing      # restores the built-in ios-recipe
tn remove confusing          # deletes the confusing custom recipe
tn reset                     # deletes the ~/.tn.json file
Generating Device/Emulator/Simulator recipes

You can generate user recipes for all connected devices, emulators and simulators by running tn generate. This will automatically create new recipes like:

  iphone-5s: --platform ios --target simulator --device-id 2592EB13-534C-4E05-8D58-110D0261BDE3
  iphone-5s-ios71: --platform ios --target simulator --device-id 2AE900F4-4349-4AD9-9AC4-CFD881BD5877
  iphone-jason: --platform ios --target device --device-id daf492502fffe744842280370ed6dcc740eda657
  samsung-galaxy-s4-43-api-18-1080x1920: --platform android --target emulator --device-id "Samsung Galaxy S4 - 4.3 - API 18 - 1080x1920"

Project recipes

Project recipes override both user and built-in recipes. The are stored in the current working directory in a file called tn.json. To edit this file instead of the global user file add project before the save, rename, remove and reset commands:

tn project save ios --target android # overrides the built-in (and custom) ios-recipe
tn project rename ios confusing      # restores the built-in (or custom) ios-recipe
tn project remove confusing          # deletes the confusing custom recipe
tn project reset                     # deletes the tn.json file

Command recipes

Any recipe can be used as a command as well. Like the Quick Start shows you can do tn ipad instead of tn --ipad. If the first argument is a valid recipe name TiNy will turn it into a flag/option and continue as normal.

Verbose mode

If you want to know exactly what TiNy is doing, e.g. when you're composing a new recipe, you can enable verbose-mode by passing --verbose as one of the arguments. Apart from showing how TiNy cooks the end-result, it will also pause before actually executing it, asking if you want to save it as a recipe, just run it or exit.

Other features

Resolving aliases

TiNy will convert abbreviations (-T) to their full names (--target). It needs to this for the next feature.

Resolving duplicates

TiNy will resolve any duplicate options and flags in order of appearance.

Roadmap

  • Restore some of the smarts lost in the 2.0 rewrite.
  • Add more built-in recipes.

Changelog

  • 4.2.1: Fixes issue generating certain simulators with special characters in their names
  • 4.2.0: Adds --prefer-appc and --prefer-ti to override automatic detection to use appc or ti CLI.
  • 4.0.0: Removed the need to use tn r or tn b thanks to appc-compat
  • 3.0.0: Reverted TiNy from hook back to wrapper, supporting both ti build and appc run.
  • 2.3.0: Fixes for TiNy not to mess when run via Studio or AppC CLI
  • 2.2.0: Adds generating device/emulator/simulator recipes (tn generate).
  • 2.1.0: Re-introduces command recipes (and fixes postinstall for npm link).
  • 2.0.0: Rewrite using traditional flags/options format for recipes.
  • 1.0.0: Rewrite dropping support for T=emulator and T:emulator notations.
  • 0.1.0: Original version.

Bugs

When you find issues, please report them. Be sure to include all of the output from the gittio command that didn't work as expected. Also please check if there's not already in issue for it.

License

Copyright (c) 2016-2021, Jason Kneen.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

tn's People

Contributors

dbankier avatar ev-jstephens avatar fokkezb avatar jasonkneen avatar markboyer avatar sschueller avatar tujoworker avatar yomybaby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tn's Issues

TypeError: Cannot read property 'latest' of undefined

I just installed 2.0.2 from NPM (previously had v1) and now amost all ofl my tn commands are failing with the following error:

/usr/local/lib/node_modules/tn/lib/update.js:14
    var line1 = ' Update available: ' + (notifier.update.latest).green.bold +
                                                        ^
TypeError: Cannot read property 'latest' of undefined
    at update (/usr/local/lib/node_modules/tn/lib/update.js:14:57)
    at displayBanner (/usr/local/lib/node_modules/tn/bin/cli.js:119:5)
    at Object.<anonymous> (/usr/local/lib/node_modules/tn/bin/cli.js:31:5)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

Generate user recipes for each iOS simulator installed

Since Titanium SDK >= 3.4 requires the simulator UUID ("-C" or "--device-id") for running an app on a specific simulator, I've coded a little script to generate tn recipes for each installed simulator (iPhone 6 Plus, iPhone 5S, etc.) for a given iOS SDK version.

The script:

var ioslib = require('ioslib'),
    _ = require("underscore"),
    args = process.argv.slice(2);

if (args && args[0])
{
    var version = args[0] + '';
    ioslib.simulator.detect(function(err, result){
        if (_.has(result.simulators, version))
        {
            var recipes = loadSimulators(result.simulators[version]);
            console.log(JSON.stringify(recipes));
        } else {
            console.error('iOS SDK version "%s" not installed', version);
        }
    });
}

function loadSimulators(simulators)
{
    var recipes = {};
    _.each(simulators, function(simulator){
        var recipeId = simulator.deviceType.toLowerCase().replace(/ /g, '');

        recipes[recipeId] = ['-C', simulator.udid];
    });

    return recipes;
}

running node script.js 8.0 will generate recipes like the following:

{
  "iphone4s": [
    "-C",
    "8828C9B1-AAAA-47DA-9669-4A6C81CE240B"
  ],
  "iphone5": [
    "-C",
    "DC908222-AAAA-4AB2-8F87-84FCE6AC7911"
  ],
  "iphone5s": [
    "-C",
    "BDF1F8B2-AAAA-4592-A711-9E195B517075"
  ],
  "iphone6plus": [
    "-C",
    "382E3612-AAAA-416F-A4E7-A6E984094502"
  ],
  "iphone6": [
    "-C",
    "6EF9189F-AAAA-47FF-ADD8-3CBFF12B70A6"
  ],
  "ipad2": [
    "-C",
    "BF009AB3-AAAA-4A27-BCDA-724E267DF250"
  ],
  "ipadretina": [
    "-C",
    "51D9427C-AAAA-43FE-9609-866FD3602803"
  ],
  "ipadair": [
    "-C",
    "BA87C7B0-AAAA-453C-877B-73C6728AB0D2"
  ],
  "resizableiphone": [
    "-C",
    "2FDF35A2-AAAA-43AD-A44F-21FCE535207D"
  ],
  "resizableipad": [
    "-C",
    "79E2A10B-AAAA-4CF3-8104-6A8855724343"
  ]
}

... after saving them as tn.json on my project (I know, I can save them automatically) I can run tn iphone6plus to open my app on a iPhone 6 Plus simulator.

Do you think this kind of solution could be added to tn? maybe as a new command and add the generated recipes to a user level.

IMHO, it would be useful but I can't imagine how to include it within tn.

tn generate doesn't work anymore

Hello Fokke,

I use TN everyday, it seems that with the last version of XCODE, the generate function doesn't work anymore. I've try to reset my .tn.json and the new receipes are not added.

2.0.0 doesn't respect ---shadow

If you have tishadow with tn, the --shadow command in the recipe is ignored and shadow is not started. if the build is done without using a recipe, passing in the build commands, shadow starts normally.

Refactor

  • Switch to recipes being flags for simpler logic
  • Request Titanium CLI to fix handling ti build -p ios --platform android
  • Add device/simulator selection by name

target macOS

Hi Jason, how can I check if tn generate is running on a Mac??

So I can add the following line:

recipes.save('macos', ['--platform', 'ios', '--target', 'macos']);

I just found out by reading this post that I can target my apps for M1 Macs:

https://ti-slack.slack.com/archives/C03CVQX2A/p1636043474286300

Do you know if there are more options to build for macOS??

Install Error. Not sure what is going on here.

Andys-iMac:~ andy$ sudo npm install -g tn --unsafe-perm
Password:
/usr/local/bin/tn -> /usr/local/lib/node_modules/tn/bin/cli.js

[email protected] postinstall /usr/local/lib/node_modules/tn
node bin/cli.js uninstall

TiNy, version 3.0.3
Copyright (c) 2013-2015, Fokke Zandbergen. All Rights Reserved.

[INFO] Uninstalling the old 2.x Titanium CLI hook..
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn ti ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "tn" "--unsafe-perm"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node bin/cli.js uninstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node bin/cli.js uninstall'.
npm ERR! This is most likely a problem with the tn package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node bin/cli.js uninstall
npm ERR! You can get their info via:
npm ERR! npm owner ls tn
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/andy/npm-debug.log
Andys-iMac:~ andy$

TiNy doesn't work well with new prompters

Works:

ti -p ios -T device

Doesn't work:

$ tn -p ios -T device
TiNy 0.1.4 by Fokke Zandbergen <www.fokkezb.nl>
The simple CLI for Titanium, Alloy and related tools.

[INFO] Executing: ti build -p ios -T device -p ios

Titanium Command-Line Interface, CLI version 3.2.0, Titanium SDK version 3.2.0.v20131102224044
Copyright (c) 2012-2013, Appcelerator, Inc.  All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

[INFO]  tiapp.xml <sdk-version> set to 3.1.3.GA, but current Titanium SDK set to 3.2.0.v20131102224044
[INFO]  Forking correct SDK command: "/usr/local/bin/node" "/usr/local/bin/ti" "build" "--sdk" "3.1.3.GA" "--config-file" "/Users/zandbergen/.titanium/config.json" "--platform" "iphone" "--project-dir" "/Users/zandbergen/dev/apps/MrMovie" "--log-level" "trace" "--target" "device"
Name of the iOS Developer Certificate to use:
/usr/local/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:184
        throw e;
              ^
TypeError: Object #<Socket> has no method 'setRawMode'
    at Text._get (/usr/local/lib/node_modules/titanium/node_modules/fields/lib/prompter.js:313:16)
    at Text.prompt (/usr/local/lib/node_modules/titanium/node_modules/fields/lib/types/text.js:19:7)
    at CLI.<anonymous> (/usr/local/lib/node_modules/titanium/lib/cli.js:1000:8)
    at q.process (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:728:21)
    at processImmediate (timers.js:330:15)

events.js:72

$ tn r dev
TiNy cooked: appc run --platform ios --target device -V "XXXXXXXXX" -P XXXXXXXXXXXX --device-id all

execvp(): No such file or directory

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)
events.js:72
        throw er; // Unhandled 'error' event

Handle the `sdk` option better

Right now ti build 3.2.3.GA doesn't work because we give the cooked arguments back to the CLI, but the CLI handles the --sdk with special care before the hook is called. So we need to set it somewhere else from within the hook.

Doesn't respect sdk selection

Create a recipe that runs:-

ti build --platform ios --sdk 3.2.3.GA shadow --ios-version 7.1 --retina --tall

and it fails to build. Tiny says it's cooking that command but the sdk isn't selected.

If you run the command in the terminal directly, it works.

Problem with tishadow option (`--shadow`, `--appify`)

Current tishadow plugin in always insert developer-name
dbankier/TiShadow@f69abe3#diff-4ca83d21132e62e6fd8870dd44e1df56R70

if (build.certDeveloperName) {
   args.push("--developer-name");
   args.push(build.certDeveloperName);
}

so tn cook --developer-name to --developer-name %s --target device --platform ios even I don't want to build to device(--target device).

This code is related dbankier/TiShadow#349 issue which you made.
Do you know why tishadow adds developer-name alway? ( @FokkeZB @dbankier )

After override --developer-name recipe, it work properly. But this issue make that other developer had headache.

issues with 2.0.1

  • Installed 2.0.1 after prompt said to install. It did't install correctly and had to redo with --unsafe-perm added to install command
  • running normal ti build command (no tn recipes) I see an error saying

[WARN] Bad plugin hooks that failed to load: [WARN] /usr/local/lib/node_modules/tn/hooks/tn.js

reverted to 2.0.0 and all fine

install tn generate error

Hello,
On mac, node v0.12.2 titanium cli 3.4.2
When i install tn i have an error:

/usr/local/bin/tn -> /usr/local/lib/node_modules/tn/bin/cli.js

[email protected] postinstall /usr/local/lib/node_modules/tn
node bin/cli.js install

TiNy, version 2.2.3
Copyright (c) 2013-2014, Fokke Zandbergen. All Rights Reserved.

[INFO] Installing Titanium CLI hook..
child_process.js:968
throw new TypeError('options argument must be an object');
^
TypeError: options argument must be an object
at normalizeSpawnArguments (child_process.js:968:11)
at Object.exports.spawn (child_process.js:991:38)
at spawn (/usr/local/lib/node_modules/tn/lib/setup.js:160:36)
at Object.install (/usr/local/lib/node_modules/tn/lib/setup.js:18:3)
at Object. (/usr/local/lib/node_modules/tn/bin/cli.js:82:11)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "tn" "--unsafe-perm"
npm ERR! node v0.12.2
npm ERR! npm v2.7.6
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: node bin/cli.js install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node bin/cli.js install'.
npm ERR! This is most likely a problem with the tn package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node bin/cli.js install
npm ERR! You can get their info via:
npm ERR! npm owner ls tn
npm ERR! There is likely additional logging output above.

[email protected] preuninstall /usr/local/lib/node_modules/tn
node bin/cli.js uninstall

TiNy, version 2.2.3
Copyright (c) 2013-2014, Fokke Zandbergen. All Rights Reserved.

[INFO] Uninstalling Titanium CLI hook..
paths.hooks saved

npm ERR! Please include the following file with any support request:
npm ERR! /Volumes/MacintoshHD2/MobileCanalTP/NMPAppMobile/npm-debug.log

Thx

on linux, tn generate throws an error

Hi,

when trying tiny cli on my linux machine, tn generate outputs the following:
/usr/local/lib/node_modules/tn/lib/setup.js:101
if (config.ios.devices && config.ios.devices.length > 0) {
^
TypeError: Cannot read property 'devices' of undefined
at process (/usr/local/lib/node_modules/tn/lib/setup.js:101:21)
at ChildProcess. (/usr/local/lib/node_modules/tn/lib/setup.js:173:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)

It's not a big deal because tn generated the recipes for my android devices/emulators.
Thanks for this great tool.

Error in installation

For some reason I am getting this when I install from NPM

npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/fields
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/update-notifier

path.js:309
      var path = (i >= 0) ? arguments[i] : process.cwd();
                                                   ^
Error: ENOENT, no such file or directory
    at Object.exports.resolve (path.js:309:52)
    at Function.Module._resolveLookupPaths (module.js:260:17)
    at Function.Module._resolveFilename (module.js:328:31)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/titanium/node_modules/node-appc/lib/analytics.js:20:9)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/update-notifier
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/fields
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/configstore
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/sprintf
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/configstore
npm http 304 https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/js-yaml
npm http GET https://registry.npmjs.org/has-color
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/strip-ansi
npm http GET https://registry.npmjs.org/uuid
npm http GET https://registry.npmjs.org/object-assign
npm http 304 https://registry.npmjs.org/sprintf
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/cookie-jar
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/osenv/0.0.3
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/has-color
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/strip-ansi
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/json-stringify-safe
npm http 304 https://registry.npmjs.org/forever-agent
npm http 304 https://registry.npmjs.org/tunnel-agent
npm http 304 https://registry.npmjs.org/http-signature
npm http 304 https://registry.npmjs.org/object-assign
npm http 304 https://registry.npmjs.org/hawk
npm http 304 https://registry.npmjs.org/oauth-sign
npm http 304 https://registry.npmjs.org/node-uuid
npm http 304 https://registry.npmjs.org/uuid
npm http 304 https://registry.npmjs.org/form-data
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/aws-sign
npm http GET https://registry.npmjs.org/argparse
npm http GET https://registry.npmjs.org/esprima
npm http 304 https://registry.npmjs.org/cookie-jar
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/asn1/0.1.11
npm http GET https://registry.npmjs.org/ctype/0.5.2
npm http GET https://registry.npmjs.org/hoek
npm http GET https://registry.npmjs.org/boom
npm http GET https://registry.npmjs.org/cryptiles
npm http GET https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/argparse
npm http 304 https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/combined-stream
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/asn1/0.1.11
npm http 304 https://registry.npmjs.org/assert-plus/0.1.2
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/hoek
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5
/usr/local/bin/tn -> /usr/local/lib/node_modules/tn/bin/cli.js

> [email protected] postinstall /usr/local/lib/node_modules/tn
> tn install

TiNy, version 1.0.3
Copyright (c) 2013, Fokke Zandbergen.  All Rights Reserved.

[INFO]  Installing Titanium CLI hook..
Titanium Command-Line Interface, CLI version 3.2.3, Titanium SDK version 3.2.2.GA
Copyright (c) 2012-2014, Appcelerator, Inc.  All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

[email protected] /usr/local/lib/node_modules/tn
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
Ians-iMac:Heritage-App iantearle$ tn install
TiNy, version 1.0.3
Copyright (c) 2013, Fokke Zandbergen.  All Rights Reserved.

[INFO]  Installing Titanium CLI hook..
Titanium Command-Line Interface, CLI version 3.2.3, Titanium SDK version 3.2.2.GA
Copyright (c) 2012-2014, Appcelerator, Inc.  All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

Running tn install simply gives:

[INFO]  Installing Titanium CLI hook..
Titanium Command-Line Interface, CLI version 3.2.3, Titanium SDK version 3.2.2.GA
Copyright (c) 2012-2014, Appcelerator, Inc.  All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

Target platform to build for:
 1)  android
 2)  blackberry
 3)  ios
 4)  mobileweb
 5)  tizen
Enter # or platform name: 

tn doesn't actually execute appc

tn detected the project as a platform project, and even displayed that the cooked command was an "appc" one, but then executed with ti instead:

MacBook-Pro: shan$ tn nexus-7
TiNy cooked: appc ti build --platform android --target device --device-id 0583a2a0

Titanium Command-Line Interface, CLI version 4.0.1, Titanium SDK version 4.0.0.GA

Yes, appc is installed. Copying & pasting the cooked command works as expected:

MacBook-Pro: shan$ appc ti build --platform android --target device --device-id 0583a2a0
Appcelerator Command-Line Interface, version 4.1.2

tn generate doesn't add most ipad simulators

I'm running tn v4.2.0. When running tn generate, it successfully finds most of the XCode simulators, but doesn't add most recipes for iPad and iPad Pro. tn generate gives the following errors:

[ERROR] Invalid recipe name: ipad-5th-generation-
[ERROR] Invalid recipe name: ipad-pro-9-7-inch-
[ERROR] Invalid recipe name: ipad-pro-12-9-inch-
[ERROR] Invalid recipe name: ipad-pro-12-9-inch-2nd-generation-
[ERROR] Invalid recipe name: ipad-pro-10-5-inch-
[ERROR] Invalid recipe name: ipad-6th-generation-
[ERROR] Invalid recipe name: ipad-pro-11-inch-
[ERROR] Invalid recipe name: ipad-pro-12-9-inch-3rd-generation-
[ERROR] Invalid recipe name: ipad-5th-generation-
[ERROR] Invalid recipe name: ipad-pro-9-7-inch-
[ERROR] Invalid recipe name: ipad-pro-12-9-inch-
[ERROR] Invalid recipe name: ipad-pro-12-9-inch-2nd-generation-
[ERROR] Invalid recipe name: ipad-pro-10-5-inch-

I can still run the simulators by using the device-id, but it would be nice to have these shortcut recipes added automatically. These names seem to be coming from XCode. I'm running XCode v10.1.

Doesn't respect ---shadow

Created a recipe with --shadow in it, e.g:

--ios --shadow

and shadow is ignored

Add --shadow on the end so

ti devtest --shadow

and it works

Error when trying to install on Windows

I am getting the following output when I try to install on Windows. I am using Windows 8.1. I am also running as administrator.

C:\cloud\Dropbox\area51\github\FokkeZB.tn>npm install -g tn --unsafe-perm
C:\Users\brenton\AppData\Roaming\npm\tn -> C:\Users\brenton\AppData\Roaming\npm\node_modules\tn\bin\cli.js

> [email protected] postinstall C:\Users\brenton\AppData\Roaming\npm\node_modules\tn
> tn install

TiNy, version 1.2.2
Copyright (c) 2013, Fokke Zandbergen.  All Rights Reserved.

[INFO]  Installing Titanium CLI hook..

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:1001:11)
    at Process.ChildProcess._handle.onexit (child_process.js:792:34)

npm ERR! [email protected] postinstall: `tn install`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the tn package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tn install
npm ERR! You can get their info via:
npm ERR!     npm owner ls tn
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "tn" "--unsafe-perm"
npm ERR! cwd C:\cloud\Dropbox\area51\github\FokkeZB.tn
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE

> [email protected] preuninstall C:\Users\brenton\AppData\Roaming\npm\node_modules\tn
> tn uninstall

TiNy, version 1.2.2
Copyright (c) 2013, Fokke Zandbergen.  All Rights Reserved.

[INFO]  Uninstalling Titanium CLI hook..

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:1001:11)
    at Process.ChildProcess._handle.onexit (child_process.js:792:34)
npm WARN continuing anyway [email protected] preuninstall: `tn uninstall`
npm WARN continuing anyway Exit status 8
npm ERR! not ok code 0

v2.x doesn't support multi recipes at a same time?

I made a af recipe to add a --appify flag.

Previous v2.0, tn ios af cooked ti build --platform ios --appify
But In v2.x, ti ios af cooked ti build --platform ios.

V2.x doens't support multi recipes at a same time?

tn needs a default command

If you only enter tn you get an error, which makes it appear as though the command didn't install properly or something:

MacBook-Pro:~ shan$ tn
/usr/local/lib/node_modules/tn/lib/kitchen.js:46
  if (pan[0].substr(0, 1) !== '-' && recipes.has(pan[0])) {
            ^
TypeError: Cannot read property 'substr' of undefined
    at Object.cook (/usr/local/lib/node_modules/tn/lib/kitchen.js:46:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/tn/bin/cli.js:107:24)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

It should either default to help, or should prompt the user to enter "tn help"

Reduce CLI for management only

[ ] list recipes
[ ] set recipe
[ ] unset recipe
[ ] set default recipe (normally: iOS)
[ ] install hook
[ ] uninstall hook

Build fail

Trying to run recipe

[WARN]  Bad plugin hooks that failed to load:
[WARN]  /usr/local/lib/node_modules/tn/hooks/tn.js
[WARN]    TypeError: Object 7 has no method 'match'
[WARN]        at heat (/usr/local/lib/node_modules/tn/lib/kitchen.js:104:21)
[WARN]        at heat (/usr/local/lib/node_modules/tn/lib/kitchen.js:125:22)
[WARN]        at heat (/usr/local/lib/node_modules/tn/lib/kitchen.js:125:22)
[WARN]        at heat (/usr/local/lib/node_modules/tn/lib/kitchen.js:125:22)
[WARN]        at Object.cook (/usr/local/lib/node_modules/tn/lib/kitchen.js:145:9)
[WARN]        at exports.init (/usr/local/lib/node_modules/tn/hooks/tn.js:18:18)
[WARN]        at CLI.<anonymous> (/usr/local/lib/node_modules/titanium/lib/hook.js:85:23)
[WARN]        at Array.forEach (native)
[WARN]        at CLI.scanHooks (/usr/local/lib/node_modules/titanium/lib/hook.js:67:41)
[WARN]        at CLI.<anonymous> (/usr/local/lib/node_modules/titanium/lib/cli.js:70:13)
[WARN]    ---------------------------------------------
[WARN]        at Object.run (/usr/local/lib/node_modules/titanium/node_modules/node-appc/lib/subprocess.js:59:8)
[WARN]        at find (/usr/local/lib/node_modules/titanium/node_modules/node-appc/lib/subprocess.js:96:14)
[WARN]        at q.process (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:731:21)
[WARN]        at processImmediate (timers.js:330:15)

Fix install/uninstall permission issue

/usr/local/bin/tn -> /usr/local/lib/node_modules/tn/bin/cli.js

> [email protected] postinstall /usr/local/lib/node_modules/tn
> tn install

TiNy, version 1.0.1
Copyright (c) 2013, Fokke Zandbergen.  All Rights Reserved.

[INFO]  Installing Titanium CLI hook..
Unable to write config file /Users/zandbergen/.titanium/config.json
Please ensure the Titanium CLI has access to modify this file.

[email protected] /usr/local/lib/node_modules/tn
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])

Allow pre/post recipe commands

Not sure how this could be setup yet. Still working through a few different strategies.

Basically, I need to be able to run some to always run some other commands before I use certain recipes. (i.e. ti clean, npm install, etc)
It would be nice to be able to define pre-command(s) that I could include in a recipe that would execute before executing the primary recipe.

On node 4.x, error

Hi Fokke,
tn is very useful. But I got an error, when run tn on node 4.2.3.
( if I change node version to 0.12.x via nvm, it works properly)

/usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/node_modules/bindings/bindings.js:91
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/build/deasync.node
 → /usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/build/Debug/deasync.node
 → /usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/build/Release/deasync.node
 → /usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/out/Debug/deasync.node
 → /usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/Debug/deasync.node
 → /usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/out/Release/deasync.node
 → /usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/Release/deasync.node
 → /usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/build/default/deasync.node
 → /usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/compiled/4.2.3/darwin/x64/deasync.node
    at bindings (/usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/usr/local/lib/node_modules/tn/node_modules/appc-compat/node_modules/deasync/index.js:16:31)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/tn/node_modules/appc-compat/lib/spawn.js:5:15)
    at Module._compile (module.js:435:26)

Edit existing recipe

Each time I use: tn iphone7 I get prompted for the correct sim version to use: 6.0 or 7.0.3 - is there a way to edit the recipe? I have tried to overwrite it with a user recipe, but it appears to be just renaming it to ti.

[ERROR] Failed to encrypt JavaScript files

When run

tn --android --device --device-id LC5AZZ703556 in android device

[ERROR] Failed to encrypt JavaScript files
[ERROR] This application cannot be built with the Titanium open source SDK because it is an Appcelerator Platform registered application. Please use the Appcelerator Platform CLI tools or Appcelerator Studio to build this application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.