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

@windicss/plugin-utils

Package Overview
Dependencies
Maintainers
2
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@windicss/plugin-utils - npm Package Compare versions

Comparing version 0.10.3 to 0.10.4

4

dist/index.d.ts

@@ -202,7 +202,7 @@ import { FullConfig } from 'windicss/types/interfaces';

/**
* Use esbuild-register to load configs in TypeScript
* Use sucrase/register to load configs in ESM/TypeScript
*
* @default true
*/
enabledTypeScriptConfig?: boolean;
enableSucrase?: boolean;
}

@@ -209,0 +209,0 @@ interface ResolvedOptions {

@@ -277,2 +277,33 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __defProp = Object.defineProperty;

// src/register.ts
var _pirates = require('pirates');
var _sucrase = require('sucrase');
function addHook2(extension, options, hookOptions) {
return _pirates.addHook.call(void 0, (code, filePath) => {
const {code: transformedCode, sourceMap} = _sucrase.transform.call(void 0, code, __assign(__assign({}, options), {
sourceMapOptions: {compiledFilename: filePath},
filePath
}));
const mapBase64 = Buffer.from(JSON.stringify(sourceMap)).toString("base64");
const suffix = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${mapBase64}`;
return `${transformedCode}
${suffix}`;
}, __assign(__assign({}, hookOptions), {exts: [extension]}));
}
function registerJS(hookOptions) {
return addHook2(".js", {transforms: ["imports"]}, hookOptions);
}
function registerTS(hookOptions) {
return addHook2(".ts", {transforms: ["imports", "typescript"]}, hookOptions);
}
function registerSucrase() {
const reverts = [
registerJS(),
registerTS()
];
return () => reverts.forEach((fn) => fn());
}
// src/resolveOptions.ts

@@ -370,3 +401,3 @@ function isResolvedOptions(options) {

name = "windicss-plugin-utils",
enabledTypeScriptConfig = true
enableSucrase = true
} = utilsOptions;

@@ -395,6 +426,8 @@ const {

if (configFilePath) {
let revert = () => {
};
try {
debug("loading from ", configFilePath);
if (enabledTypeScriptConfig && configFilePath.endsWith(".ts"))
require("sucrase/register/ts");
if (enableSucrase)
revert = registerSucrase();
delete require.cache[require.resolve(configFilePath)];

@@ -410,2 +443,4 @@ resolved = require(configFilePath);

resolved = {};
} finally {
revert();
}

@@ -412,0 +447,0 @@ }

{
"name": "@windicss/plugin-utils",
"description": "Common utils for building integrations of Windi CSS",
"version": "0.10.3",
"version": "0.10.4",
"main": "dist/index.js",

@@ -34,2 +34,3 @@ "module": "dist/index.mjs",

"micromatch": "^4.0.2",
"pirates": "^4.0.1",
"sucrase": "^3.17.1",

@@ -36,0 +37,0 @@ "windicss": "^2.5.7"

Sorry, the diff of this file is not supported yet

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