@leafygreen-ui/emotion
Advanced tools
Comparing version 1.0.6 to 2.0.0
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import emotion from './emotion'; | ||
@@ -12,2 +13,3 @@ export declare const flush: () => void, hydrate: (ids: string[]) => void, cx: (...classNames: import("create-emotion").ClassNamesArg[]) => string, merge: (className: string) => string, getRegisteredStyles: (registeredStyles: string[], className: string) => string, injectGlobal: { | ||
}, sheet: import("create-emotion").StyleSheet, cache: import("create-emotion").EmotionCache; | ||
export declare const extractCritical: (html: string) => import("create-emotion-server").EmotionCritical, renderStylesToString: (html: string) => string, renderStylesToNodeStream: () => NodeJS.ReadWriteStream; | ||
export default emotion; |
{ | ||
"name": "@leafygreen-ui/emotion", | ||
"version": "1.0.6", | ||
"version": "2.0.0", | ||
"description": "leafyGreen UI Kit's Custom Instance of Emotion", | ||
"main": "./dist/index.js", | ||
"browser": "./dist/index.web.js", | ||
"main": "./dist/index.node.js", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"build": "../../node_modules/.bin/webpack --config ../../webpack.config.js", | ||
"ts:emit": "tsc --project ./tsconfig.json" | ||
"build": "../../node_modules/.bin/webpack --config ../../webpack.config.js" | ||
}, | ||
@@ -18,2 +18,3 @@ "keywords": [], | ||
"create-emotion": "^10.0.7", | ||
"create-emotion-server": "10.0.27", | ||
"emotion": "^10.0.7" | ||
@@ -20,0 +21,0 @@ }, |
import createEmotion from 'create-emotion'; | ||
// __TARGET__ is a global variable that indicates the webpack build target. | ||
// | ||
// We're typing this here because doing it globally was proving problematic. | ||
// We should solve for this if we need to use __TARGET__ elsewhere. | ||
declare const __TARGET__: 'web' | 'node'; | ||
interface CreateEmotionConfig { | ||
key: string; | ||
container?: HTMLElement; | ||
} | ||
// In case the original emotion, and create-emotion packages become unsupported, | ||
@@ -9,10 +20,13 @@ // we should consider implementing our own wrapper around createCache like what's | ||
function createEmotionInstance() { | ||
const head = document.head; | ||
const config = { | ||
container: document.createElement('div'), | ||
const config: CreateEmotionConfig = { | ||
key: 'leafygreen-ui', | ||
}; | ||
head.insertBefore(config.container, head.firstChild); | ||
if (__TARGET__ === 'web') { | ||
config.container = document.createElement('div'); | ||
const head = document.head; | ||
head.insertBefore(config.container, head.firstChild); | ||
} | ||
return createEmotion(config); | ||
@@ -19,0 +33,0 @@ } |
import emotion from './emotion'; | ||
import createEmotionServer from 'create-emotion-server'; | ||
@@ -15,2 +16,9 @@ export const { | ||
} = emotion; | ||
export const { | ||
extractCritical, | ||
renderStylesToString, | ||
renderStylesToNodeStream, | ||
} = createEmotionServer(cache); | ||
export default emotion; |
{ | ||
"extends": "../../package.tsconfig.json", | ||
"compilerOptions": { | ||
"declarationDir": "dist" | ||
"declarationDir": "dist", | ||
"rootDir": "src" | ||
}, | ||
"include": ["./**/*"] | ||
"include": ["src/**/*"] | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1010218
14
663
0
20
3
3
3
3
+ Addedbuffer-from@0.1.2(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcreate-emotion-server@10.0.27(transitive)
+ Addedduplexer2@0.1.4(transitive)
+ Addedhtml-tokenize@2.0.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.11.0.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmultipipe@1.0.2(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedobject-keys@0.4.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@1.0.342.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstring_decoder@0.10.311.1.1(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedthrough2@0.4.2(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedxtend@2.1.2(transitive)