@tmbr/bundler 1.1.0 → 1.2.2

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/error.js +6 -3
  2. package/package.json +3 -3
package/error.js CHANGED
@@ -7,18 +7,21 @@ module.exports = error => {
7
7
 
8
8
  const lines = fs.readFileSync(file, 'UTF-8').split(/\r?\n/);
9
9
  const index = line - 1;
10
- const space = ' ';
11
-
12
10
  const inset = String((lines[index + 2] && line + 2) || (lines[index + 1] && line + 1) || line).split('').length;
11
+
13
12
  const print = offset => (
14
13
  `<span class="c-gray">${String(line + offset).padStart(2 + inset, ' ')} | </span>` + encode(lines[index + offset])
15
14
  );
16
15
 
16
+ const space = length => {
17
+ return ' '.repeat(length);
18
+ };
19
+
17
20
  const output = [
18
21
  (index - 2) >= 0 && print(-2),
19
22
  (index - 1) >= 0 && print(-1),
20
23
  `<span class="c-red fw-700">&gt;</span><span class="c-gray"> ${line} | </span>${encode(lines[index])}`,
21
- ` <span class="c-gray">${space.repeat(2 + inset)}| </span>${space.repeat(column ? column - 1 : 0)}<span class="c-red fw-700">^</span>`,
24
+ ` <span class="c-gray">${space(2 + inset)}| </span>${space(column ? column - 1 : 0)}<span class="c-red fw-700">^</span>`,
22
25
  (index + 1) <= lines.length - 1 && print(1),
23
26
  (index + 2) <= lines.length - 1 && print(2),
24
27
  ].filter(Boolean).join('\n');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tmbr/bundler",
3
3
  "author": "TMBR (https://wearetmbr.com/)",
4
- "version": "1.1.0",
4
+ "version": "1.2.2",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/TMBR/tmbr-bundler",
7
7
  "description": "WordPress development toolkit built on esbuild and browser-sync",
@@ -11,8 +11,8 @@
11
11
  "dependencies": {
12
12
  "browser-sync": "^2.27.5",
13
13
  "chalk": "^4.1.2",
14
- "esbuild": "^0.13.12",
15
- "esbuild-sass-plugin": "^1.5.2",
14
+ "esbuild": "^0.14.47",
15
+ "esbuild-sass-plugin": "^2.2.6",
16
16
  "html-entities": "^2.3.2",
17
17
  "qrcode-terminal": "^0.12.0"
18
18
  }