pretty-lights
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -8,24 +8,7 @@ "use strict"; | ||
exports.omit = omit; | ||
Object.defineProperty(exports, "getIdentifierName", { | ||
enumerable: true, | ||
get: function () { | ||
return _babelUtils.getLabelFromPath; | ||
} | ||
}); | ||
Object.defineProperty(exports, "appendStringToExpressions", { | ||
enumerable: true, | ||
get: function () { | ||
return _babelUtils.appendStringToExpressions; | ||
} | ||
}); | ||
var _path = _interopRequireDefault(require("path")); | ||
var _babelUtils = require("@emotion/babel-utils"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// @flow | ||
// import type { BabelPath, EmotionBabelPluginPass } from './index' | ||
// import type { Types, Identifier } from 'babel-flow-types' | ||
function getLabel(identifierName, autoLabel, labelFormat, filename) { | ||
@@ -32,0 +15,0 @@ if (!identifierName || !autoLabel) return null; // Valid Characters in CSS Class Names Selecter |
@@ -28,3 +28,2 @@ "use strict"; | ||
// import type { Node, Identifier, BabelPluginPass, Types, Babel } from 'babel-flow-types'; | ||
// export type BabelPath = any; | ||
@@ -64,3 +63,3 @@ function hashArray(arr) { | ||
try { | ||
const identifierName = (0, _babelUtils2.getIdentifierName)(path, t); | ||
const identifierName = (0, _babelUtils.getLabelFromPath)(path, t); | ||
@@ -83,3 +82,3 @@ if (!removePath) { | ||
path.replaceWith(t.callExpression(identifier, (0, _babelUtils2.appendStringToExpressions)((0, _babelUtils.getExpressionsFromTemplateLiteral)(path.node.quasi, t), stringToAppend, t))); | ||
path.replaceWith(t.callExpression(identifier, (0, _babelUtils.appendStringToExpressions)((0, _babelUtils.getExpressionsFromTemplateLiteral)(path.node.quasi, t), stringToAppend, t))); | ||
@@ -154,3 +153,3 @@ if (state.opts.hoist) { | ||
const restArgs = args.slice(2); | ||
const identifierName = (0, _babelUtils2.getIdentifierName)(path, t); | ||
const identifierName = (0, _babelUtils.getLabelFromPath)(path, t); | ||
const targetProperty = buildTargetObjectProperty(path, state, t); | ||
@@ -173,3 +172,3 @@ path.addComment('leading', '#__PURE__'); | ||
const styledCall = t.isStringLiteral(tag) && !isCallExpression && tag.value[0] !== tag.value[0].toLowerCase() ? t.memberExpression(identifier, t.identifier(tag.value)) : t.callExpression(identifier, [tag, finalOptions, ...restArgs]); | ||
return t.callExpression(styledCall, (0, _babelUtils2.appendStringToExpressions)((0, _babelUtils.getExpressionsFromTemplateLiteral)(path.node.quasi, t), stringToAppend, t)); | ||
return t.callExpression(styledCall, (0, _babelUtils.appendStringToExpressions)((0, _babelUtils.getExpressionsFromTemplateLiteral)(path.node.quasi, t), stringToAppend, t)); | ||
} | ||
@@ -179,3 +178,3 @@ | ||
const targetProperty = buildTargetObjectProperty(path, state, t); | ||
const identifierName = (0, _babelUtils2.getIdentifierName)(path, t); | ||
const identifierName = (0, _babelUtils.getLabelFromPath)(path, t); | ||
const tag = t.isCallExpression(path.node.callee) ? path.node.callee.arguments[0] : t.stringLiteral(path.node.callee.property.name); | ||
@@ -380,3 +379,3 @@ const isCallExpression = t.isCallExpression(path.node.callee); | ||
path.addComment('leading', '#__PURE__'); | ||
const label = (0, _babelUtils2.getLabel)((0, _babelUtils2.getIdentifierName)(path, t), state.opts.autoLabel, state.opts.labelFormat, state.file.opts.filename); | ||
const label = (0, _babelUtils2.getLabel)((0, _babelUtils.getLabelFromPath)(path, t), state.opts.autoLabel, state.opts.labelFormat, state.file.opts.filename); | ||
@@ -383,0 +382,0 @@ if (label) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
const emotion = process.env.NODE_ENV === 'test' ? require('../src') : require('../lib'); | ||
const emotion = process.env.PRETTY_LIGHTS_TEST ? require('../src') : require('../lib'); | ||
module.exports = createSerializer(emotion); |
{ | ||
"name": "pretty-lights", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "CSS-in-JS with a reliable API", | ||
@@ -38,4 +38,8 @@ "main": "lib/pretty-lights.js", | ||
"@emotion/weak-memoize": "0.2.4", | ||
"chalk": "2.4.2", | ||
"convert-source-map": "1.6.0", | ||
"css": "2.2.4", | ||
"find-root": "1.1.0", | ||
"hoist-non-react-statics": "3.3.0", | ||
"hoist-non-react-statics": "^3.3.0", | ||
"source-map": "0.7.3", | ||
"stylis": "^3.5.4", | ||
@@ -46,4 +50,4 @@ "stylis-rule-sheet": "^0.0.10" | ||
"prop-types": "^15.7.2", | ||
"react": "^16.3.2", | ||
"react-dom": "^16.3.2" | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6" | ||
}, | ||
@@ -59,5 +63,2 @@ "devDependencies": { | ||
"babel-plugin-codegen": "3.0.0", | ||
"chalk": "2.4.2", | ||
"convert-source-map": "1.6.0", | ||
"css": "2.2.4", | ||
"cssjanus": "1.3.2", | ||
@@ -87,7 +88,6 @@ "enzyme": "3.10.0", | ||
"prop-types": "^15.7.2", | ||
"react": "^16.3.2", | ||
"react-dom": "^16.3.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"react-test-renderer": "16.10.2", | ||
"rimraf": "3.0.0", | ||
"source-map": "0.7.3", | ||
"touch": "3.1.0" | ||
@@ -103,4 +103,4 @@ }, | ||
"prepare": "npm run build", | ||
"test": "npm run build:dev && jest", | ||
"test-update": "npm run build:dev && jest -u", | ||
"test": "npm run build:dev && PRETTY_LIGHTS_TEST=1 jest", | ||
"test-update": "npm run build:dev && PRETTY_LIGHTS_TEST=1 jest -u", | ||
"lint": "eslint .", | ||
@@ -107,0 +107,0 @@ "lint-fix": "eslint . --fix" |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
37
181481
18
796
+ Addedchalk@2.4.2
+ Addedconvert-source-map@1.6.0
+ Addedcss@2.2.4
+ Addedsource-map@0.7.3
+ Addedansi-styles@3.2.1(transitive)
+ Addedatob@2.1.2(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedconvert-source-map@1.6.0(transitive)
+ Addedcss@2.2.4(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedhoist-non-react-statics@3.3.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedresolve-url@0.2.1(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsource-map@0.6.10.7.3(transitive)
+ Addedsource-map-resolve@0.5.3(transitive)
+ Addedsource-map-url@0.4.1(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedurix@0.1.0(transitive)
- Removedconvert-source-map@1.9.0(transitive)
- Removedhoist-non-react-statics@3.3.0(transitive)
- Removedsource-map@0.7.4(transitive)