jss-compose
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -1,4 +0,5 @@ | ||
## 1.1.0 / 2016-09-27 | ||
## 1.1.0 / 2016-09-30 | ||
- refactoring | ||
- tests integration into jss repo | ||
@@ -5,0 +6,0 @@ ## 1.0.0 / 2016-09-16 |
@@ -14,10 +14,10 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ | ||
/******/ // Create a new module (and put it into the cache) | ||
@@ -29,23 +29,23 @@ /******/ var module = installedModules[moduleId] = { | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
@@ -60,3 +60,3 @@ /******/ return __webpack_require__(0); | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -66,9 +66,9 @@ value: true | ||
exports.default = jssCompose; | ||
var _warning = __webpack_require__(1); | ||
var _warning2 = _interopRequireDefault(_warning); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -84,3 +84,3 @@ * Set class name. | ||
var refRule = rule.options.sheet.getRule(composition.substr(1)); | ||
if (!refRule) { | ||
@@ -97,3 +97,3 @@ (0, _warning2.default)(false, '[JSS] Referenced rule is not defined. \r\n%s', rule); | ||
} | ||
var container = rule.options.parent; | ||
@@ -104,3 +104,3 @@ rule.className += ' ' + composition; | ||
} | ||
/** | ||
@@ -115,6 +115,6 @@ * Convert compose property to additional class, remove property from original styles. | ||
var style = rule.style; | ||
if (!style || !style.composes) return; | ||
if (rule.options.named) { | ||
@@ -127,3 +127,3 @@ if (Array.isArray(style.composes)) { | ||
} | ||
// Remove composes property to prevent infinite loop. | ||
@@ -146,5 +146,5 @@ delete style.composes; | ||
*/ | ||
'use strict'; | ||
/** | ||
@@ -156,5 +156,5 @@ * Similar to invariant but only logs a warning if the condition is not met. | ||
*/ | ||
var warning = function() {}; | ||
if (true) { | ||
@@ -173,3 +173,3 @@ warning = function(condition, format, args) { | ||
} | ||
if (format.length < 10 || (/^[s\W]*$/).test(format)) { | ||
@@ -181,3 +181,3 @@ throw new Error( | ||
} | ||
if (!condition) { | ||
@@ -200,3 +200,3 @@ var argIndex = 0; | ||
} | ||
module.exports = warning; | ||
@@ -208,2 +208,3 @@ | ||
}); | ||
; | ||
; | ||
//# sourceMappingURL=jss-compose.js.map |
@@ -1,1 +0,2 @@ | ||
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.jssCompose=o():e.jssCompose=o()}(this,function(){return function(e){function o(s){if(t[s])return t[s].exports;var n=t[s]={exports:{},id:s,loaded:!1};return e[s].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}var t={};return o.m=e,o.c=t,o.p="",o(0)}([function(e,o,t){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function n(e,o){if("$"===o[0]){var t=e.options.sheet.getRule(o.substr(1));return t?t===e?((0,i["default"])(!1,"[JSS] Cyclic composition detected. \r\n%s",e),!1):(n(e,t.className),!0):((0,i["default"])(!1,"[JSS] Referenced rule is not defined. \r\n%s",e),!1)}var s=e.options.parent;return e.className+=" "+o,s.classes[e.name]=e.className,!0}function r(){return function(e){var o=e.style;if(o&&o.composes){if(e.options.named)if(Array.isArray(o.composes))for(var t=0;t<o.composes.length;t++)n(e,o.composes[t]);else n(e,o.composes);delete o.composes}}}Object.defineProperty(o,"__esModule",{value:!0}),o["default"]=r;var c=t(1),i=s(c)},function(e,o,t){"use strict";var s=function(){};e.exports=s}])}); | ||
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.jssCompose=o():e.jssCompose=o()}(this,function(){return function(e){function o(s){if(t[s])return t[s].exports;var n=t[s]={exports:{},id:s,loaded:!1};return e[s].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}var t={};return o.m=e,o.c=t,o.p="",o(0)}([function(e,o,t){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function n(e,o){if("$"===o[0]){var t=e.options.sheet.getRule(o.substr(1));return t?t===e?((0,i["default"])(!1,"[JSS] Cyclic composition detected. \r\n%s",e),!1):(n(e,t.className),!0):((0,i["default"])(!1,"[JSS] Referenced rule is not defined. \r\n%s",e),!1)}var s=e.options.parent;return e.className+=" "+o,s.classes[e.name]=e.className,!0}function r(){return function(e){var o=e.style;if(o&&o.composes){if(e.options.named)if(Array.isArray(o.composes))for(var t=0;t<o.composes.length;t++)n(e,o.composes[t]);else n(e,o.composes);delete o.composes}}}Object.defineProperty(o,"__esModule",{value:!0}),o["default"]=r;var c=t(1),i=s(c)},function(e,o,t){"use strict";var s=function(){};e.exports=s}])}); | ||
//# sourceMappingURL=jss-compose.min.js.map |
@@ -9,5 +9,5 @@ 'use strict'; | ||
var _index = require('./index'); | ||
var _ = require('./'); | ||
var _index2 = _interopRequireDefault(_index); | ||
var _2 = _interopRequireDefault(_); | ||
@@ -21,10 +21,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
beforeEach(function () { | ||
_index2.default.__Rewire__('warning', function (condition, message) { | ||
_2.default.__Rewire__('warning', function (condition, message) { | ||
warning = message; | ||
}); | ||
jss = (0, _jss.create)().use((0, _index2.default)()); | ||
jss = (0, _jss.create)().use((0, _2.default)()); | ||
}); | ||
afterEach(function () { | ||
_index2.default.__ResetDependency__('warning'); | ||
_2.default.__ResetDependency__('warning'); | ||
warning = undefined; | ||
@@ -31,0 +31,0 @@ }); |
{ | ||
"name": "jss-compose", | ||
"description": "JSS plugin for classes composition", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"author": { | ||
@@ -24,7 +24,11 @@ "name": "Pavel Davydov", | ||
"all": "npm run lint && npm run test && npm run build", | ||
"build": "npm run clean && npm run build:lib && npm run build:max && npm run build:min", | ||
"clean": "rimraf ./lib/*", | ||
"build": "npm run clean && npm run build:lib && npm run build:tests && npm run build:dist", | ||
"build:lib": "babel src --out-dir lib", | ||
"build:max": "cross-env NODE_ENV=development webpack src/index.js dist/jss-compose.js", | ||
"build:min": "cross-env NODE_ENV=production webpack src/index.js dist/jss-compose.min.js", | ||
"build:tests": "npm run build:tests:lib && npm run build:tests:local", | ||
"build:tests:lib": "cross-env NODE_ENV=test babel src --out-dir tests", | ||
"build:tests:local": "cross-env NODE_ENV=test webpack src/index.test.js tmp/tests.js", | ||
"build:dist": "npm run build:dist:max && npm run build:dist:min", | ||
"build:dist:max": "cross-env NODE_ENV=development webpack src/index.js dist/jss-compose.js", | ||
"build:dist:min": "cross-env NODE_ENV=production webpack src/index.js dist/jss-compose.min.js", | ||
"clean": "rimraf '{lib,dist,tests,tmp}/*'", | ||
"lint": "eslint ./src", | ||
@@ -31,0 +35,0 @@ "lint:staged": "lint-staged", |
@@ -12,3 +12,7 @@ var webpack = require('webpack') | ||
if (process.env.NODE_ENV === 'production') { | ||
plugins.push(new webpack.optimize.UglifyJsPlugin()) | ||
plugins.push(new webpack.optimize.UglifyJsPlugin({ | ||
compress: { | ||
warnings: false | ||
} | ||
})) | ||
} | ||
@@ -30,3 +34,4 @@ | ||
] | ||
} | ||
}, | ||
devtool: 'source-map' | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
63083
19
1001
0