@vnejs/build 0.0.25 → 0.0.27

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/data/utils.js +13 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/build",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "Build tools for @vnejs",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/data/utils.js CHANGED
@@ -36,7 +36,7 @@ const prepareMediaInfo = (mediaDir, mediaSubType = null) =>
36
36
  return acc;
37
37
  }, {});
38
38
 
39
- const parseLines = (lines) => {
39
+ const parseLines = (lines, label) => {
40
40
  const realLines = [];
41
41
  let curKeys = [];
42
42
 
@@ -67,9 +67,18 @@ const parseLines = (lines) => {
67
67
 
68
68
  args[key] = mapValue(value);
69
69
  } else {
70
+ let [realLine, keywords] = [line.trim(), []];
71
+
70
72
  curKeys = [];
71
- const realLine = line.trim();
72
- realLines.push({ line: realLine, indent: line.length - realLine.length, args: {} });
73
+
74
+ if (realLine.includes(" | ")) {
75
+ const [line, keywordsStr] = realLine.split(" | ");
76
+
77
+ realLine = line;
78
+ keywords = keywordsStr.split(" ");
79
+ }
80
+
81
+ realLines.push({ line: realLine, indent: line.length - line.trim().length, args: {}, keywords });
73
82
  }
74
83
  });
75
84
 
@@ -135,7 +144,7 @@ const runBuildData = ({ modDir } = {}) => {
135
144
  Object.keys(kek).map(async (label) => {
136
145
  const minIndent = kek[label].reduce((acc, k) => Math.min(acc, k.length ? k.length - k.trim().length : 9999), 9999);
137
146
  const lines = kek[label].map((a) => a.slice(minIndent)).filter(Boolean);
138
- result.label[label] = { lines: parseLines(lines) };
147
+ result.label[label] = { lines: parseLines(lines, label) };
139
148
  });
140
149
  }
141
150