npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

appc-npm

v1.6.2

Published

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

Downloads

13

Readme

Appcelerator Packager for NPM

Package many types of components for Appcelerator Titanium, Alloy and Arrow projects for distribution via NPM, including modules and support for nested dependencies.

NOTE: The packager only updates/adds a package.json and appc-npm postinstall executable. It adds no dependencies and does not change your code.

Install the packager NPM

$ [sudo] npm install -g appc-npm

Package & Publish to NPM

Simply navigate to your Titanium module or library, Alloy widget, sync adapter, Arrow connector or other component and run appc-npm <type> [src] with the component type and optional path (defaulting to CWD).

$ cd myWidget

$ appc-npm widget
+ [email protected]

$ npm publish
+ [email protected]

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

Install a package from NPM

$ npm install alloy-widget-myWidget --save

> [email protected] postinstall /Users/fokkezb/myProject/node_modules/alloy-widget-myWidget
> node ./appc-npm

[email protected] node_modules/alloy-widget-myWidget

After which you'll find the widget in:

./app/widgets/myWidget

For modules and widgets the bundled installer will also update the tiapp.xml and app/config.json to add the dependency.

Support for 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

> [email protected] postinstall /Users/fokkezb/myProject/node_modules/alloy-widget-myWidget
> node ./appc-npm

> [email protected] postinstall /Users/fokkezb/myProject/node_modules/alloy-widget-myWidget/node_modules/appc-lib-xp.ui
> node ./appc-npm

[email protected] node_modules/alloy-widget-myWidget
├── [email protected]

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

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

Update a package

Run the command again to update the packaged installer and update the package.json's version (for modules and widgets) and list of files to ignore or unzip by the installer. It will not overwrite any other changes you made to the package.json.

$ appc-npm widget
+ [email protected]

Types of Components

You can package the following 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. It will check if the moduleid is available on NPM and fall back to ti-module-<moduleid> as name. It wil sum the versions of all platforms to be the package version.

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 and ignores that same file for the installer. It will check if the widget id is available on NPM and fall back to 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 Travis Dependency Status devDependency Status

To lint and run all tests you need Grunt and a recent version of NPM:

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

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

$ grunt test --test <test>

To get a coverage report:

$ grunt cover

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.