New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mattsjones/css-babel-plugin

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mattsjones/css-babel-plugin - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

6

CHANGELOG.md
# @mattsjones/css-babel-plugin
## 0.0.7
### Patch Changes
- bf2f380: Add debug ID to `createVar` calls, detect global style calls
## 0.0.6

@@ -4,0 +10,0 @@

22

dist/declarations/src/index.d.ts
import { PluginObj, PluginPass } from '@babel/core';
declare const exportConfig: {
style: {
maxParams: number;
};
createTheme: {
maxParams: number;
};
mapToStyles: {
maxParams: number;
};
fontFace: {
maxParams: number;
};
keyframes: {
maxParams: number;
};
};
declare type RelevantExport = keyof typeof exportConfig;
declare const styleFunctions: string[];
declare type StyleFunction = typeof styleFunctions[number];
interface PluginOptions {

@@ -27,3 +11,3 @@ alias?: string;

namespaceImport: string;
importIdentifiers: Map<string, RelevantExport>;
importIdentifiers: Map<string, StyleFunction>;
packageIdentifier: string;

@@ -30,0 +14,0 @@ fileScope: string;

@@ -17,3 +17,3 @@ 'use strict';

`);
const exportConfig = {
const debuggableFunctionConfig = {
style: {

@@ -33,5 +33,8 @@ maxParams: 2

maxParams: 2
},
createVar: {
maxParams: 1
}
};
const relevantExports = Object.keys(exportConfig);
const styleFunctions = [...Object.keys(debuggableFunctionConfig), 'globalStyle', 'createGlobalTheme', 'createThemeVars', 'globalFontFace', 'globalKeyframes'];

@@ -83,3 +86,3 @@ const extractName = node => {

})) {
return relevantExports.find(exportName => core.types.isIdentifier(callee.property, {
return styleFunctions.find(exportName => core.types.isIdentifier(callee.property, {
name: exportName

@@ -150,3 +153,3 @@ }));

if (relevantExports.includes(importName)) {
if (styleFunctions.includes(importName)) {
this.importIdentifiers.set(local.name, importName);

@@ -165,4 +168,4 @@ }

if (usedExport) {
if (node.arguments.length < exportConfig[usedExport].maxParams) {
if (usedExport && usedExport in debuggableFunctionConfig) {
if (node.arguments.length < debuggableFunctionConfig[usedExport].maxParams) {
const debugIdent = getDebugId(path);

@@ -169,0 +172,0 @@

@@ -17,3 +17,3 @@ 'use strict';

`);
const exportConfig = {
const debuggableFunctionConfig = {
style: {

@@ -33,5 +33,8 @@ maxParams: 2

maxParams: 2
},
createVar: {
maxParams: 1
}
};
const relevantExports = Object.keys(exportConfig);
const styleFunctions = [...Object.keys(debuggableFunctionConfig), 'globalStyle', 'createGlobalTheme', 'createThemeVars', 'globalFontFace', 'globalKeyframes'];

@@ -83,3 +86,3 @@ const extractName = node => {

})) {
return relevantExports.find(exportName => core.types.isIdentifier(callee.property, {
return styleFunctions.find(exportName => core.types.isIdentifier(callee.property, {
name: exportName

@@ -150,3 +153,3 @@ }));

if (relevantExports.includes(importName)) {
if (styleFunctions.includes(importName)) {
this.importIdentifiers.set(local.name, importName);

@@ -165,4 +168,4 @@ }

if (usedExport) {
if (node.arguments.length < exportConfig[usedExport].maxParams) {
if (usedExport && usedExport in debuggableFunctionConfig) {
if (node.arguments.length < debuggableFunctionConfig[usedExport].maxParams) {
const debugIdent = getDebugId(path);

@@ -169,0 +172,0 @@

@@ -9,3 +9,3 @@ import { relative } from 'path';

`);
const exportConfig = {
const debuggableFunctionConfig = {
style: {

@@ -25,5 +25,8 @@ maxParams: 2

maxParams: 2
},
createVar: {
maxParams: 1
}
};
const relevantExports = Object.keys(exportConfig);
const styleFunctions = [...Object.keys(debuggableFunctionConfig), 'globalStyle', 'createGlobalTheme', 'createThemeVars', 'globalFontFace', 'globalKeyframes'];

@@ -75,3 +78,3 @@ const extractName = node => {

})) {
return relevantExports.find(exportName => types.isIdentifier(callee.property, {
return styleFunctions.find(exportName => types.isIdentifier(callee.property, {
name: exportName

@@ -142,3 +145,3 @@ }));

if (relevantExports.includes(importName)) {
if (styleFunctions.includes(importName)) {
this.importIdentifiers.set(local.name, importName);

@@ -157,4 +160,4 @@ }

if (usedExport) {
if (node.arguments.length < exportConfig[usedExport].maxParams) {
if (usedExport && usedExport in debuggableFunctionConfig) {
if (node.arguments.length < debuggableFunctionConfig[usedExport].maxParams) {
const debugIdent = getDebugId(path);

@@ -161,0 +164,0 @@

{
"name": "@mattsjones/css-babel-plugin",
"version": "0.0.6",
"version": "0.0.7",
"main": "dist/mattsjones-css-babel-plugin.cjs.js",

@@ -5,0 +5,0 @@ "module": "dist/mattsjones-css-babel-plugin.esm.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc