Socket
Socket
Sign inDemoInstall

@vue/component-compiler-utils

Package Overview
Dependencies
16
Maintainers
10
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.5.1 to 2.5.2

10

CHANGELOG.md

@@ -0,1 +1,11 @@

## [2.5.2](https://github.com/vuejs/component-compiler-utils/compare/v2.5.0...v2.5.2) (2019-01-31)
### Bug Fixes
* fix sourceMap path separator on Windows, default sourceRoot to "" ([#51](https://github.com/vuejs/component-compiler-utils/issues/51)) ([df32cd9](https://github.com/vuejs/component-compiler-utils/commit/df32cd9)), closes [#47](https://github.com/vuejs/component-compiler-utils/issues/47)
* generate correct source-map when content is not padded ([#52](https://github.com/vuejs/component-compiler-utils/issues/52)) ([81be0ca](https://github.com/vuejs/component-compiler-utils/commit/81be0ca))
## [2.5.1](https://github.com/vuejs/component-compiler-utils/compare/v2.5.0...v2.5.1) (2019-01-25)

@@ -2,0 +12,0 @@

22

dist/parse.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const source_map_1 = require("source-map");
const hash = require('hash-sum');
const cache = require('lru-cache')(100);
const { SourceMapGenerator } = require('source-map');
const splitRE = /\r?\n/g;

@@ -17,3 +17,3 @@ const emptyRE = /^(?:\/\/)?\s*$/;

if (output.script && !output.script.src) {
output.script.map = generateSourceMap(filename, source, output.script.content, sourceRoot);
output.script.map = generateSourceMap(filename, source, output.script.content, sourceRoot, compilerParseOptions.pad);
}

@@ -23,3 +23,3 @@ if (output.styles) {

if (!style.src) {
style.map = generateSourceMap(filename, source, style.content, sourceRoot);
style.map = generateSourceMap(filename, source, style.content, sourceRoot, compilerParseOptions.pad);
}

@@ -33,7 +33,15 @@ });

exports.parse = parse;
function generateSourceMap(filename, source, generated, sourceRoot) {
const map = new SourceMapGenerator({
function generateSourceMap(filename, source, generated, sourceRoot, pad) {
const map = new source_map_1.SourceMapGenerator({
file: filename.replace(/\\/g, '/'),
sourceRoot: sourceRoot.replace(/\\/g, '/')
});
let offset = 0;
if (!pad) {
offset =
source
.split(generated)
.shift()
.split(splitRE).length - 1;
}
map.setSourceContent(filename, source);

@@ -45,3 +53,3 @@ generated.split(splitRE).forEach((line, index) => {

original: {
line: index + 1,
line: index + 1 + offset,
column: 0

@@ -56,3 +64,3 @@ },

});
return map.toJSON();
return JSON.parse(map.toString());
}

@@ -0,1 +1,2 @@

import { SourceMapGenerator } from 'source-map'
import {

@@ -9,3 +10,2 @@ RawSourceMap,

const cache = require('lru-cache')(100)
const { SourceMapGenerator } = require('source-map')

@@ -52,3 +52,3 @@ const splitRE = /\r?\n/g

compiler,
compilerParseOptions = { pad: 'line' },
compilerParseOptions = { pad: 'line' } as VueTemplateCompilerParseOptions,
sourceRoot = '',

@@ -67,3 +67,4 @@ needMap = true

output.script.content,
sourceRoot
sourceRoot,
compilerParseOptions.pad
)

@@ -78,3 +79,4 @@ }

style.content,
sourceRoot
sourceRoot,
compilerParseOptions.pad
)

@@ -93,3 +95,4 @@ }

generated: string,
sourceRoot: string
sourceRoot: string,
pad?: 'line' | 'space'
): RawSourceMap {

@@ -100,2 +103,10 @@ const map = new SourceMapGenerator({

})
let offset = 0
if (!pad) {
offset =
source
.split(generated)
.shift()!
.split(splitRE).length - 1
}
map.setSourceContent(filename, source)

@@ -107,3 +118,3 @@ generated.split(splitRE).forEach((line, index) => {

original: {
line: index + 1,
line: index + 1 + offset,
column: 0

@@ -118,3 +129,3 @@ },

})
return map.toJSON()
return JSON.parse(map.toString())
}
{
"name": "@vue/component-compiler-utils",
"version": "2.5.1",
"version": "2.5.2",
"description": "Lower level utilities for compiling Vue single file components",

@@ -40,7 +40,7 @@ "main": "dist/index.js",

"@types/jest": "^22.2.3",
"@types/node": "^10.12.18",
"@types/node": "^10.12.20",
"conventional-changelog-cli": "^2.0.11",
"jest": "^22.4.2",
"less": "^3.9.0",
"lint-staged": "^8.1.0",
"lint-staged": "^8.1.1",
"node-sass": "^4.11.0",

@@ -51,4 +51,4 @@ "pug": "^2.0.3",

"typescript": "^2.7.2",
"vue": "^2.5.21",
"vue-template-compiler": "^2.5.21",
"vue": "^2.5.22",
"vue-template-compiler": "^2.5.22",
"yorkie": "^2.0.0"

@@ -61,8 +61,8 @@ },

"merge-source-map": "^1.1.0",
"postcss": "^7.0.7",
"postcss": "^7.0.14",
"postcss-selector-parser": "^5.0.0",
"prettier": "1.16.0",
"source-map": "^0.7.3",
"vue-template-es2015-compiler": "^1.6.0"
"prettier": "1.16.3",
"source-map": "~0.6.1",
"vue-template-es2015-compiler": "^1.8.2"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc