@stylable/module-utils
Advanced tools
Comparing version 4.10.3 to 4.10.4
import { StylableMeta } from '@stylable/core'; | ||
export declare function generateDTSSourceMap(dtsContent: string, meta: StylableMeta): string; | ||
export declare function generateDTSSourceMap(dtsContent: string, meta: StylableMeta, targetFilePath?: string): string; | ||
//# sourceMappingURL=generate-dts-sourcemaps.d.ts.map |
@@ -27,3 +27,3 @@ "use strict"; | ||
function getVarsSrcPosition(varName, meta) { | ||
const cssVar = meta.cssVars[`--${varName}`]; | ||
const cssVar = features_1.STSymbol.get(meta, `--${varName}`, `cssVar`); | ||
let res; | ||
@@ -43,3 +43,3 @@ if (cssVar) { | ||
var _a; | ||
const stVar = meta.vars.find((v) => v.name === varName); | ||
const stVar = Object.values(meta.getAllStVars()).find((v) => v.name === varName); | ||
if ((_a = stVar === null || stVar === void 0 ? void 0 : stVar.node.source) === null || _a === void 0 ? void 0 : _a.start) { | ||
@@ -179,3 +179,3 @@ return { | ||
} | ||
function generateDTSSourceMap(dtsContent, meta) { | ||
function generateDTSSourceMap(dtsContent, meta, targetFilePath) { | ||
var _a; | ||
@@ -234,3 +234,3 @@ const tokens = (0, dts_rough_tokenizer_1.tokenizeDTS)(dtsContent); | ||
file: `${stylesheetName}.d.ts`, | ||
sources: [stylesheetName], | ||
sources: [targetFilePath !== null && targetFilePath !== void 0 ? targetFilePath : stylesheetName], | ||
names: [], | ||
@@ -237,0 +237,0 @@ mappings: Object.values(mapping) |
{ | ||
"name": "@stylable/module-utils", | ||
"version": "4.10.3", | ||
"version": "4.10.4", | ||
"description": "Stylable module creation utilities", | ||
@@ -10,3 +10,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@stylable/core": "^4.10.3", | ||
"@stylable/core": "^4.10.4", | ||
"@tokey/core": "^1.2.1", | ||
@@ -13,0 +13,0 @@ "vlq": "^2.0.4" |
import { basename } from 'path'; | ||
import { ClassSymbol, StylableMeta, valueMapping } from '@stylable/core'; | ||
import { CSSKeyframes } from '@stylable/core/dist/features'; | ||
import { STSymbol, CSSKeyframes } from '@stylable/core/dist/features'; | ||
import { processDeclarationFunctions } from '@stylable/core/dist/process-declaration-functions'; | ||
@@ -36,3 +36,3 @@ import { encode } from 'vlq'; | ||
function getVarsSrcPosition(varName: string, meta: StylableMeta): Position | undefined { | ||
const cssVar = meta.cssVars[`--${varName}`]; | ||
const cssVar = STSymbol.get(meta, `--${varName}`, `cssVar`); | ||
let res; | ||
@@ -55,3 +55,3 @@ | ||
function getStVarsSrcPosition(varName: string, meta: StylableMeta): Position | undefined { | ||
const stVar = meta.vars.find((v) => v.name === varName); | ||
const stVar = Object.values(meta.getAllStVars()).find((v) => v.name === varName); | ||
@@ -245,3 +245,7 @@ if (stVar?.node.source?.start) { | ||
export function generateDTSSourceMap(dtsContent: string, meta: StylableMeta) { | ||
export function generateDTSSourceMap( | ||
dtsContent: string, | ||
meta: StylableMeta, | ||
targetFilePath?: string | ||
) { | ||
const tokens = tokenizeDTS(dtsContent); | ||
@@ -318,3 +322,3 @@ const mapping: Record<number, LineMapping> = {}; | ||
file: `${stylesheetName}.d.ts`, | ||
sources: [stylesheetName], | ||
sources: [targetFilePath ?? stylesheetName], | ||
names: [], | ||
@@ -321,0 +325,0 @@ mappings: Object.values(mapping) |
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
93431
1606
Updated@stylable/core@^4.10.4