Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stylable/module-utils

Package Overview
Dependencies
Maintainers
5
Versions
193
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stylable/module-utils - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

2

cjs/module-source.d.ts
import { StylableResults } from '@stylable/core';
export declare function generateModuleSource(stylableResult: StylableResults, moduleId: string, beforeModule: string[], renderer: string, createFunction: string, createRenderableFunction: string, css: string, depth: string, exportsArgument: string, afterModule: string, renderableOnly?: boolean): string;
export declare function createModuleSource(stylableResult: StylableResults, moduleFormat: string | undefined, includeCSSInJS: boolean, moduleId?: string, renderableOnly?: boolean, depth?: string | number, staticRequests?: string[]): string;
export declare function createModuleSource(stylableResult: StylableResults, moduleFormat: string | undefined, includeCSSInJS: boolean, moduleId?: string, renderableOnly?: boolean, depth?: string | number, staticRequests?: string[], runtimeRequest?: string): string;
//# sourceMappingURL=module-source.d.ts.map

@@ -14,3 +14,3 @@ "use strict";

exports.generateModuleSource = generateModuleSource;
function createModuleSource(stylableResult, moduleFormat, includeCSSInJS, moduleId, renderableOnly, depth, staticRequests) {
function createModuleSource(stylableResult, moduleFormat, includeCSSInJS, moduleId, renderableOnly, depth, staticRequests, runtimeRequest) {
if (moduleFormat === void 0) { moduleFormat = 'cjs'; }

@@ -21,2 +21,3 @@ if (moduleId === void 0) { moduleId = JSON.stringify(stylableResult.meta.namespace); }

if (staticRequests === void 0) { staticRequests = []; }
if (runtimeRequest === void 0) { runtimeRequest = '@stylable/runtime'; }
// TODO: calc depth for node as well

@@ -34,7 +35,7 @@ depth = typeof depth === 'number' ? depth.toString() : depth;

return generateModuleSource(stylableResult, moduleId, staticRequests.map(function (request) { return "import " + JSON.stringify(request); }).concat([
"import { $, " + importKey + " } from " + JSON.stringify('@stylable/runtime')
"import { $, " + importKey + " } from " + JSON.stringify(runtimeRequest)
]), "$", "create", "createRenderable", includeCSSInJS ? JSON.stringify(stylableResult.meta.outputAst.toString()) : '""', depth, 'const { classes, keyframes, vars, stVars, cssStates, style, st, $depth, $id, $css }', "export { classes, keyframes, vars, stVars, cssStates, style, st, $depth, $id, $css };", renderableOnly);
case 'cjs':
return generateModuleSource(stylableResult, moduleId, staticRequests.map(function (request) { return "require(" + JSON.stringify(request) + ")"; }).concat([
"const runtime = require(" + JSON.stringify('@stylable/runtime') + ")"
"const runtime = require(" + JSON.stringify(runtimeRequest) + ")"
]), "runtime.$", "runtime.create", "runtime.createRenderable", includeCSSInJS ? JSON.stringify(stylableResult.meta.outputAst.toString()) : '""', depth, 'module.exports', '', renderableOnly);

@@ -41,0 +42,0 @@ }

{
"name": "@stylable/module-utils",
"version": "2.2.1",
"version": "2.2.2",
"description": "Stylable module creation utilities",

@@ -27,3 +27,3 @@ "main": "cjs/index.js",

"license": "BSD-3-Clause",
"gitHead": "0f3682cc13ba8ba076518f8ecc21bc373a20d61e"
"gitHead": "4666c8c1e3d320d678e4c78b502ce33f2dc9bb2b"
}

@@ -43,3 +43,4 @@ import { StylableResults } from '@stylable/core';

depth: string | number = '-1',
staticRequests: string[] = []
staticRequests: string[] = [],
runtimeRequest: string = '@stylable/runtime'
) {

@@ -64,3 +65,3 @@ // TODO: calc depth for node as well

...staticRequests.map(request => `import ${JSON.stringify(request)}`),
`import { $, ${importKey} } from ${JSON.stringify('@stylable/runtime')}`
`import { $, ${importKey} } from ${JSON.stringify(runtimeRequest)}`
],

@@ -82,3 +83,3 @@ `$`,

...staticRequests.map(request => `require(${JSON.stringify(request)})`),
`const runtime = require(${JSON.stringify('@stylable/runtime')})`
`const runtime = require(${JSON.stringify(runtimeRequest)})`
],

@@ -85,0 +86,0 @@ `runtime.$`,

Sorry, the diff of this file is not supported yet

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