Browse Source

fix build + fix inputmask in nodejs

Robin Herbots 7 years ago
parent
commit
862efde415

+ 1 - 1
Gruntfile.js

@@ -83,7 +83,7 @@ module.exports = function (grunt) {
         grunt.config('release.options.npmtag', "next");
         grunt.task.run('release');
     });
-    grunt.registerTask('validate', ['webpack:main', 'eslint']);
+    grunt.registerTask('validate', ['webpack', 'eslint']);
     grunt.registerTask('build', ['bump:prerelease', 'clean', 'webpack']);
     grunt.registerTask('build:patch', ['bump:patch', 'clean', 'webpack']);
     grunt.registerTask('build:minor', ['bump:minor', 'clean', 'webpack']);

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "5.0.0-beta.2",
+  "version": "5.0.0-beta.11",
   "main": [
 	  "./index.js",
     "./css/inputmask.css"

+ 1 - 1
bundle.jquery.js

@@ -1,5 +1,5 @@
 import "./bundle";
-import dependencyLib from "./js/dependencyLibs/inputmask.dependencyLib";
+import dependencyLib from "./lib/dependencyLibs/inputmask.dependencyLib";
 import jQuery from "jquery";
 if (dependencyLib === jQuery) {
     require("./lib/jquery.inputmask");

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
   "name": "robinherbots/inputmask",
   "description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
-  "version": "5.0.0-beta.2",
+  "version": "5.0.0-beta.11",
   "type": "library",
   "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
   "homepage": "http://robinherbots.github.io/Inputmask",

File diff suppressed because it is too large
+ 4850 - 0
dist/inputmask.bundle.js


File diff suppressed because it is too large
+ 3 - 0
dist/inputmask.bundle.min.js


File diff suppressed because it is too large
+ 333 - 1022
dist/inputmask.js


File diff suppressed because it is too large
+ 1 - 1
dist/inputmask.min.js


File diff suppressed because it is too large
+ 4604 - 0
dist/jquery.inputmask.bundle.js


File diff suppressed because it is too large
+ 3 - 0
dist/jquery.inputmask.bundle.min.js


File diff suppressed because it is too large
+ 97 - 1181
dist/jquery.inputmask.js


File diff suppressed because it is too large
+ 1 - 1
dist/jquery.inputmask.min.js


+ 1 - 1
index.js

@@ -1 +1 @@
-module.exports = require("./dist/inputmask");
+module.exports = require("./dist/inputmask.bundle");

+ 2 - 2
lib/global/window.js

@@ -1,7 +1,7 @@
 if (typeof define === "function" && define.amd)
     define(function () {
-        return window || new (eval("require('jsdom')")('')).window;
+        return typeof window !== "undefined" ? window : new (eval("require('jsdom').JSDOM"))('').window;
     });
 else if (typeof exports === "object")
-    module.exports = window || new (eval("require('jsdom')")('')).window;
+    module.exports = typeof window !== "undefined" ? window : new (eval("require('jsdom').JSDOM"))('').window;
 

+ 3 - 3
lib/inputmask.js

@@ -3219,8 +3219,8 @@
             }
         }
 
-//make inputmask available
+        //make inputmask available
+        window.Inputmask = Inputmask;
         return Inputmask;
     }
-))
-;
+));

+ 4 - 4
package.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "5.0.0-beta.2",
+  "version": "5.0.0-beta.11",
   "description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
   "main": "index.js",
   "files": [
@@ -51,6 +51,7 @@
     "grunt-webpack": "^3.1.3",
     "jqlite": "^0.2.42",
     "jquery": "^3.3.1",
+    "jsdom": "^12.0.0",
     "load-grunt-tasks": "^4.0.0",
     "loader-utils": "^1.1.0",
     "postcss": "^7.0.2",
@@ -59,9 +60,8 @@
     "qunit": "^2.6.2",
     "source-map-loader": "^0.2.4",
     "style-loader": "^0.23.0",
-    "webpack": "^4.16.3",
-    "webpack-cli": "^3.1.0",
     "uglifyjs-webpack-plugin": "^2.0.1",
-    "jsdom": "^12.0.0"
+    "webpack": "^4.16.3",
+    "webpack-cli": "^3.1.0"
   }
 }

+ 5 - 5
qunit/index.js

@@ -2,12 +2,12 @@ import "../node_modules/qunit/qunit/qunit.css";
 import "../css/inputmask.css";
 
 //extensions
-import "../js/inputmask.date.extensions";
-import "../js/inputmask.extensions";
-import "../js/inputmask.numeric.extensions";
-import "../js/jquery.inputmask";
+import "../lib/inputmask.date.extensions";
+import "../lib/inputmask.extensions";
+import "../lib/inputmask.numeric.extensions";
+import "../lib/jquery.inputmask";
 
-import Inputmask from "../js/inputmask";
+import Inputmask from "../lib/inputmask";
 
 // import "../dist/inputmask/inputmask.date.extensions";
 // import "../dist/inputmask/inputmask.extensions";

+ 4 - 2
webpack.config.js

@@ -64,8 +64,10 @@ const rules = {
 
 module.exports = {
     entry: {
-        "dist/inputmask": "./bundle.js",
-        "dist/inputmask.min": "./bundle.js",
+        "dist/inputmask": "./lib/inputmask.js",
+        "dist/inputmask.min": "./lib/inputmask.js",
+        "dist/inputmask.bundle": "./bundle.js",
+        "dist/inputmask.bundle.min": "./bundle.js",
         "qunit/qunit": "./qunit/index.js"
     },
     output: {

+ 7 - 5
webpack.jqueryconfig.js

@@ -1,17 +1,19 @@
 'use strict';
-
+let $ = require("./lib/dependencyLibs/inputmask.dependencyLib");
 let webpackconfig = require('./webpack.config');
 
-let webPackJqueryConfig = Object.assign({}, webpackconfig);
+let webPackJqueryConfig = $.extend(true, {}, webpackconfig);
 
 webPackJqueryConfig.resolve.alias = {
-    "./js/dependencyLibs/inputmask.dependencyLib": "./js/dependencyLibs/inputmask.dependencyLib.jquery",
+    "./lib/dependencyLibs/inputmask.dependencyLib": "./lib/dependencyLibs/inputmask.dependencyLib.jquery",
     "./dependencyLibs/inputmask.dependencyLib": "./dependencyLibs/inputmask.dependencyLib.jquery"
 };
 
 webPackJqueryConfig.entry = {
-    "dist/jquery.inputmask": "./bundle.jquery.js",
-    "dist/jquery.inputmask.min": "./bundle.jquery.js"
+    "dist/jquery.inputmask": "./lib/jquery.inputmask.js",
+    "dist/jquery.inputmask.min": "./lib/jquery.inputmask.js",
+    "dist/jquery.inputmask.bundle": "./bundle.jquery.js",
+    "dist/jquery.inputmask.bundle.min": "./bundle.jquery.js"
 };
 
 module.exports = webPackJqueryConfig;