Comparing version 0.6.2 to 0.6.3
@@ -46,3 +46,3 @@ var __create = Object.create; | ||
// node_modules/.pnpm/tsup@5.12.5_typescript@4.6.3/node_modules/tsup/assets/cjs_shims.js | ||
// node_modules/.pnpm/tsup@5.12.7_typescript@4.6.4/node_modules/tsup/assets/cjs_shims.js | ||
var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href; | ||
@@ -338,3 +338,3 @@ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl(); | ||
// node_modules/.pnpm/@jridgewell+trace-mapping@0.3.4/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs | ||
// node_modules/.pnpm/@jridgewell+trace-mapping@0.3.9/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs | ||
function resolve2(input, base) { | ||
@@ -351,2 +351,9 @@ if (base && !base.endsWith("/")) | ||
} | ||
var COLUMN = 0; | ||
var SOURCES_INDEX = 1; | ||
var SOURCE_LINE = 2; | ||
var SOURCE_COLUMN = 3; | ||
var NAMES_INDEX = 4; | ||
var REV_GENERATED_LINE = 1; | ||
var REV_GENERATED_COLUMN = 2; | ||
function maybeSort(mappings, owned) { | ||
@@ -372,3 +379,3 @@ const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); | ||
for (let j = 1; j < line.length; j++) { | ||
if (line[j][0] < line[j - 1][0]) { | ||
if (line[j][COLUMN] < line[j - 1][COLUMN]) { | ||
return false; | ||
@@ -385,9 +392,11 @@ } | ||
function sortComparator2(a, b) { | ||
return a[0] - b[0]; | ||
return a[COLUMN] - b[COLUMN]; | ||
} | ||
var found = false; | ||
function binarySearch(haystack, needle, low, high) { | ||
while (low <= high) { | ||
const mid = low + (high - low >> 1); | ||
const cmp = haystack[mid][0] - needle; | ||
const cmp = haystack[mid][COLUMN] - needle; | ||
if (cmp === 0) { | ||
found = true; | ||
return mid; | ||
@@ -401,4 +410,19 @@ } | ||
} | ||
found = false; | ||
return low - 1; | ||
} | ||
function upperBound(haystack, needle, index) { | ||
for (let i = index + 1; i < haystack.length; i++, index++) { | ||
if (haystack[i][COLUMN] !== needle) | ||
break; | ||
} | ||
return index; | ||
} | ||
function lowerBound(haystack, needle, index) { | ||
for (let i = index - 1; i >= 0; i--, index--) { | ||
if (haystack[i][COLUMN] !== needle) | ||
break; | ||
} | ||
return index; | ||
} | ||
function memoizedState() { | ||
@@ -417,6 +441,7 @@ return { | ||
if (needle === lastNeedle) { | ||
found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; | ||
return lastIndex; | ||
} | ||
if (needle >= lastNeedle) { | ||
low = Math.max(lastIndex, 0); | ||
low = lastIndex === -1 ? 0 : lastIndex; | ||
} else { | ||
@@ -430,3 +455,32 @@ high = lastIndex; | ||
} | ||
var INVALID_MAPPING = Object.freeze({ | ||
function buildBySources(decoded, memos) { | ||
const sources2 = memos.map(buildNullArray); | ||
for (let i = 0; i < decoded.length; i++) { | ||
const line = decoded[i]; | ||
for (let j = 0; j < line.length; j++) { | ||
const seg = line[j]; | ||
if (seg.length === 1) | ||
continue; | ||
const sourceIndex = seg[SOURCES_INDEX]; | ||
const sourceLine = seg[SOURCE_LINE]; | ||
const sourceColumn = seg[SOURCE_COLUMN]; | ||
const originalSource = sources2[sourceIndex]; | ||
const originalLine = originalSource[sourceLine] || (originalSource[sourceLine] = []); | ||
const memo = memos[sourceIndex]; | ||
const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)); | ||
insert(originalLine, memo.lastIndex = index + 1, [sourceColumn, i, seg[COLUMN]]); | ||
} | ||
} | ||
return sources2; | ||
} | ||
function insert(array, index, value) { | ||
for (let i = array.length; i > index; i--) { | ||
array[i] = array[i - 1]; | ||
} | ||
array[index] = value; | ||
} | ||
function buildNullArray() { | ||
return { __proto__: null }; | ||
} | ||
var INVALID_ORIGINAL_MAPPING = Object.freeze({ | ||
source: null, | ||
@@ -437,2 +491,10 @@ line: null, | ||
}); | ||
var INVALID_GENERATED_MAPPING = Object.freeze({ | ||
line: null, | ||
column: null | ||
}); | ||
var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; | ||
var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; | ||
var LEAST_UPPER_BOUND = -1; | ||
var GREATEST_LOWER_BOUND = 1; | ||
var encodedMappings; | ||
@@ -442,8 +504,15 @@ var decodedMappings; | ||
var originalPositionFor; | ||
var generatedPositionFor; | ||
var eachMapping; | ||
var presortedDecodedMap; | ||
var decodedMap; | ||
var encodedMap; | ||
var TraceMap = class { | ||
constructor(map, mapUrl) { | ||
this._binarySearchMemo = memoizedState(); | ||
this._decodedMemo = memoizedState(); | ||
this._bySources = void 0; | ||
this._bySourceMemos = void 0; | ||
const isString = typeof map === "string"; | ||
if (!isString && map.constructor === TraceMap) | ||
return map; | ||
const parsed = isString ? JSON.parse(map) : map; | ||
@@ -466,3 +535,3 @@ const { version, file, names, sourceRoot, sources: sources2, sourcesContent } = parsed; | ||
this._encoded = mappings; | ||
this._decoded = decode(mappings); | ||
this._decoded = void 0; | ||
} else { | ||
@@ -480,35 +549,59 @@ this._encoded = void 0; | ||
decodedMappings = (map) => { | ||
return map._decoded; | ||
return map._decoded || (map._decoded = decode(map._encoded)); | ||
}; | ||
traceSegment = (map, line, column) => { | ||
const decoded = map._decoded; | ||
const decoded = decodedMappings(map); | ||
if (line >= decoded.length) | ||
return null; | ||
const segments = decoded[line]; | ||
const index = memoizedBinarySearch(segments, column, map._binarySearchMemo, line); | ||
if (index < 0) | ||
return null; | ||
return segments[index]; | ||
return traceSegmentInternal(decoded[line], map._decodedMemo, line, column, GREATEST_LOWER_BOUND); | ||
}; | ||
originalPositionFor = (map, { line, column }) => { | ||
if (line < 1) | ||
throw new Error("`line` must be greater than 0 (lines start at line 1)"); | ||
if (column < 0) { | ||
throw new Error("`column` must be greater than or equal to 0 (columns start at column 0)"); | ||
} | ||
const segment = traceSegment(map, line - 1, column); | ||
originalPositionFor = (map, { line, column, bias }) => { | ||
line--; | ||
if (line < 0) | ||
throw new Error(LINE_GTR_ZERO); | ||
if (column < 0) | ||
throw new Error(COL_GTR_EQ_ZERO); | ||
const decoded = decodedMappings(map); | ||
if (line >= decoded.length) | ||
return INVALID_ORIGINAL_MAPPING; | ||
const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); | ||
if (segment == null) | ||
return INVALID_MAPPING; | ||
return INVALID_ORIGINAL_MAPPING; | ||
if (segment.length == 1) | ||
return INVALID_MAPPING; | ||
return INVALID_ORIGINAL_MAPPING; | ||
const { names, resolvedSources } = map; | ||
return { | ||
source: resolvedSources[segment[1]], | ||
line: segment[2] + 1, | ||
column: segment[3], | ||
name: segment.length === 5 ? names[segment[4]] : null | ||
source: resolvedSources[segment[SOURCES_INDEX]], | ||
line: segment[SOURCE_LINE] + 1, | ||
column: segment[SOURCE_COLUMN], | ||
name: segment.length === 5 ? names[segment[NAMES_INDEX]] : null | ||
}; | ||
}; | ||
generatedPositionFor = (map, { source, line, column, bias }) => { | ||
line--; | ||
if (line < 0) | ||
throw new Error(LINE_GTR_ZERO); | ||
if (column < 0) | ||
throw new Error(COL_GTR_EQ_ZERO); | ||
const { sources: sources2, resolvedSources } = map; | ||
let sourceIndex = sources2.indexOf(source); | ||
if (sourceIndex === -1) | ||
sourceIndex = resolvedSources.indexOf(source); | ||
if (sourceIndex === -1) | ||
return INVALID_GENERATED_MAPPING; | ||
const generated = map._bySources || (map._bySources = buildBySources(decodedMappings(map), map._bySourceMemos = sources2.map(memoizedState))); | ||
const memos = map._bySourceMemos; | ||
const segments = generated[sourceIndex][line]; | ||
if (segments == null) | ||
return INVALID_GENERATED_MAPPING; | ||
const segment = traceSegmentInternal(segments, memos[sourceIndex], line, column, bias || GREATEST_LOWER_BOUND); | ||
if (segment == null) | ||
return INVALID_GENERATED_MAPPING; | ||
return { | ||
line: segment[REV_GENERATED_LINE] + 1, | ||
column: segment[REV_GENERATED_COLUMN] | ||
}; | ||
}; | ||
eachMapping = (map, cb) => { | ||
const decoded = map._decoded; | ||
const decoded = decodedMappings(map); | ||
const { names, resolvedSources } = map; | ||
@@ -550,18 +643,43 @@ for (let i = 0; i < decoded.length; i++) { | ||
}; | ||
decodedMap = (map) => { | ||
return { | ||
version: 3, | ||
file: map.file, | ||
names: map.names, | ||
sourceRoot: map.sourceRoot, | ||
sources: map.sources, | ||
sourcesContent: map.sourcesContent, | ||
mappings: decodedMappings(map) | ||
}; | ||
}; | ||
encodedMap = (map) => { | ||
return { | ||
version: 3, | ||
file: map.file, | ||
names: map.names, | ||
sourceRoot: map.sourceRoot, | ||
sources: map.sources, | ||
sourcesContent: map.sourcesContent, | ||
mappings: encodedMappings(map) | ||
}; | ||
}; | ||
})(); | ||
function traceSegmentInternal(segments, memo, line, column, bias) { | ||
let index = memoizedBinarySearch(segments, column, memo, line); | ||
if (found) { | ||
index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); | ||
} else if (bias === LEAST_UPPER_BOUND) | ||
index++; | ||
if (index === -1 || index === segments.length) | ||
return null; | ||
return segments[index]; | ||
} | ||
// node_modules/.pnpm/@ampproject+remapping@2.1.2/node_modules/@ampproject/remapping/dist/remapping.mjs | ||
var OriginalSource = class { | ||
constructor(source, content) { | ||
this.source = source; | ||
this.content = content; | ||
} | ||
originalPositionFor(line, column, name) { | ||
return { column, line, name, source: this.source, content: this.content }; | ||
} | ||
}; | ||
// node_modules/.pnpm/@jridgewell+set-array@1.1.0/node_modules/@jridgewell/set-array/dist/set-array.mjs | ||
var get; | ||
var put; | ||
var FastStringArray = class { | ||
var pop; | ||
var SetArray = class { | ||
constructor() { | ||
this.indexes = /* @__PURE__ */ Object.create(null); | ||
this._indexes = { __proto__: null }; | ||
this.array = []; | ||
@@ -571,90 +689,221 @@ } | ||
(() => { | ||
get = (strarr, key) => strarr._indexes[key]; | ||
put = (strarr, key) => { | ||
const { array, indexes } = strarr; | ||
let index = indexes[key]; | ||
if (index === void 0) { | ||
index = indexes[key] = array.length; | ||
array.push(key); | ||
} | ||
return index; | ||
const index = get(strarr, key); | ||
if (index !== void 0) | ||
return index; | ||
const { array, _indexes: indexes } = strarr; | ||
return indexes[key] = array.push(key) - 1; | ||
}; | ||
pop = (strarr) => { | ||
const { array, _indexes: indexes } = strarr; | ||
if (array.length === 0) | ||
return; | ||
const last = array.pop(); | ||
indexes[last] = void 0; | ||
}; | ||
})(); | ||
var INVALID_MAPPING2 = void 0; | ||
var SOURCELESS_MAPPING = null; | ||
var traceMappings; | ||
var SourceMapTree = class { | ||
constructor(map, sources2) { | ||
this.map = map; | ||
this.sources = sources2; | ||
// node_modules/.pnpm/@jridgewell+gen-mapping@0.1.1/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs | ||
var addSegment; | ||
var addMapping; | ||
var setSourceContent; | ||
var decodedMap2; | ||
var encodedMap2; | ||
var allMappings; | ||
var GenMapping = class { | ||
constructor({ file, sourceRoot } = {}) { | ||
this._names = new SetArray(); | ||
this._sources = new SetArray(); | ||
this._sourcesContent = []; | ||
this._mappings = []; | ||
this.file = file; | ||
this.sourceRoot = sourceRoot; | ||
} | ||
originalPositionFor(line, column, name) { | ||
const segment = traceSegment(this.map, line, column); | ||
if (segment == null) | ||
return INVALID_MAPPING2; | ||
if (segment.length === 1) | ||
return SOURCELESS_MAPPING; | ||
const source = this.sources[segment[1]]; | ||
return source.originalPositionFor(segment[2], segment[3], segment.length === 5 ? this.map.names[segment[4]] : name); | ||
} | ||
}; | ||
(() => { | ||
traceMappings = (tree) => { | ||
const mappings = []; | ||
const names = new FastStringArray(); | ||
const sources2 = new FastStringArray(); | ||
const sourcesContent = []; | ||
const { sources: rootSources, map } = tree; | ||
const rootNames = map.names; | ||
const rootMappings = decodedMappings(map); | ||
let lastLineWithSegment = -1; | ||
for (let i = 0; i < rootMappings.length; i++) { | ||
const segments = rootMappings[i]; | ||
const tracedSegments = []; | ||
let lastSourcesIndex = -1; | ||
let lastSourceLine = -1; | ||
let lastSourceColumn = -1; | ||
for (let j = 0; j < segments.length; j++) { | ||
const segment = segments[j]; | ||
let traced = SOURCELESS_MAPPING; | ||
if (segment.length !== 1) { | ||
const source2 = rootSources[segment[1]]; | ||
traced = source2.originalPositionFor(segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : ""); | ||
if (traced === INVALID_MAPPING2) | ||
continue; | ||
} | ||
const genCol = segment[0]; | ||
if (traced === SOURCELESS_MAPPING) { | ||
if (lastSourcesIndex === -1) { | ||
continue; | ||
} | ||
lastSourcesIndex = lastSourceLine = lastSourceColumn = -1; | ||
tracedSegments.push([genCol]); | ||
continue; | ||
} | ||
const { column, line, name, content, source } = traced; | ||
const sourcesIndex = put(sources2, source); | ||
sourcesContent[sourcesIndex] = content; | ||
if (lastSourcesIndex === sourcesIndex && lastSourceLine === line && lastSourceColumn === column) { | ||
continue; | ||
} | ||
lastLineWithSegment = i; | ||
lastSourcesIndex = sourcesIndex; | ||
lastSourceLine = line; | ||
lastSourceColumn = column; | ||
tracedSegments.push(name ? [genCol, sourcesIndex, line, column, put(names, name)] : [genCol, sourcesIndex, line, column]); | ||
} | ||
mappings.push(tracedSegments); | ||
addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => { | ||
const { _mappings: mappings, _sources: sources2, _sourcesContent: sourcesContent, _names: names } = map; | ||
const line = getLine(mappings, genLine); | ||
if (source == null) { | ||
const seg2 = [genColumn]; | ||
const index2 = getColumnIndex(line, genColumn, seg2); | ||
return insert2(line, index2, seg2); | ||
} | ||
if (mappings.length > lastLineWithSegment + 1) { | ||
mappings.length = lastLineWithSegment + 1; | ||
} | ||
return presortedDecodedMap(Object.assign({}, tree.map, { | ||
mappings, | ||
sourceRoot: void 0, | ||
const sourcesIndex = put(sources2, source); | ||
const seg = name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, put(names, name)] : [genColumn, sourcesIndex, sourceLine, sourceColumn]; | ||
const index = getColumnIndex(line, genColumn, seg); | ||
if (sourcesIndex === sourcesContent.length) | ||
sourcesContent[sourcesIndex] = null; | ||
insert2(line, index, seg); | ||
}; | ||
addMapping = (map, mapping) => { | ||
const { generated, source, original, name } = mapping; | ||
return addSegment(map, generated.line - 1, generated.column, source, original == null ? void 0 : original.line - 1, original === null || original === void 0 ? void 0 : original.column, name); | ||
}; | ||
setSourceContent = (map, source, content) => { | ||
const { _sources: sources2, _sourcesContent: sourcesContent } = map; | ||
sourcesContent[put(sources2, source)] = content; | ||
}; | ||
decodedMap2 = (map) => { | ||
const { file, sourceRoot, _mappings: mappings, _sources: sources2, _sourcesContent: sourcesContent, _names: names } = map; | ||
return { | ||
version: 3, | ||
file, | ||
names: names.array, | ||
sourceRoot: sourceRoot || void 0, | ||
sources: sources2.array, | ||
sourcesContent | ||
})); | ||
sourcesContent, | ||
mappings | ||
}; | ||
}; | ||
encodedMap2 = (map) => { | ||
const decoded = decodedMap2(map); | ||
return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) }); | ||
}; | ||
allMappings = (map) => { | ||
const out = []; | ||
const { _mappings: mappings, _sources: sources2, _names: names } = map; | ||
for (let i = 0; i < mappings.length; i++) { | ||
const line = mappings[i]; | ||
for (let j = 0; j < line.length; j++) { | ||
const seg = line[j]; | ||
const generated = { line: i + 1, column: seg[0] }; | ||
let source = void 0; | ||
let original = void 0; | ||
let name = void 0; | ||
if (seg.length !== 1) { | ||
source = sources2.array[seg[1]]; | ||
original = { line: seg[2] + 1, column: seg[3] }; | ||
if (seg.length === 5) | ||
name = names.array[seg[4]]; | ||
} | ||
out.push({ generated, source, original, name }); | ||
} | ||
} | ||
return out; | ||
}; | ||
})(); | ||
function getLine(mappings, index) { | ||
for (let i = mappings.length; i <= index; i++) { | ||
mappings[i] = []; | ||
} | ||
return mappings[index]; | ||
} | ||
function getColumnIndex(line, column, seg) { | ||
let index = line.length; | ||
for (let i = index - 1; i >= 0; i--, index--) { | ||
const current = line[i]; | ||
const col = current[0]; | ||
if (col > column) | ||
continue; | ||
if (col < column) | ||
break; | ||
const cmp = compare(current, seg); | ||
if (cmp === 0) | ||
return index; | ||
if (cmp < 0) | ||
break; | ||
} | ||
return index; | ||
} | ||
function compare(a, b) { | ||
let cmp = compareNum(a.length, b.length); | ||
if (cmp !== 0) | ||
return cmp; | ||
if (a.length === 1) | ||
return 0; | ||
cmp = compareNum(a[1], b[1]); | ||
if (cmp !== 0) | ||
return cmp; | ||
cmp = compareNum(a[2], b[2]); | ||
if (cmp !== 0) | ||
return cmp; | ||
cmp = compareNum(a[3], b[3]); | ||
if (cmp !== 0) | ||
return cmp; | ||
if (a.length === 4) | ||
return 0; | ||
return compareNum(a[4], b[4]); | ||
} | ||
function compareNum(a, b) { | ||
return a - b; | ||
} | ||
function insert2(array, index, value) { | ||
if (index === -1) | ||
return; | ||
for (let i = array.length; i > index; i--) { | ||
array[i] = array[i - 1]; | ||
} | ||
array[index] = value; | ||
} | ||
// node_modules/.pnpm/@ampproject+remapping@2.2.0/node_modules/@ampproject/remapping/dist/remapping.mjs | ||
var SOURCELESS_MAPPING = { | ||
source: null, | ||
column: null, | ||
line: null, | ||
name: null, | ||
content: null | ||
}; | ||
var EMPTY_SOURCES = []; | ||
function Source(map, sources2, source, content) { | ||
return { | ||
map, | ||
sources: sources2, | ||
source, | ||
content | ||
}; | ||
} | ||
function MapSource(map, sources2) { | ||
return Source(map, sources2, "", null); | ||
} | ||
function OriginalSource(source, content) { | ||
return Source(null, EMPTY_SOURCES, source, content); | ||
} | ||
function traceMappings(tree) { | ||
const gen = new GenMapping({ file: tree.map.file }); | ||
const { sources: rootSources, map } = tree; | ||
const rootNames = map.names; | ||
const rootMappings = decodedMappings(map); | ||
for (let i = 0; i < rootMappings.length; i++) { | ||
const segments = rootMappings[i]; | ||
let lastSource = null; | ||
let lastSourceLine = null; | ||
let lastSourceColumn = null; | ||
for (let j = 0; j < segments.length; j++) { | ||
const segment = segments[j]; | ||
const genCol = segment[0]; | ||
let traced = SOURCELESS_MAPPING; | ||
if (segment.length !== 1) { | ||
const source2 = rootSources[segment[1]]; | ||
traced = originalPositionFor2(source2, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : ""); | ||
if (traced == null) | ||
continue; | ||
} | ||
const { column, line, name, content, source } = traced; | ||
if (line === lastSourceLine && column === lastSourceColumn && source === lastSource) { | ||
continue; | ||
} | ||
lastSourceLine = line; | ||
lastSourceColumn = column; | ||
lastSource = source; | ||
addSegment(gen, i, genCol, source, line, column, name); | ||
if (content != null) | ||
setSourceContent(gen, source, content); | ||
} | ||
} | ||
return gen; | ||
} | ||
function originalPositionFor2(source, line, column, name) { | ||
if (!source.map) { | ||
return { column, line, name, source: source.source, content: source.content }; | ||
} | ||
const segment = traceSegment(source.map, line, column); | ||
if (segment == null) | ||
return null; | ||
if (segment.length === 1) | ||
return SOURCELESS_MAPPING; | ||
return originalPositionFor2(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name); | ||
} | ||
function asArray(value) { | ||
@@ -676,3 +925,3 @@ if (Array.isArray(value)) | ||
for (let i = maps.length - 1; i >= 0; i--) { | ||
tree = new SourceMapTree(maps[i], [tree]); | ||
tree = MapSource(maps[i], [tree]); | ||
} | ||
@@ -693,20 +942,20 @@ return tree; | ||
const { source, content } = ctx; | ||
if (!sourceMap) { | ||
const sourceContent = content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null; | ||
return new OriginalSource(source, sourceContent); | ||
} | ||
return build(new TraceMap(sourceMap, source), loader, source, depth); | ||
if (sourceMap) | ||
return build(new TraceMap(sourceMap, source), loader, source, depth); | ||
const sourceContent = content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null; | ||
return OriginalSource(source, sourceContent); | ||
}); | ||
return new SourceMapTree(map, children); | ||
return MapSource(map, children); | ||
} | ||
var SourceMap = class { | ||
constructor(map, options) { | ||
this.version = 3; | ||
this.file = map.file; | ||
this.mappings = options.decodedMappings ? decodedMappings(map) : encodedMappings(map); | ||
this.names = map.names; | ||
this.sourceRoot = map.sourceRoot; | ||
this.sources = map.sources; | ||
if (!options.excludeContent && "sourcesContent" in map) { | ||
this.sourcesContent = map.sourcesContent; | ||
const out = options.decodedMappings ? decodedMap2(map) : encodedMap2(map); | ||
this.version = out.version; | ||
this.file = out.file; | ||
this.mappings = out.mappings; | ||
this.names = out.names; | ||
this.sourceRoot = out.sourceRoot; | ||
this.sources = out.sources; | ||
if (!options.excludeContent) { | ||
this.sourcesContent = out.sourcesContent; | ||
} | ||
@@ -990,6 +1239,7 @@ } | ||
var import_url = require("url"); | ||
var import_path4 = require("path"); | ||
var import_path5 = require("path"); | ||
var import_webpack_virtual_modules = __toESM(require("webpack-virtual-modules")); | ||
// src/webpack/utils.ts | ||
var import_path3 = require("path"); | ||
function slash(path2) { | ||
@@ -999,7 +1249,7 @@ return path2.replace(/\\/g, "/"); | ||
function backSlash(path2) { | ||
return path2.replace(/\//g, "\\"); | ||
return path2.replace(/[\\/]/g, import_path3.sep); | ||
} | ||
// src/webpack/genContext.ts | ||
var import_path3 = require("path"); | ||
var import_path4 = require("path"); | ||
var import_webpack_sources = __toESM(require("webpack-sources")); | ||
@@ -1010,3 +1260,3 @@ function genContext(compilation) { | ||
var _a; | ||
((_a = compilation.fileDependencies) != null ? _a : compilation.compilationDependencies).add((0, import_path3.resolve)(process.cwd(), id)); | ||
((_a = compilation.fileDependencies) != null ? _a : compilation.compilationDependencies).add((0, import_path4.resolve)(process.cwd(), id)); | ||
}, | ||
@@ -1030,5 +1280,5 @@ emitFile(emittedFile) { | ||
// src/webpack/index.ts | ||
var _dirname = typeof __dirname !== "undefined" ? __dirname : (0, import_path4.dirname)((0, import_url.fileURLToPath)(importMetaUrl)); | ||
var TRANSFORM_LOADER = (0, import_path4.resolve)(_dirname, "webpack/loaders/transform.js"); | ||
var LOAD_LOADER = (0, import_path4.resolve)(_dirname, "webpack/loaders/load.js"); | ||
var _dirname = typeof __dirname !== "undefined" ? __dirname : (0, import_path5.dirname)((0, import_url.fileURLToPath)(importMetaUrl)); | ||
var TRANSFORM_LOADER = (0, import_path5.resolve)(_dirname, "webpack/loaders/transform.js"); | ||
var LOAD_LOADER = (0, import_path5.resolve)(_dirname, "webpack/loaders/load.js"); | ||
function getWebpackPlugin(factory) { | ||
@@ -1044,3 +1294,3 @@ return (userOptions) => { | ||
}; | ||
const virtualModulePrefix = (0, import_path4.resolve)(process.cwd(), "_virtual_"); | ||
const virtualModulePrefix = (0, import_path5.resolve)(process.cwd(), "_virtual_"); | ||
const rawPlugin = factory(userOptions, meta); | ||
@@ -1047,0 +1297,0 @@ const plugin = Object.assign(rawPlugin, { |
{ | ||
"name": "unplugin", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"packageManager": "pnpm@7.0.0", | ||
"description": "Unified plugin system for build tools", | ||
@@ -37,8 +38,8 @@ "repository": "unjs/unplugin", | ||
"devDependencies": { | ||
"@ampproject/remapping": "^2.1.2", | ||
"@antfu/ni": "^0.14.0", | ||
"@nuxtjs/eslint-config-typescript": "^9.0.0", | ||
"@ampproject/remapping": "^2.2.0", | ||
"@antfu/ni": "^0.16.2", | ||
"@nuxtjs/eslint-config-typescript": "^10.0.0", | ||
"@types/express": "^4.17.13", | ||
"@types/fs-extra": "^9.0.13", | ||
"@types/node": "^17.0.24", | ||
"@types/node": "^17.0.31", | ||
"@types/webpack-sources": "^3.2.0", | ||
@@ -48,13 +49,13 @@ "bumpp": "^7.1.1", | ||
"enhanced-resolve": "^5.9.3", | ||
"esbuild": "^0.14.36", | ||
"eslint": "^8.13.0", | ||
"esbuild": "^0.14.38", | ||
"eslint": "^8.15.0", | ||
"fast-glob": "^3.2.11", | ||
"fs-extra": "^10.0.1", | ||
"fs-extra": "^10.1.0", | ||
"jiti": "^1.13.0", | ||
"magic-string": "^0.26.1", | ||
"rollup": "^2.70.1", | ||
"tsup": "^5.12.5", | ||
"typescript": "^4.6.3", | ||
"vite": "^2.9.4", | ||
"vitest": "^0.9.3", | ||
"rollup": "^2.72.1", | ||
"tsup": "^5.12.7", | ||
"typescript": "^4.6.4", | ||
"vite": "^2.9.8", | ||
"vitest": "^0.10.5", | ||
"webpack": "^5.72.0", | ||
@@ -61,0 +62,0 @@ "webpack-cli": "^4.9.2" |
@@ -177,2 +177,3 @@ # unplugin | ||
- [unplugin-properties](https://github.com/pd4d10/unplugin-properties) | ||
- [unplugin-moment-to-dayjs](https://github.com/1247748612/unplugin-moment-to-dayjs) | ||
@@ -179,0 +180,0 @@ ## License |
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
111762
3116
182