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

@stylable/node

Package Overview
Dependencies
Maintainers
6
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stylable/node - npm Package Compare versions

Comparing version 5.3.1-rc.1 to 5.4.0

2

dist/find-files.d.ts
import type { IFileSystem } from '@file-services/types';
export declare type FileSystem = any;
export type FileSystem = any;
export declare function findFiles(fs: Pick<IFileSystem, 'readdirSync' | 'statSync'>, join: IFileSystem['join'], relative: IFileSystem['relative'], rootDirectory: string, ext: string, blacklist: Set<string>, useRelative?: boolean): {

@@ -4,0 +4,0 @@ result: Set<string>;

@@ -8,4 +8,5 @@ import type { StylableConfig } from '@stylable/core';

ignoreJSModules?: boolean;
configPath?: string;
}
export declare function attachHook({ matcher, afterCompile, stylableConfig, runtimePath, ignoreJSModules, }?: Partial<Options>): void;
export declare function attachHook({ matcher, afterCompile, stylableConfig, runtimePath, ignoreJSModules, configPath, }?: Partial<Options>): void;
//# sourceMappingURL=require-hook.d.ts.map

@@ -7,2 +7,3 @@ "use strict";

exports.attachHook = void 0;
const index_internal_1 = require("@stylable/core/dist/index-internal");
const module_utils_1 = require("@stylable/module-utils");

@@ -13,3 +14,17 @@ const fs_1 = __importDefault(require("fs"));

const defaultStylableMatcher = (filename) => !!filename.match(/\.st\.css$/);
function attachHook({ matcher, afterCompile, stylableConfig, runtimePath, ignoreJSModules, } = {}) {
function attachHook({ matcher, afterCompile, stylableConfig, runtimePath, ignoreJSModules, configPath, } = {}) {
let options = {
...stylableConfig,
};
try {
if (configPath) {
const { defaultConfig } = require(configPath);
const defaultConfigObj = defaultConfig(fs_1.default);
(0, index_internal_1.validateDefaultConfig)(defaultConfigObj);
options = { ...defaultConfigObj, ...options };
}
}
catch (e) {
throw new Error(`Failed to load Stylable config from ${configPath}:\n${e}`);
}
const stylableToModule = (0, module_utils_1.stylableModuleFactory)({

@@ -21,3 +36,3 @@ projectRoot: 'root',

resolverCache: new Map(),
...stylableConfig,
...options,
}, { runtimePath });

@@ -24,0 +39,0 @@ if (!matcher) {

{
"name": "@stylable/node",
"version": "5.3.1-rc.1",
"version": "5.4.0",
"description": "Integrate Stylable into your node application",

@@ -10,4 +10,4 @@ "main": "dist/index.js",

"dependencies": {
"@stylable/core": "5.3.1-rc.1",
"@stylable/module-utils": "5.3.1-rc.1",
"@stylable/core": "^5.4.0",
"@stylable/module-utils": "^5.4.0",
"find-config": "^1.0.0"

@@ -14,0 +14,0 @@ },

import type { StylableConfig } from '@stylable/core';
import { validateDefaultConfig } from '@stylable/core/dist/index-internal';
import { stylableModuleFactory } from '@stylable/module-utils';

@@ -12,2 +13,3 @@ import fs from 'fs';

ignoreJSModules?: boolean;
configPath?: string;
}

@@ -25,3 +27,21 @@

ignoreJSModules,
configPath,
}: Partial<Options> = {}) {
let options: Partial<StylableConfig> = {
...stylableConfig,
};
try {
if (configPath) {
const { defaultConfig } = require(configPath);
const defaultConfigObj = defaultConfig(fs);
validateDefaultConfig(defaultConfigObj);
options = { ...defaultConfigObj, ...options };
}
} catch (e) {
throw new Error(`Failed to load Stylable config from ${configPath}:\n${e}`);
}
const stylableToModule = stylableModuleFactory(

@@ -34,3 +54,3 @@ {

resolverCache: new Map(),
...stylableConfig,
...options,
},

@@ -37,0 +57,0 @@ { runtimePath }

Sorry, the diff of this file is not supported yet

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