@markuplint/vue-parser 4.0.0-alpha.4 → 4.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2019 Yusuke Hirao
3
+ Copyright (c) 2017-2023 Yusuke Hirao
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/lib/parse.js CHANGED
@@ -1,7 +1,6 @@
1
- import { parseRawTag } from '@markuplint/html-parser';
2
- import { flattenNodes, getEndCol, getEndLine, uuid, ParserError, detectElementType } from '@markuplint/parser-utils';
1
+ import { flattenNodes, getEndCol, getEndLine, uuid, ParserError, detectElementType, tagParser, } from '@markuplint/parser-utils';
3
2
  import { attr } from './attr.js';
4
- import vueParse from './vue-parser/index.js';
3
+ import { vueParse } from './vue-parser/index.js';
5
4
  export const parse = (rawCode, options) => {
6
5
  let ast;
7
6
  try {
@@ -161,13 +160,13 @@ comments, options) {
161
160
  default: {
162
161
  const tagLoc = originNode.startTag;
163
162
  const startTagRaw = rawHtml.slice(tagLoc.range[0], tagLoc.range[1]);
164
- const tagTokens = parseRawTag(startTagRaw, startLine, startCol, startOffset);
163
+ const tagTokens = tagParser(startTagRaw, startLine, startCol, startOffset);
165
164
  const tagName = tagTokens.tagName;
166
165
  let endTag = null;
167
166
  const endTagLoc = originNode.endTag;
168
167
  if (endTagLoc) {
169
168
  const endTagRaw = rawHtml.slice(endTagLoc.range[0], endTagLoc.range[1]);
170
- const endTagTokens = parseRawTag(endTagRaw, endTagLoc.loc.start.line, endTagLoc.loc.start.column, endTagLoc.range[0]);
169
+ const endTagTokens = tagParser(endTagRaw, endTagLoc.loc.start.line, endTagLoc.loc.start.column, endTagLoc.range[0]);
171
170
  const endTagName = endTagTokens.tagName;
172
171
  endTag = {
173
172
  uuid: uuid(),
@@ -227,7 +226,7 @@ comments, options) {
227
226
  nextNode,
228
227
  pearNode: endTag,
229
228
  selfClosingSolidus: tagTokens.selfClosingSolidus,
230
- endSpace: tagTokens.endSpace,
229
+ endSpace: tagTokens.afterAttrSpaces,
231
230
  isFragment: false,
232
231
  isGhost: false,
233
232
  tagOpenChar: '<',
@@ -1,5 +1,5 @@
1
1
  import * as VueESLintParser from 'vue-eslint-parser';
2
2
  export type VueTokens = VueESLintParser.AST.ESLintProgram;
3
- export default function vueParse(vueTemplate: string): VueTokens;
3
+ export declare function vueParse(vueTemplate: string): VueTokens;
4
4
  export type ASTNode = VueESLintParser.AST.VElement | VueESLintParser.AST.VText | VueESLintParser.AST.VExpressionContainer;
5
5
  export type ASTComment = VueESLintParser.AST.Token & VueESLintParser.AST.HasLocation;
@@ -1,5 +1,5 @@
1
1
  import * as VueESLintParser from 'vue-eslint-parser';
2
- export default function vueParse(vueTemplate) {
2
+ export function vueParse(vueTemplate) {
3
3
  const ast = VueESLintParser.parse(vueTemplate, { parser: false });
4
4
  return ast;
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/vue-parser",
3
- "version": "4.0.0-alpha.4",
3
+ "version": "4.0.0-alpha.6",
4
4
  "description": "Vue parser for markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -21,10 +21,10 @@
21
21
  "clean": "tsc --build --clean"
22
22
  },
23
23
  "dependencies": {
24
- "@markuplint/html-parser": "4.0.0-alpha.4",
25
- "@markuplint/ml-ast": "4.0.0-alpha.4",
26
- "@markuplint/parser-utils": "4.0.0-alpha.4",
24
+ "@markuplint/html-parser": "4.0.0-alpha.6",
25
+ "@markuplint/ml-ast": "4.0.0-alpha.6",
26
+ "@markuplint/parser-utils": "4.0.0-alpha.6",
27
27
  "vue-eslint-parser": "^9.3.1"
28
28
  },
29
- "gitHead": "991b3aef77fde42c79343ee8c807257a35c589d7"
29
+ "gitHead": "06e1242d274c72cf08a10a572b06ac35d1b924a4"
30
30
  }