@stylable/core
Advanced tools
Comparing version 3.4.5 to 3.5.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.cachedProcessFile = void 0; | ||
function cachedProcessFile(processor, fs, resolvePath) { | ||
@@ -4,0 +5,0 @@ const cache = {}; |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createInfrastructure = void 0; | ||
const path_1 = __importDefault(require("path")); | ||
@@ -22,4 +23,2 @@ const cached_process_file_1 = require("./cached-process-file"); | ||
const cacheManager = timed_cache_1.timedCache(resolvePath, { | ||
timeout: 1, | ||
useTimer: true, | ||
createKey: (args) => args.join(';'), | ||
@@ -26,0 +25,0 @@ ...timedCacheOptions, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getCssDocsForSymbol = void 0; | ||
const jest_docblock_1 = require("jest-docblock"); | ||
@@ -4,0 +5,0 @@ function getCssDocsForSymbol(meta, symbol) { |
@@ -23,4 +23,4 @@ import { StylableMeta } from './stylable-meta'; | ||
export declare const CustomValueStrategy: { | ||
args: (fnNode: ParsedValue, customTypes: Record<string, CustomValueExtension<any>>) => (string | Box<string, any>)[]; | ||
named: (fnNode: ParsedValue, customTypes: Record<string, CustomValueExtension<any>>) => BoxedValueMap; | ||
args: (fnNode: ParsedValue, customTypes: CustomTypes) => (string | Box<string, any>)[]; | ||
named: (fnNode: ParsedValue, customTypes: CustomTypes) => BoxedValueMap; | ||
}; | ||
@@ -27,0 +27,0 @@ export interface JSValueExtension<Value> { |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isCustomValue = exports.getBoxValue = exports.createCustomValue = exports.resolveCustomValues = exports.CustomValueStrategy = exports.stTypes = exports.unbox = exports.box = void 0; | ||
const lodash_clonedeepwith_1 = __importDefault(require("lodash.clonedeepwith")); | ||
@@ -8,0 +9,0 @@ const postcss_value_parser_1 = __importDefault(require("postcss-value-parser")); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Diagnostics = void 0; | ||
class Diagnostics { | ||
@@ -4,0 +5,0 @@ constructor(reports = []) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.evalDeclarationValue = exports.processDeclarationValue = exports.resolveArgumentsValue = exports.functionWarnings = void 0; | ||
const custom_values_1 = require("./custom-values"); | ||
@@ -4,0 +5,0 @@ const native_reserved_lists_1 = require("./native-reserved-lists"); |
@@ -21,2 +21,3 @@ export { safeParse } from './parser'; | ||
export * from './cssdocs'; | ||
export * from './resolve-namespace-factories'; | ||
export * from './module-resolver'; | ||
@@ -23,0 +24,0 @@ import * as pseudoStates from './pseudo-states'; |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
} | ||
@@ -8,30 +20,33 @@ var __importStar = (this && this.__importStar) || function (mod) { | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pseudoStates = void 0; | ||
var parser_1 = require("./parser"); | ||
exports.safeParse = parser_1.safeParse; | ||
__export(require("./cached-process-file")); | ||
__export(require("./stylable-processor")); | ||
__export(require("./stylable-transformer")); | ||
__export(require("./stylable-utils")); | ||
__export(require("./stylable-resolver")); | ||
__export(require("./diagnostics")); | ||
__export(require("./memory-minimal-fs")); | ||
__export(require("./stylable-value-parsers")); | ||
__export(require("./create-infra-structure")); | ||
__export(require("./stylable")); | ||
__export(require("./stylable-mixins")); | ||
__export(require("./stylable-assets")); | ||
__export(require("./functions")); | ||
__export(require("./custom-values")); | ||
__export(require("./state-validators")); | ||
__export(require("./selector-utils")); | ||
__export(require("./native-reserved-lists")); | ||
__export(require("./cssdocs")); | ||
__export(require("./module-resolver")); | ||
Object.defineProperty(exports, "safeParse", { enumerable: true, get: function () { return parser_1.safeParse; } }); | ||
__exportStar(require("./cached-process-file"), exports); | ||
__exportStar(require("./stylable-processor"), exports); | ||
__exportStar(require("./stylable-transformer"), exports); | ||
__exportStar(require("./stylable-utils"), exports); | ||
__exportStar(require("./stylable-resolver"), exports); | ||
__exportStar(require("./diagnostics"), exports); | ||
__exportStar(require("./memory-minimal-fs"), exports); | ||
__exportStar(require("./stylable-value-parsers"), exports); | ||
__exportStar(require("./create-infra-structure"), exports); | ||
__exportStar(require("./stylable"), exports); | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./stylable-mixins"), exports); | ||
__exportStar(require("./stylable-assets"), exports); | ||
__exportStar(require("./functions"), exports); | ||
__exportStar(require("./custom-values"), exports); | ||
__exportStar(require("./state-validators"), exports); | ||
__exportStar(require("./selector-utils"), exports); | ||
__exportStar(require("./native-reserved-lists"), exports); | ||
__exportStar(require("./cssdocs"), exports); | ||
__exportStar(require("./resolve-namespace-factories"), exports); | ||
__exportStar(require("./module-resolver"), exports); | ||
const pseudoStates = __importStar(require("./pseudo-states")); | ||
exports.pseudoStates = pseudoStates; | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createMinimalFS = void 0; | ||
const path_1 = require("path"); | ||
@@ -4,0 +5,0 @@ const deindent = require('deindent'); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createDefaultResolver = void 0; | ||
// importing the factory directly, as we feed it our own fs, and don't want graceful-fs to be implicitly imported | ||
@@ -4,0 +5,0 @@ // this allows @stylable/core to be bundled for browser usage without special custom configuration |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isCssNativeFunction = exports.nativeFunctionsDic = exports.reservedKeyFrames = exports.nativePseudoElements = exports.nativePseudoClasses = void 0; | ||
// MDN reference: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes | ||
@@ -4,0 +5,0 @@ exports.nativePseudoClasses = [ |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.safeParse = exports.cssObjectToAst = void 0; | ||
const postcss_1 = __importDefault(require("postcss")); | ||
@@ -8,0 +9,0 @@ const postcss_nested_1 = __importDefault(require("postcss-nested")); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resolveStateParam = exports.createAttributeState = exports.createStateWithParamClassName = exports.createBooleanStateClassName = exports.setStateToNode = exports.transformPseudoStateSelector = exports.validateStateArgument = exports.validateStateDefinition = exports.processPseudoStates = exports.stateErrors = exports.stateWithParamDelimiter = exports.booleanStateDelimiter = exports.stateMiddleDelimiter = void 0; | ||
const functions_1 = require("./functions"); | ||
@@ -4,0 +5,0 @@ const native_reserved_lists_1 = require("./native-reserved-lists"); |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createWarningRule = exports.isCompRoot = exports.isChildOfAtRule = exports.fixChunkOrdering = exports.matchSelectorTarget = exports.filterChunkNodesByType = exports.separateChunks = exports.getOriginDefinition = exports.separateChunks2 = exports.mergeChunks = exports.isNodeMatch = exports.matchAtMedia = exports.matchAtKeyframes = exports.isImport = exports.isSimpleSelector = exports.createSimpleSelectorChecker = exports.isRootValid = exports.isGlobal = exports.createChecker = exports.traverseNode = exports.stringifySelector = exports.parseSelector = void 0; | ||
const postcss_1 = __importDefault(require("postcss")); | ||
@@ -8,0 +9,0 @@ const stylable_value_parsers_1 = require("./stylable-value-parsers"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.systemValidators = void 0; | ||
const validationErrors = { | ||
@@ -4,0 +5,0 @@ string: { |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fixRelativeUrls = exports.processDeclarationUrls = exports.makeAbsolute = exports.isAsset = exports.isExternal = exports.collectAssets = void 0; | ||
const path_1 = __importDefault(require("path")); | ||
@@ -8,0 +9,0 @@ const url_regex_1 = __importDefault(require("url-regex")); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StylableMeta = exports.RESERVED_ROOT_NAME = void 0; | ||
const stylable_utils_1 = require("./stylable-utils"); | ||
@@ -4,0 +5,0 @@ const stylable_value_parsers_1 = require("./stylable-value-parsers"); |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.appendMixin = exports.appendMixins = exports.mixinWarnings = void 0; | ||
const path_1 = require("path"); | ||
@@ -8,0 +9,0 @@ const postcss_1 = __importDefault(require("postcss")); |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
} | ||
@@ -9,2 +16,3 @@ var __importDefault = (this && this.__importDefault) || function (mod) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.process = exports.processNamespace = exports.createEmptyMeta = exports.validateScopingSelector = exports.StylableProcessor = exports.processorWarnings = void 0; | ||
const murmurhash_1 = __importDefault(require("murmurhash")); | ||
@@ -21,3 +29,3 @@ const path_1 = __importDefault(require("path")); | ||
const utils_1 = require("./utils"); | ||
__export(require("./stylable-meta")); /* TEMP EXPORT */ | ||
__exportStar(require("./stylable-meta"), exports); /* TEMP EXPORT */ | ||
const parseNamed = stylable_value_parsers_1.SBTypesParsers[stylable_value_parsers_1.valueMapping.named]; | ||
@@ -592,3 +600,4 @@ const parseMixin = stylable_value_parsers_1.SBTypesParsers[stylable_value_parsers_1.valueMapping.mixin]; | ||
} | ||
if (!path_1.default.isAbsolute(importPath) && !importPath.startsWith('.')) { // 3rd party request | ||
if (!path_1.default.isAbsolute(importPath) && !importPath.startsWith('.')) { | ||
// 3rd party request | ||
importObj.fromRelative = importPath; | ||
@@ -595,0 +604,0 @@ importObj.from = importPath; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StylableResolver = exports.isInPath = exports.resolverWarnings = void 0; | ||
const stylable_value_parsers_1 = require("./stylable-value-parsers"); | ||
@@ -4,0 +5,0 @@ exports.resolverWarnings = { |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.removeSTDirective = exports.StylableTransformer = exports.transformerWarnings = void 0; | ||
const path_1 = require("path"); | ||
@@ -8,0 +9,0 @@ const postcss_1 = __importDefault(require("postcss")); |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isValidClassName = exports.isCSSVarProp = exports.generateScopedCSSVar = exports.getAlias = exports.getSourcePath = exports.getDeclStylable = exports.findRule = exports.findDeclaration = exports.removeUnusedRules = exports.createSubsetAst = exports.mergeRules = exports.scopeSelector = exports.transformMatchesOnRule = exports.expandCustomSelectors = exports.isValidDeclaration = exports.CUSTOM_SELECTOR_RE = void 0; | ||
const lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep")); | ||
@@ -8,0 +9,0 @@ const path_1 = require("path"); |
@@ -65,7 +65,7 @@ import postcss from 'postcss'; | ||
}; | ||
'-st-mixin'(mixinNode: postcss.Declaration, strategy: (type: string) => "named" | "args", diagnostics?: Diagnostics | undefined): { | ||
'-st-mixin'(mixinNode: postcss.Declaration, strategy: (type: string) => 'named' | 'args', diagnostics?: Diagnostics | undefined): { | ||
type: string; | ||
options: Record<string, string> | { | ||
options: Array<{ | ||
value: string; | ||
}[]; | ||
}> | Record<string, string>; | ||
}[]; | ||
@@ -72,0 +72,0 @@ }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.validateAllowedNodesUntil = exports.listOptions = exports.strategies = exports.groupValues = exports.getStringValue = exports.getFormatterArgs = exports.getNamedArgs = exports.SBTypesParsers = exports.STYLABLE_NAMED_MATCHER = exports.STYLABLE_VALUE_MATCHER = exports.stValuesMap = exports.stValues = exports.valueMapping = exports.rootValueMapping = exports.valueParserWarnings = void 0; | ||
const pseudo_states_1 = require("./pseudo-states"); | ||
@@ -241,3 +242,6 @@ const selector_utils_1 = require("./selector-utils"); | ||
return postcssValueParser.stringify(nodes, (n) => { | ||
if (n.type === 'div') { | ||
if (n.type === 'function') { | ||
return postcssValueParser.stringify(n); | ||
} | ||
else if (n.type === 'div') { | ||
return null; | ||
@@ -244,0 +248,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Stylable = void 0; | ||
const create_infra_structure_1 = require("./create-infra-structure"); | ||
@@ -4,0 +5,0 @@ const diagnostics_1 = require("./diagnostics"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.timedCache = void 0; | ||
function timedCache(fn, { timeout, useTimer, createKey }) { | ||
@@ -4,0 +5,0 @@ const cache = new Map(); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.deprecated = exports.string2varname = exports.filename2varname = exports.stripQuotation = exports.hasOwn = exports.hasKeys = void 0; | ||
function hasKeys(o) { | ||
@@ -4,0 +5,0 @@ for (const k in o) { |
{ | ||
"name": "@stylable/core", | ||
"version": "3.4.5", | ||
"version": "3.5.0", | ||
"description": "CSS for Components", | ||
@@ -23,3 +23,3 @@ "main": "./cjs/index.js", | ||
"murmurhash": "^1.0.0", | ||
"postcss": "^7.0.29", | ||
"postcss": "^7.0.30", | ||
"postcss-js": "^2.0.3", | ||
@@ -26,0 +26,0 @@ "postcss-nested": "^4.2.1", |
@@ -31,4 +31,2 @@ import path from 'path'; | ||
const cacheManager = timedCache(resolvePath, { | ||
timeout: 1, | ||
useTimer: true, | ||
createKey: (args: string[]) => args.join(';'), | ||
@@ -35,0 +33,0 @@ ...timedCacheOptions, |
@@ -21,2 +21,3 @@ export { safeParse } from './parser'; | ||
export * from './cssdocs'; | ||
export * from './resolve-namespace-factories'; | ||
export * from './module-resolver'; | ||
@@ -23,0 +24,0 @@ |
@@ -150,6 +150,6 @@ import hash from 'murmurhash'; | ||
root.walkRules((rule: SRule) => { | ||
root.walkRules((rule) => { | ||
if (!isChildOfAtRule(rule, 'keyframes')) { | ||
this.handleCustomSelectors(rule); | ||
this.handleRule(rule, isChildOfAtRule(rule, rootValueMapping.stScope)); | ||
this.handleRule(rule as SRule, isChildOfAtRule(rule, rootValueMapping.stScope)); | ||
} | ||
@@ -706,3 +706,4 @@ }); | ||
if (!path.isAbsolute(importPath) && !importPath.startsWith('.')) { // 3rd party request | ||
if (!path.isAbsolute(importPath) && !importPath.startsWith('.')) { | ||
// 3rd party request | ||
importObj.fromRelative = importPath; | ||
@@ -709,0 +710,0 @@ importObj.from = importPath; |
@@ -196,3 +196,3 @@ import { basename } from 'path'; | ||
ast.walkRules((rule: SRule) => { | ||
ast.walkRules((rule) => { | ||
if (isChildOfAtRule(rule, 'keyframes')) { | ||
@@ -250,4 +250,4 @@ return; | ||
} | ||
ast.walkRules((rule: SRule) => | ||
appendMixins(this, rule, meta, variableOverride || {}, cssVarsMapping, path) | ||
ast.walkRules((rule) => | ||
appendMixins(this, rule as SRule, meta, variableOverride || {}, cssVarsMapping, path) | ||
); | ||
@@ -254,0 +254,0 @@ |
@@ -246,5 +246,5 @@ import cloneDeep from 'lodash.clonedeep'; | ||
const symbols = Object.keys(_import.named).concat(_import.defaultExport); // .filter(Boolean); | ||
ast.walkRules((rule: SRule) => { | ||
ast.walkRules((rule) => { | ||
let shouldOutput = true; | ||
traverseNode(rule.selectorAst, (node) => { | ||
traverseNode((rule as SRule).selectorAst, (node) => { | ||
// TODO: remove. | ||
@@ -270,3 +270,3 @@ if (symbols.includes(node.name)) { | ||
// TODO: optimize the multiple selectors | ||
if (!shouldOutput && rule.selectorAst.nodes.length <= 1) { | ||
if (!shouldOutput && (rule as SRule).selectorAst.nodes.length <= 1) { | ||
rule.remove(); | ||
@@ -273,0 +273,0 @@ } |
@@ -300,3 +300,5 @@ import postcss from 'postcss'; | ||
return postcssValueParser.stringify(nodes, (n: any) => { | ||
if (n.type === 'div') { | ||
if(n.type === 'function'){ | ||
return postcssValueParser.stringify(n); | ||
} else if (n.type === 'div') { | ||
return null; | ||
@@ -303,0 +305,0 @@ } else if (n.type === 'string') { |
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
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
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
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
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
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
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
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
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
672208
138
11551
1
Updatedpostcss@^7.0.30