@stylable/core
Advanced tools
Comparing version 1.0.7 to 1.1.0
@@ -25,2 +25,3 @@ "use strict"; | ||
var stylable_processor_1 = require("./stylable-processor"); | ||
var timed_cache_1 = require("./timed-cache"); | ||
var ResolverFactory = require('enhanced-resolve/lib/ResolverFactory'); | ||
@@ -37,2 +38,8 @@ function createInfrastructure(projectRoot, fileSystem, onProcess, resolveOptions, resolveNamespace) { | ||
}; | ||
var cacheManager = timed_cache_1.timedCache(resolvePath, { | ||
timeout: 1, | ||
useTimer: true, | ||
createKey: function (args) { return args.join(';'); } | ||
}); | ||
resolvePath = cacheManager.get; | ||
var fileProcessor = cached_process_file_1.cachedProcessFile(function (from, content) { | ||
@@ -39,0 +46,0 @@ return stylable_processor_1.process(parser_1.safeParse(content, { from: resolvePath(projectRoot, from) }), undefined, resolveNamespace); |
@@ -16,2 +16,3 @@ export declare const nativePseudoClasses: string[]; | ||
'ellipse': boolean; | ||
'format': boolean; | ||
'grayscale': boolean; | ||
@@ -18,0 +19,0 @@ 'hsl': boolean; |
@@ -106,2 +106,3 @@ "use strict"; | ||
'ellipse': true, | ||
'format': true, | ||
'grayscale': true, | ||
@@ -108,0 +109,0 @@ 'hsl': true, |
{ | ||
"name": "@stylable/core", | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"description": "CSS for Components", | ||
@@ -51,3 +51,3 @@ "main": "./dist/src/index.js", | ||
"license": "BSD-3-Clause", | ||
"gitHead": "df099c98d345d99dd86484719deba814af37fd93" | ||
"gitHead": "acbebd0380ec82336e8ef9627e927e5a7a365d33" | ||
} |
@@ -5,2 +5,3 @@ import { cachedProcessFile, FileProcessor, MinimalFS } from './cached-process-file'; | ||
import { process, processNamespace, StylableMeta } from './stylable-processor'; | ||
import { timedCache } from './timed-cache'; | ||
const ResolverFactory = require('enhanced-resolve/lib/ResolverFactory'); | ||
@@ -26,3 +27,3 @@ | ||
const resolvePath = (context: string | undefined = projectRoot, moduleId: string) => { | ||
let resolvePath = (context: string | undefined = projectRoot, moduleId: string) => { | ||
if (!path.isAbsolute(moduleId) && moduleId.charAt(0) !== '.') { | ||
@@ -34,5 +35,16 @@ moduleId = eResolver.resolveSync({}, context, moduleId); | ||
const cacheManager = timedCache(resolvePath, { | ||
timeout: 1, | ||
useTimer: true, | ||
createKey: (args: string[]) => args.join(';') | ||
}); | ||
resolvePath = cacheManager.get; | ||
const fileProcessor = cachedProcessFile<StylableMeta>( | ||
(from, content) => { | ||
return process(safeParse(content, { from: resolvePath(projectRoot, from) }), undefined, resolveNamespace); | ||
return process( | ||
safeParse(content, { from: resolvePath(projectRoot, from) }), | ||
undefined, | ||
resolveNamespace | ||
); | ||
}, | ||
@@ -39,0 +51,0 @@ { |
@@ -107,2 +107,3 @@ // MDN reference: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes | ||
'ellipse': true, | ||
'format': true, | ||
'grayscale': true, | ||
@@ -109,0 +110,0 @@ 'hsl': true, |
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
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
1161290
280
16028