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 - npm Package Compare versions

Comparing version 1.5.1 to 1.6.0

.travis.yml

13

index.js

@@ -130,2 +130,15 @@ var path = require('path');

// overwrite tiapp
if (newPkg['appc-npm'].tiapp) {
pkg['appc-npm'].tiapp = newPkg['appc-npm'].tiapp;
// sort for testing
pkg['appc-npm'].tiapp.sort();
}
// overwrite config
if (newPkg['appc-npm'].config) {
pkg['appc-npm'].config = newPkg['appc-npm'].config;
}
// overwrite target

@@ -132,0 +145,0 @@ if (newPkg['appc-npm'].target) {

49

lib/types/module.js
var path = require('path');
var fs = require('fs');
var registry = require('npm-stats')();
var _ = require('underscore');

@@ -62,5 +63,6 @@ var semver = require('semver');

// append files
pkg['appc-npm'].unzip.push(platformPkg['appc-npm'].unzip[0]);
pkg.files.push(platformPkg.files[1]);
// append
pkg['appc-npm'].unzip = pkg['appc-npm'].unzip.concat(platformPkg['appc-npm'].unzip);
pkg['appc-npm'].tiapp = pkg['appc-npm'].tiapp.concat(platformPkg['appc-npm'].tiapp);
pkg.files = pkg.files.concat(platformPkg.files);
}

@@ -72,7 +74,3 @@

// sort for testing
pkg['appc-npm'].unzip.sort();
pkg.files.sort();
return callback(null, pkg);
return finalize(pkg, callback);
});

@@ -82,8 +80,26 @@

// sort for testing
pkg.files.sort();
return finalize(pkg, callback);
});
};
function finalize(pkg, callback) {
// whitelist installer
pkg.files.push('appc-npm');
// sort for testing
pkg['appc-npm'].unzip.sort();
pkg.files.sort();
// check availability
return registry.module(pkg.name).info(function (err, data) {
// already exists
if (!err || err.message !== 'missing') {
pkg.name = exports.prefix + '-' + pkg.name;
}
return callback(null, pkg);
});
};
}

@@ -141,3 +157,3 @@ function analyzePlatform(basePath, platformDir, callback) {

var pkg = _.extend(_.pick(manifest, 'version', 'description', 'author', 'license'), {
name: exports.prefix + '-' + manifest.moduleid,
name: manifest.moduleid.toLowerCase(),
'appc-npm': {

@@ -148,7 +164,12 @@ target: {

},
unzip: [distPath]
unzip: [distPath],
tiapp: [{
name: manifest.moduleid,
version: manifest.version,
platform: manifest.platform
}]
},
// opposite of .npmignore
files: ['appc-npm', distPath]
files: [distPath]
});

@@ -155,0 +176,0 @@

@@ -9,3 +9,3 @@ var path = require('path');

var pkg = {
name: exports.prefix + '-' + parentDir,
name: 'alloy-theme-' + parentDir,
'appc-npm': {

@@ -12,0 +12,0 @@ target: {

var path = require('path');
var registry = require('npm-stats')();
var _ = require('underscore');

@@ -20,17 +21,35 @@

if (!widgetJson.version) {
return callback(new Error('Could not find version in widget.json'));
}
var pkg = _.extend(_.pick(widgetJson, 'version', 'description', 'author', 'license'), {
name: exports.prefix + '-' + widgetJson.id,
name: widgetJson.id,
'appc-npm': {
target: {
alloy: 'app/widgets/' + widgetJson.id
alloy: 'app/widgets/' + widgetJson.id.toLowerCase()
},
ignore: ['package.json']
ignore: ['package.json'],
config: {}
}
});
pkg['appc-npm'].config[widgetJson.id] = widgetJson.version;
if (widgetJson.tags) {
pkg.keywords = widgetJson.tags.split(/\s*,\s*/);
// sort for testing
pkg.keywords = widgetJson.tags.split(/\s*,\s*/).sort();
}
return callback(null, pkg);
// check availability
return registry.module(pkg.name).info(function (err, data) {
// already exists
if (!err || err.message !== 'missing') {
pkg.name = exports.prefix + '-' + pkg.name;
}
return callback(null, pkg);
});
};
{
"name": "appc-npm",
"version": "1.5.1",
"version": "1.6.0",
"description": "Package components for Appcelerator Titanium, Alloy and Arrow projects for distribution via NPM.",

@@ -55,5 +55,7 @@ "main": "index.js",

"glob": "^5.0.10",
"npm-stats": "^1.1.0",
"semver": "^4.3.6",
"underscore": "^1.8.3"
"underscore": "^1.8.3",
"update-notifier": "^0.5.0"
}
}

@@ -1,9 +0,9 @@

# Appcelerator NPM Distribution ![EXPERIMENTAL](https://img.shields.io/badge/status-experimental-green.svg?style=flat-square)
Package components for Appcelerator Titanium, Alloy and Arrow projects for distribution via NPM.
# Appcelerator Packager for NPM
Package [many types of components](#commands--types) for Appcelerator Titanium, Alloy and Arrow projects for distribution via NPM, including [modules](#module) and [support for nested dependencies](#support-for-nested-dependencies).
* [Browse Appcelerator Components on NPM](https://www.npmjs.com/browse/keyword/appc-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.
> **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 ![NPM](https://img.shields.io/npm/v/appc-npm.svg?style=flat-square)
## Install the packager ![NPM](https://img.shields.io/npm/v/appc-npm.svg?style=flat-square)

@@ -14,3 +14,3 @@ ```

## Package & Publish
## Package & Publish to NPM
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).

@@ -28,5 +28,5 @@

> **NOTE:** You probably want to check `package.json` before you publish and set or update [fields](https://docs.npmjs.com/files/package.json) like `description`, `homepage`, `bugs`, `license`, `repository`.
You probably want to check `package.json` before you publish and set [fields](https://docs.npmjs.com/files/package.json) like `description`, `homepage`, `bugs`, `license` and `repository`.
## Use
## Install a package from NPM

@@ -48,3 +48,5 @@ ```

## Nested dependencies
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.

@@ -72,4 +74,4 @@

## Update
Run the command again to update the packaged installer, update the version (for components like Alloy widgets) and add missing files to copy.
## 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`.

@@ -81,3 +83,3 @@ ```

## Commands/Types
## Commands / Types
You can use the following commands or types of components:

@@ -88,5 +90,5 @@

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.
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.
> **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.
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.

@@ -101,3 +103,3 @@ * [Browse Titanium modules on NPM](https://www.npmjs.com/browse/keyword/ti-module)

### `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.
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.

@@ -130,7 +132,8 @@ * [Browse Alloy widgets on NPM](https://www.npmjs.com/browse/keyword/alloy-widget)

## Test
To lint and run all tests:
## Test [![TRAVIS](https://img.shields.io/travis/FokkeZB/appc-npm.svg?style=flat-square)](https://travis-ci.org/FokkeZB/appc-npm)
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

@@ -137,0 +140,0 @@ $ npm test

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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