cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [16/16] cordova-windows git commit: CB-9252: Migrate WinJS to an NPM dependency
Date Fri, 26 Jun 2015 17:01:38 GMT
CB-9252: Migrate WinJS to an NPM dependency

This change puts the current WinJS NPM package into the node_modules
directory as well as package.json (for "npm install" support).  It then
modifies the create step to copy WinJS into the platform template
directory.


Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/99107c62
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/99107c62
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/99107c62

Branch: refs/heads/master
Commit: 99107c6277b39edc87e65547c558ef099cd40f0e
Parents: 9444b09
Author: Rob Paveza <Rob.Paveza@microsoft.com>
Authored: Thu Jun 25 15:13:22 2015 -0700
Committer: Rob Paveza <Rob.Paveza@microsoft.com>
Committed: Fri Jun 26 09:46:46 2015 -0700

----------------------------------------------------------------------
 LICENSE                                         |     2 +-
 bin/lib/create.js                               |    23 +
 cordova-js-src/platform.js                      |     2 +-
 node_modules/winjs/License.txt                  |    13 +
 node_modules/winjs/README.md                    |    62 +
 node_modules/winjs/css/ui-dark.css              |  7304 +++
 node_modules/winjs/css/ui-dark.min.css          |     1 +
 node_modules/winjs/css/ui-light.css             |  7304 +++
 node_modules/winjs/css/ui-light.min.css         |     1 +
 node_modules/winjs/fonts/Symbols.ttf            |   Bin 0 -> 47488 bytes
 .../winjs/js/WinJS.intellisense-setup.js        |    30 +
 node_modules/winjs/js/WinJS.intellisense.js     |   195 +
 node_modules/winjs/js/base.js                   | 26523 ++++++++
 node_modules/winjs/js/base.min.js               |    12 +
 node_modules/winjs/js/base.min.js.map           |     1 +
 node_modules/winjs/js/en-US/ui.strings.js       |   523 +
 node_modules/winjs/js/ui.js                     | 54913 +++++++++++++++++
 node_modules/winjs/js/ui.min.js                 |    29 +
 node_modules/winjs/js/ui.min.js.map             |     1 +
 node_modules/winjs/package.json                 |    85 +
 package.json                                    |     6 +-
 template/WinJS/js/base.js                       | 26488 --------
 template/www/cordova.js                         |     2 +-
 23 files changed, 97027 insertions(+), 26493 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/99107c62/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index e7c5c24..7d7ad1f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -204,7 +204,7 @@
  ADDITIONAL LICENSES:
 
 ================================================================================
-/template/WinJS/js/base.js
+/node_modules/winjs
 ================================================================================
 
 WinJS

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/99107c62/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index bc07b78..8ebd1f8 100644
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -77,6 +77,13 @@ module.exports.run = function (argv) {
         shell.cp('-rf', templateOverrides, projectPath);
     }
 
+    // Copy base.js into the target project directory
+    var destinationDirectory = path.join(projectPath, 'platform_www', 'WinJS', 'js');
+    var destBaseJsPath = path.join(destinationDirectory, 'base.js');
+    var srcBaseJsPath = path.join(root, 'node_modules', 'winjs', 'js', 'base.js');
+    recursiveCreateDirectory(destinationDirectory);
+    shell.cp('-f', srcBaseJsPath, destBaseJsPath);
+
     // replace specific values in manifests' templates
     ['package.windows.appxmanifest', 'package.windows80.appxmanifest', 'package.phone.appxmanifest',
'package.windows10.appxmanifest'].forEach(function (file) {
         var fileToReplace = path.join(projectPath, file);
@@ -98,6 +105,22 @@ module.exports.run = function (argv) {
     return Q.resolve();
 };
 
+function recursiveCreateDirectory(targetPath, previousPath) {
+    if (previousPath === targetPath) {
+        // Shouldn't ever happen because we're already in a created directory
+        // This is just here to prevent any potential infinite loop / stack overflow condition
+        console.warn('Could not create a directory because its root was never located.');
+        return;
+    }
+
+    var parent = path.join(targetPath, '..');
+    if (!fs.existsSync(parent)) {
+        recursiveCreateDirectory(parent, targetPath);
+    }
+
+    fs.mkdirSync(targetPath);
+}
+
 module.exports.help = function () {
     console.log('Usage: create PathToProject [ PackageName [ AppName [ CustomTemplate ] ]
] [--guid=<GUID string>]');
     console.log('    PathToProject : The path to where you wish to create the project');

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/99107c62/cordova-js-src/platform.js
----------------------------------------------------------------------
diff --git a/cordova-js-src/platform.js b/cordova-js-src/platform.js
index 5fe11eb..d41a395 100644
--- a/cordova-js-src/platform.js
+++ b/cordova-js-src/platform.js
@@ -52,7 +52,7 @@ module.exports = {
 
             if (navigator.appVersion.indexOf('MSAppHost/3.0') !== -1) {
                 // Windows 10 UWP
-                scriptElem.src = '/WinJS/js/base.js';
+                scriptElem.src = '/www/WinJS/js/base.js';
             } else if (navigator.appVersion.indexOf("Windows Phone 8.1;") !== -1) {
                 // windows phone 8.1 + Mobile IE 11
                 scriptElem.src = "//Microsoft.Phone.WinJS.2.1/js/base.js";

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/99107c62/node_modules/winjs/License.txt
----------------------------------------------------------------------
diff --git a/node_modules/winjs/License.txt b/node_modules/winjs/License.txt
new file mode 100644
index 0000000..baf9dc1
--- /dev/null
+++ b/node_modules/winjs/License.txt
@@ -0,0 +1,13 @@
+WinJS
+
+Copyright (c) Microsoft Corporation
+
+All rights reserved. 
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the ""Software""), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/99107c62/node_modules/winjs/README.md
----------------------------------------------------------------------
diff --git a/node_modules/winjs/README.md b/node_modules/winjs/README.md
new file mode 100644
index 0000000..aab5fb5
--- /dev/null
+++ b/node_modules/winjs/README.md
@@ -0,0 +1,62 @@
+Windows Library for JavaScript (WinJS)
+=====
+ [![Build Status](https://travis-ci.org/winjs/winjs.svg?branch=master)](https://travis-ci.org/winjs/winjs)
+ 
+This project is actively developed by the WinJS developers working for Microsoft Corporation,
in collaboration with the community of open source developers. Together we are dedicated to
creating the best possible solution for HTML/JS/CSS application development.
+
+WinJS is a set of JavaScript toolkits that allow developers to build applications using HTML/JS/CSS
technology forged with the following principles in mind:
+
+* Provide developers with a distinctive set of UI controls with high polish and performance
with fundamental support for touch, mouse, keyboard and accessibility
+* Provide developers with a cohesive set of components and utilities to build the scaffolding
and infrastructure of their applications
+
+This is a first step for the WinJS project and there is still a lot of work that needs to
be done. So please check out the [roadmap](https://github.com/winjs/winjs/wiki/Roadmap) to
see where the project is headed or participate by [contributing](https://github.com/winjs/winjs/wiki/Contribute)
along the way.
+
+# Contribute
+There are many ways to [contribute](https://github.com/winjs/winjs/blob/master/CONTRIBUTING.md)
to the project.
+
+You can contribute by reviewing and sending feedback on code checkins, suggesting and trying
out new features as they are implemented, submitting bugs and helping us verify fixes as they
are checked in, as well as submitting code fixes or code contributions of your own.
+
+Note that all code submissions will be rigorously reviewed and tested by the team, and only
those that meet an extremely high bar for both quality and design/roadmap appropriateness
will be merged into the source.
+
+# Roadmap
+The source code on this repo is under active development that will be part of our next release.
For details on our planned features and future direction, please refer to our [roadmap](https://github.com/winjs/winjs/wiki/Roadmap).
+
+# Build WinJS
+In order to build WinJS, ensure that you have [git](http://git-scm.com/downloads) and [Node.js](http://nodejs.org/download/)
installed.
+
+Clone a copy of the master WinJS git repo:
+```
+git clone https://github.com/winjs/winjs.git
+```
+
+Change to the `winjs` directory:
+```
+cd winjs
+```
+
+Install the [grunt command-line interface](https://github.com/gruntjs/grunt-cli) globally:
+```
+npm install -g grunt-cli
+```
+
+Grunt dependencies are installed separately in each cloned git repo. Install the dependencies
with:
+```
+npm install
+```
+
+Run the following and the WinJS JavaScript and CSS files will be put in the `bin` directory:
+```
+grunt
+```
+
+> **Note:** You may need to use sudo (for OSX, *nix, BSD etc) or run your command shell
as Administrator (for Windows) to install Grunt globally.
+
+# Tests status
+Refer to http://try.buildwinjs.com/#status for the current status of the unit tests and the
list of known issues.
+
+# Try WinJS
+Check out our online playground http://try.buildwinjs.com
+
+# Follow Us
+Twitter https://twitter.com/BuildWinJS  
+Facebook https://www.facebook.com/buildwinjs


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message