Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appc-npm

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appc-npm

Package components for Appcelerator Titanium, Alloy and Arrow projects for distribution via NPM.

  • 1.5.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Appcelerator NPM Distribution EXPERIMENTAL

Package components for Appcelerator Titanium, Alloy and Arrow projects for distribution via NPM.

  • Browse Appcelerator Components on NPM

NOTE: Running appc-npm <type> for your component only updates/adds a package.json and appc-npm postinstall executable. It adds no dependencies and does not change your code.

Install NPM

$ [sudo] npm install -g appc-npm

Package & Publish

Simply navigate to your Titanium module or library, Alloy widget, sync adapter, Arrow connector or other component and run the CLI with the command for that component and optional path (defaulting to CWD).

$ cd mywidget

$ appc-npm widget
+ alloy-widget-myWidget@1.0.0

$ npm publish
+ alloy-widget-myWidget@1.0.0

NOTE: You probably want to check package.json before you publish and set or update fields like description, homepage, bugs, license, repository.

Use

$ npm install alloy-widget-myWidget --save

> alloy-widget-myWidget@1.0.0 postinstall /Users/fokkezb/myProject/node_modules/alloy-widget-myWidget
> node ./appc-npm

alloy-widget-myWidget@1.0.0 node_modules/alloy-widget-myWidget

After which you'll find the widget in:

./app/widgets/myWidget

Nested dependencies

You can add dependencies to other Appcelerator dependencies on NPM to the package.json of your packaged component. So if your Alloy widget depends on a library, module or other widget then you can install them all in one go.

$ npm install alloy-widget-myWidget --save

> alloy-widget-myWidget@1.0.0 postinstall /Users/fokkezb/myProject/node_modules/alloy-widget-myWidget
> node ./appc-npm

> appc-lib-xp.ui@1.0.0 postinstall /Users/fokkezb/myProject/node_modules/alloy-widget-myWidget/node_modules/appc-lib-xp.ui
> node ./appc-npm

alloy-widget-myWidget@1.0.0 node_modules/alloy-widget-myWidget
├── appc-lib-xp.ui@1.0.0

After which you'll find the widget and the lib it depends on in:

./app/widgets/myWidget
./app/lib/xp.ui.js

Update

Run the command again to update the packaged installer, update the version (for components like Alloy widgets) and add missing files to copy.

$ appc-npm widget
+ alloy-widget-myWidget@1.0.1

Commands/Types

You can use the following commands or types of components:

module

Titanium modules. Run it in the folder above the platform folders to package the most recent distribution ZIP file of each platform. Run it in a platform folder to package only that one.

Reads the manifest to populate the package.json, using ti-module-<moduleid> as name. It wil sum the versions of all platforms to be the package version.

NOTE: Only the most recent ZIP file of each platform and the appc-npm installer are added to the package.json's files property so that only these will be packaged and published to NPM and not the full module source.

lib

Titanium, Alloy or Arrow CommonJS libraries. Searches for the first .js and uses alloy-sync-<filename> as the package name and 1.0.0 for the version. All other files are ignored for the installer.

widget

Alloy Widgets. Uses widget.json to populate the package.json, ignores that same file for the installer and uses alloy-widget-<id> as the package name.

sync

Alloy sync adapters. Searches for the first .js and uses alloy-sync-<filename> as the package name and 1.0.0 for the version. All other files are ignored for the installer.

theme

Alloy themes. Uses alloy-sync-<dirname> as the package name and 1.0.0 for the version. It ignores the generated package.json for the installer.

connector

Arrow connectors. Searches for package.json to determine the target for the installer and will update the file with the postinstall script and appc-npm property, leaving the name and version as it is.

block

Arrow post or pre-blocks. Searches for the first .js to determine the base path and adds that file to the list of paths to copy to the project. The default package name is arrow-block-<filename> and version is 1.0.0.

Module API

You can also require appc-npm as a module, which is exactly what the CLI does.

Test

To lint and run all tests:

$ [sudo] npm install -g grunt
$ npm install
$ npm test

To run a specific test by name (without -test.js):

$ grunt test --test <test>

Contribute

To add new types of components, provide a PR with a type, fixture and test.

Issues

Please report issues and features requests in the repo's issue tracker.

License

Distributed under MIT License.

Keywords

FAQs

Package last updated on 19 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc