@stylable/node
Advanced tools
Comparing version 5.3.1-rc.1 to 5.4.0
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
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
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 v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
23626
325
1
6
+ Added@stylable/core@5.19.0(transitive)
+ Added@stylable/module-utils@5.19.0(transitive)
+ Added@tokey/css-value-parser@0.1.4(transitive)
+ Added@tokey/imports-parser@1.0.0(transitive)
- Removed@stylable/core@5.3.1-rc.1(transitive)
- Removed@stylable/module-utils@5.3.1-rc.1(transitive)
- Removed@tokey/imports-parser@0.1.2(transitive)
- Removeddeindent@0.1.0(transitive)
Updated@stylable/core@^5.4.0