Permalink
Browse files

Add NPM support

This should (theoretically) allow `require(‘alertifyjs’)` to work when
someone using browserify installs alertifyjs via npm.

.npmignore is mostly a copy of .gitignore but also ignores html
documentation sources which is not needed in the package.

src/ is not ignored (even though src/js/ is not in a format that can be
used), in case someone wishes to import the LESS files.
  • Loading branch information...
1 parent 4d0490e commit 153a2c53a2a83d475f68605800b05a8143de5b90 @dantman dantman committed Feb 17, 2015
Showing with 53 additions and 10 deletions.
  1. +30 −0 .npmignore
  2. +4 −0 RELEASENOTES.md
  3. +8 −4 build/alertify.js
  4. +2 −2 build/alertify.min.js
  5. +2 −1 package.json
  6. +7 −3 src/js/outro.js
View
@@ -0,0 +1,30 @@
+#docsite
+site
+#staging
+staging
+
+
+# Logs
+logs
+*.log
+
+# Runtime data
+pids
+*.pid
+*.seed
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Compiled binary addons (http://nodejs.org/api/addons.html)
+build/Release
+
+# Documentation
+docpad
+docpad.coffee
View
@@ -1,4 +1,8 @@
# Release Notes
+* **v1.1.1** [17 Feb. 2015]
+ * Support installation via `npm install alertifyjs --save`.
+ * Support use of `require('alertifyjs')` in loaders such as Browserify.
+
* **v1.1.0** [24 Jan. 2015]
* New API event hooks for dialog developers (onshow, onclose, onupdate)
* Support move for frameless dialogs.
View
@@ -7,7 +7,7 @@
* @license MIT <http://opensource.org/licenses/mit-license.php>
* @link http://alertifyjs.com
* @module AlertifyJS
- * @version 1.1.0
+ * @version 1.1.1
*/
( function ( window ) {
'use strict';
@@ -3245,13 +3245,17 @@
};
});
- // AMD and window support
- if ( typeof define === 'function' ) {
+ // CommonJS
+ if ( typeof module === 'object' && typeof module.exports === 'object' ) {
+ module.exports = alertify;
+ // AMD
+ } else if ( typeof define === 'function' ) {
define( [], function () {
return alertify;
} );
+ // window
} else if ( !window.alertify ) {
window.alertify = alertify;
}
-} ( this ) );
+} ( typeof window !== "undefined" ? window : this ) );
Oops, something went wrong.
View
@@ -1,6 +1,6 @@
{
"name": "AlertifyJS",
- "version": "1.1.0",
+ "version": "1.1.1",
"description": "AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.",
"homepage": "http://alertifyjs.com",
"keywords": [
@@ -21,6 +21,7 @@
"type": "git",
"url": "git@github.com:MohammadYounes/AlertifyJS.git"
},
+ "main": "./build/alertify.js",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-cli": "~0.1",
View
@@ -1,10 +1,14 @@
- // AMD and window support
- if ( typeof define === 'function' ) {
+ // CommonJS
+ if ( typeof module === 'object' && typeof module.exports === 'object' ) {
+ module.exports = alertify;
+ // AMD
+ } else if ( typeof define === 'function' ) {
define( [], function () {
return alertify;
} );
+ // window
} else if ( !window.alertify ) {
window.alertify = alertify;
}
-} ( this ) );
+} ( typeof window !== "undefined" ? window : this ) );

0 comments on commit 153a2c5

Please sign in to comment.