Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
Updated package version, name and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
rnrneverdies committed Apr 7, 2017
1 parent 5038c75 commit 99cb679
Show file tree
Hide file tree
Showing 14 changed files with 117 additions and 117 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
@@ -1,2 +1,2 @@
# Make sure that manifoldjs.js file will always have LF line endings on checkout.
manifoldjs.js eol=lf
# Make sure that pwabuilder.js file will always have LF line endings on checkout.
pwabuilder.js eol=lf
14 changes: 7 additions & 7 deletions Gruntfile.js
Expand Up @@ -73,35 +73,35 @@ module.exports = function (grunt) {
tasks: ['jshint:test', 'mochaTest']
},
windows10: {
files: ['../manifoldjs-windows10/lib/*.js'],
files: ['../pwabuilder-windows10/lib/*.js'],
tasks: ['sync:windows10']
},
lib: {
files: ['../manifoldjs-lib/lib/*.js', '../manifoldjs-lib/lib/manifestTools/*.js'],
files: ['../pwabuilder-lib/lib/*.js', '../pwabuilder-lib/lib/manifestTools/*.js'],
tasks: ['sync:lib']
}
},
sync: {
windows10: {
files: [{
src: ['../manifoldjs-windows10/lib/*.js'],
dest: 'node_modules/manifoldjs-windows10'
src: ['../pwabuilder-windows10/lib/*.js'],
dest: 'node_modules/pwabuilder-windows10'
}],
verbose: true,
failOnError: true,
updateAndDelete: false
},
lib: {
files: [{
src: ['../manifoldjs-lib/lib/*.js','../manifoldjs-lib/lib/manifestTools/*.js'],
dest: 'node_modules/manifoldjs-lib'
src: ['../pwabuilder-lib/lib/*.js','../pwabuilder-lib/lib/manifestTools/*.js'],
dest: 'node_modules/pwabuilder-lib'
}],
verbose: true,
failOnError: true,
updateAndDelete: false
}
}
});
});

grunt.registerTask('jshint-all', ['jshint:js', 'jshint:test', 'jshint:gruntfile']);
grunt.registerTask('tests-all', ['mochaTest:test', 'mochaTest:html-cov', 'mochaTest:travis-cov']);
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -218,16 +218,16 @@ The W3C manifest defines a scope that restricts the URLs to which the applicatio
Releases are documented in [GitHub](https://github.com/manifoldjs/ManifoldJS/releases).

## Known Issues
- Creating the directory shortcuts to the Cordova platform-specific projects may fail when running in the Windows environment. The tool reports **_"WARNING: Failed to create shortcut for Cordova platform: XXXX."__** where **_XXXX_** is **_ios_**, **_windows_**, or **_android_**.
- Creating the directory shortcuts to the Cordova platform-specific projects may fail when running in the Windows environment. The tool reports **_"WARNING: Failed to create shortcut for Cordova platform: XXXX."__** where **_XXXX_** is **_ios_**, **_windows_**, or **_android_**.
This is caused by an issue in Node.js which has been fixed in more recent releases. To resolve this issue, upgrade Node.js to the latest version.

- Adding the **windows** platform in the Linux and Mac OS environments fails. The tool reports **_"WARNING: Failed to add the Cordova platforms: XXXX."_** where **_XXXX_** includes **_windows_**.
- Adding the **windows** platform in the Linux and Mac OS environments fails. The tool reports **_"WARNING: Failed to add the Cordova platforms: XXXX."_** where **_XXXX_** includes **_windows_**.
This is caused by an issue in the Windows platform for Cordova. Depending on the cordova-windows version, running the tool can show one of two errors: **"_Cannot find module 'Q'."_** or **"_No such file or directory."_**. Until this problem is fixed by Cordova, we've removed the windows platform from the default list when creating the app in Linux or Mac OS.

- Error when building an iOS application for projects generated in a Windows machine and then copied to an OS X machine. Xcode reports "**_Shell Script Invocation Error - Command /bin/sh failed with exit code 126_**". This happens when the execution permission (+x) is lost on some scripts when copying between the different file systems.
- Error when building an iOS application for projects generated in a Windows machine and then copied to an OS X machine. Xcode reports "**_Shell Script Invocation Error - Command /bin/sh failed with exit code 126_**". This happens when the execution permission (+x) is lost on some scripts when copying between the different file systems.

To resolve this, open a Terminal window in OS X and execute the following command to restore the executable bit on the script.
```
```
chmod +x [path to the ManifoldJS project]/cordova/platforms/ios/cordova/lib/copy-www-build-step.sh
```

Expand Down
26 changes: 13 additions & 13 deletions commands/generate.js
Expand Up @@ -5,7 +5,7 @@ var url = require('url'),

var Q = require('q');

var lib = require('xanifoldjs-lib');
var lib = require('pwabuilder-lib');

var log = lib.log,
manifestTools = lib.manifestTools,
Expand All @@ -27,7 +27,7 @@ function getW3cManifest(siteUrl, manifestLocation, manifestFormat, callback) {
return callback(undefined, manifestInfo);
}
}

if (siteUrl) {
var parsedSiteUrl = url.parse(siteUrl);
if (!parsedSiteUrl.hostname) {
Expand All @@ -46,7 +46,7 @@ function getW3cManifest(siteUrl, manifestLocation, manifestFormat, callback) {
log.info('Reading manifest file ' + manifestLocation + '...');
manifestTools.getManifestFromFile(manifestLocation, manifestFormat, resolveStartURL);
}
} else if (siteUrl) {
} else if (siteUrl) {
// scan a site to retrieve its manifest
log.info('Scanning ' + siteUrl + ' for manifest...');
manifestTools.getManifestFromSite(siteUrl, manifestFormat, resolveStartURL);
Expand All @@ -56,29 +56,29 @@ function getW3cManifest(siteUrl, manifestLocation, manifestFormat, callback) {
}

function generateApp(program) {

var siteUrl = program.args[0];
var rootDir = program.directory ? path.resolve(program.directory) : process.cwd();

var deferred = Q.defer();

function callback (err, manifestInfo) {
if (err) {
return deferred.reject(err);
}

// Fix #145: don't require a short name
manifestInfo.content.short_name = manifestInfo.content.short_name ||
manifestInfo.content.short_name = manifestInfo.content.short_name ||
manifestInfo.content.name ||
manifestInfo.default.short_name;

// if specified as a parameter, override the app's short name
if (program.shortname) {
manifestInfo.content.short_name = program.shortname;
}

log.debug('Manifest contents:\n' + JSON.stringify(manifestInfo.content, null, 4));

// add generatedFrom value to manifestInfo for telemetry
manifestInfo.generatedFrom = 'CLI';

Expand All @@ -102,7 +102,7 @@ function generateApp(program) {
if (program.build) {
program.args[1] = projectDir;
return build(program, platforms).catch(function (err) {
log.warn('One or more platforms could not be built successfully. Correct any errors and then run manifoldjs package [project-directory] [options] to build the applications.');
log.warn('One or more platforms could not be built successfully. Correct any errors and then run pwabuilder package [project-directory] [options] to build the applications.');
// return deferred.reject(err);
});
}
Expand All @@ -115,9 +115,9 @@ function generateApp(program) {
return deferred.reject(err);
});
};

getW3cManifest(siteUrl, program.manifest, program.forceManifestFormat, callback);

return deferred.promise;
};

Expand Down
10 changes: 5 additions & 5 deletions commands/open.js
Expand Up @@ -2,17 +2,17 @@

var Q = require('q');

var lib = require('xanifoldjs-lib');
var lib = require('pwabuilder-lib');

var log = lib.log,
projectBuilder = lib.projectBuilder;

function openApp (program) {

if (program.args.length < 2) {
return Q.reject(new Error('You must specify a platform.'));
}
}

var platform = program.args[1];
var projectDir = program.args.length < 3 ? process.cwd() : program.args[2];
return projectBuilder.openApp(platform, projectDir, program);
Expand Down
6 changes: 3 additions & 3 deletions commands/package.js
@@ -1,14 +1,14 @@
'use strict';

var lib = require('xanifoldjs-lib');
var lib = require('pwabuilder-lib');

var log = lib.log,
platformTools= lib.platformTools,
projectBuilder = lib.projectBuilder;

function packageApps(program, platforms) {
if (!platforms) {
platforms = program.platforms ?
platforms = program.platforms ?
program.platforms.split(/[\s,]+/) :
platformTools.listPlatforms();
}
Expand All @@ -24,7 +24,7 @@ function packageApps(program, platforms) {

log.debug('Packaging the following platforms: ' + platforms);

return projectBuilder.packageApps(platforms, projectDir, program);
return projectBuilder.packageApps(platforms, projectDir, program);
});
}

Expand Down
40 changes: 20 additions & 20 deletions commands/platform.js
Expand Up @@ -5,46 +5,46 @@ var fs = require('fs'),

var Q = require('q');

var lib = require('xanifoldjs-lib');
var lib = require('pwabuilder-lib');

var log = lib.log,
platformTools = lib.platformTools,
utils = lib.utils;

// registers a new platform module
// registers a new platform module
function addPlatform (program) {
if (program.args.length < 3) {
return Q.reject(new Error('You must specify a platform ID.'));
return Q.reject(new Error('You must specify a platform ID.'));
}

if (program.args.length < 4) {
return Q.reject(new Error('You must specify a package source for the platform. This can be an npm package, a GitHub URL, or a local path.'));
return Q.reject(new Error('You must specify a package source for the platform. This can be an npm package, a GitHub URL, or a local path.'));
}

var platformId = program.args[2].toLowerCase();
var source = program.args[3];

return platformTools.addPlatform(platformId, source).then(function () {
log.info('The \'' + platformId + '\' platform was registered successfully.');
log.info('The \'' + platformId + '\' platform was registered successfully.');
});
}

// removes a registered platform module
function removePlatform (program) {
if (program.args.length < 3) {
return Q.reject(new Error('You must specify a platform ID.'));
return Q.reject(new Error('You must specify a platform ID.'));
}

var platformId = program.args[2].toLowerCase();

return platformTools.removePlatform(platformId).then(function () {
log.info('The \'' + platformId + '\' platform was unregistered successfully.');
log.info('The \'' + platformId + '\' platform was unregistered successfully.');
});
}

function listPlatforms (program) {
try {
var platforms = platformTools.listPlatforms();
var platforms = platformTools.listPlatforms();
log.write('Available platforms are: ' + platforms.join(', '));
return Q.resolve();
}
Expand All @@ -55,25 +55,25 @@ function listPlatforms (program) {

function platformCommands (program) {
if (program.args.length < 2) {
return Q.reject(new Error('You must specify a platform operation: add, remove, or list.'));
return Q.reject(new Error('You must specify a platform operation: add, remove, or list.'));
}

var command = program.args[1].toLowerCase();
switch (command) {
case 'add':
return addPlatform(program);

case 'remove':
return removePlatform(program);

case 'list':
return listPlatforms(program);

default:
return Q.reject(new Error('Unknown option \'' + command + '\' specified.'));
}
}
}

module.exports = platformCommands;
module.exports = platformCommands;


10 changes: 5 additions & 5 deletions commands/run.js
Expand Up @@ -2,17 +2,17 @@

var Q = require('q');

var lib = require('xanifoldjs-lib');
var lib = require('pwabuilder-lib');

var log = lib.log,
projectBuilder = lib.projectBuilder;

function runApp (program) {

if (program.args.length < 2) {
return Q.reject(new Error('You must specify a platform.'));
}
}

var platform = program.args[1];
var projectDir = program.args.length < 3 ? process.cwd() : program.args[2];
return projectBuilder.runApp(platform, projectDir, program);
Expand Down
20 changes: 10 additions & 10 deletions commands/visualstudio.js
Expand Up @@ -2,7 +2,7 @@

var Q = require('q');

var lib = require('xanifoldjs-lib');
var lib = require('pwabuilder-lib');

var CustomError = lib.CustomError,
exec = lib.processTools.exec,
Expand All @@ -21,29 +21,29 @@ function getWindowsVersion (callback) {
return result.stdout.trim();
})
.catch (function (err) {
return Q.reject(new CustomError('Failed to run the app for Windows platform.', err));
return Q.reject(new CustomError('Failed to run the app for Windows platform.', err));
})
.nodeify(callback);
.nodeify(callback);
}

// implements the original behavior of the visualstudio command
// open windows10 project, if available, otherwise, open the windows project
function runApp(program) {
log.warn('The \'visualstudio\' command is deprecated. Use \'manifoldjs open <windows|windows10>\' instead.');

log.warn('The \'visualstudio\' command is deprecated. Use \'pwabuilder open <windows|windows10>\' instead.');

var deferred = Q.defer();

var dir = process.cwd();
fileTools.searchFile(dir, 'App.jsproj', function (err, results) {
Q.ninvoke(getWindowsVersion).then(function (version) {
if (results && results.length > 0 && isWindows10Version(version)) {
program.args.push('windows10');
program.args.push('windows10');
return open(program).then(function () {
deferred.resolve();
});
}

fileTools.searchFile(dir, 'CordovaApp.sln', function (err, results) {
if (results && results.length > 0) {
program.args.push('windows');
Expand All @@ -54,7 +54,7 @@ function runApp(program) {
});
});
});

return deferred.promise;
}

Expand Down
10 changes: 5 additions & 5 deletions index.js
@@ -1,17 +1,17 @@
/**
* **NOTE**: Use of manifoldjs as a library is now DEPRECATED. Use manifoldjs-lib instead.
* **NOTE**: Use of pwabuilder as a library is now DEPRECATED. Use pwabuilder-lib instead.
*
* The top-level API for `manifoldjs`. Provides access to the key libraries in
* manifoldjs so you can write your own tools using `manifoldjs` as a library.
* The top-level API for `pwabuilder`. Provides access to the key libraries in
* pwabuilder so you can write your own tools using `pwabuilder` as a library.
*
* Usage
* -----
*
* var manifoldjs = require('xanifoldjs');
* var pwabuilder = require('pwabuilder-lib');
*
*/

var lib = require('xanifoldjs-lib');
var lib = require('pwabuilder-lib');
var libValidationContants = lib.constants.validation;

// Maintain compatibility with original constant definitions
Expand Down

0 comments on commit 99cb679

Please sign in to comment.