@lwc/sfdc-lwc-compiler 13.3.0 → 13.3.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.
@@ -5,13 +5,12 @@ describe('validate javascript syntax', () => {
5
5
  test('valid syntax does not throw', async () => {
6
6
  (0, assert_valid_javascript_1.assertValidJavaScript)('define("x/foo",["exports"],function(exports){function func(e,n){let{c:x}=e;return x}eval(""),exports.func=func,Object.defineProperty(exports,"__esModule",{value:!0})});\n');
7
7
  });
8
- // TODO: W-20260658 {@link ../utils/assert-valid-javascript.ts#assertValidJavaScript} The `transformSync` API from `@swc/wasm` doesn't seem to throw on invalid code anymore.
9
- test.skip('invalid syntax throws an error', async () => {
8
+ test('invalid syntax throws an error', async () => {
10
9
  expect(() => {
11
10
  (0, assert_valid_javascript_1.assertValidJavaScript)(
12
11
  // This string is the invalid output SWC previously produced see W-14210298
13
12
  'define("x/foo",["exports"],function(exports){function func(e,n){let{c:n}=e;return n}eval(""),exports.func=func,Object.defineProperty(exports,"__esModule",{value:!0})});\n');
14
- }).toThrowError(/the name `n` is defined multiple times/);
13
+ }).toThrowError(/Duplicate binding 'n'/);
15
14
  });
16
15
  });
17
16
  //# sourceMappingURL=assert-valid-javascript.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assert-valid-javascript.spec.js","sourceRoot":"","sources":["../../src/__tests__/assert-valid-javascript.spec.ts"],"names":[],"mappings":";;AAAA,8EAAyE;AAEzE,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,IAAI,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC3C,IAAA,+CAAqB,EACjB,4KAA4K,CAC/K,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,6KAA6K;IAC7K,IAAI,CAAC,IAAI,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,CAAC,GAAG,EAAE;YACR,IAAA,+CAAqB;YACjB,2EAA2E;YAC3E,4KAA4K,CAC/K,CAAC;QACN,CAAC,CAAC,CAAC,YAAY,CAAC,wCAAwC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"assert-valid-javascript.spec.js","sourceRoot":"","sources":["../../src/__tests__/assert-valid-javascript.spec.ts"],"names":[],"mappings":";;AAAA,8EAAyE;AAEzE,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,IAAI,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC3C,IAAA,+CAAqB,EACjB,4KAA4K,CAC/K,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAC9C,MAAM,CAAC,GAAG,EAAE;YACR,IAAA,+CAAqB;YACjB,2EAA2E;YAC3E,4KAA4K,CAC/K,CAAC;QACN,CAAC,CAAC,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assertValidJavaScript = assertValidJavaScript;
4
- const wasm_1 = require("@swc/wasm");
4
+ const meriyah_1 = require("meriyah");
5
5
  // Run an extra layer of syntax validation, to ensure that SWC did not emit syntactically erroneous code.
6
- // Somewhat counter-intuitively, we can run SWC itself on its own output to verify that the syntax is correct.
6
+ // We just want to make sure that the code is valid, this should only be used for validating the output of swc.
7
+ // Once we have confidence in swc, we can remove this assertion.
7
8
  function assertValidJavaScript(code) {
8
- // SWC also has a `parseSync`, but it doesn't actually throw an error on invalid syntax. `transformSync` does.
9
- (0, wasm_1.transformSync)(code, {
10
- isModule: false,
11
- jsc: {
12
- parser: {
13
- syntax: 'ecmascript',
14
- },
15
- },
9
+ (0, meriyah_1.parseScript)(code, {
10
+ module: false,
11
+ lexical: true,
16
12
  });
17
13
  }
18
14
  //# sourceMappingURL=assert-valid-javascript.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assert-valid-javascript.js","sourceRoot":"","sources":["../../src/utils/assert-valid-javascript.ts"],"names":[],"mappings":";;AAIA,sDAUC;AAdD,oCAA0C;AAE1C,yGAAyG;AACzG,8GAA8G;AAC9G,SAAgB,qBAAqB,CAAC,IAAY;IAC9C,8GAA8G;IAC9G,IAAA,oBAAa,EAAC,IAAI,EAAE;QAChB,QAAQ,EAAE,KAAK;QACf,GAAG,EAAE;YACD,MAAM,EAAE;gBACJ,MAAM,EAAE,YAAY;aACvB;SACJ;KACJ,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"assert-valid-javascript.js","sourceRoot":"","sources":["../../src/utils/assert-valid-javascript.ts"],"names":[],"mappings":";;AAKA,sDAKC;AAVD,qCAAsC;AAEtC,yGAAyG;AACzG,+GAA+G;AAC/G,gEAAgE;AAChE,SAAgB,qBAAqB,CAAC,IAAY;IAC9C,IAAA,qBAAW,EAAC,IAAI,EAAE;QACd,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,IAAI;KAChB,CAAC,CAAC;AACP,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lwc/sfdc-lwc-compiler",
3
3
  "description": "LWC compiler for SFDC platform",
4
- "version": "13.3.0",
4
+ "version": "13.3.2",
5
5
  "main": "dist/main.js",
6
6
  "typings": "dist/main.d.ts",
7
7
  "files": [
@@ -27,11 +27,11 @@
27
27
  "@babel/traverse": "7.28.5",
28
28
  "@babel/types": "7.28.5",
29
29
  "@komaci/esm-generator": "260.31.0",
30
- "@lwc/dev-server-plugin-lex": "13.3.0",
30
+ "@lwc/dev-server-plugin-lex": "13.3.2",
31
31
  "@lwc/eslint-plugin-lwc": "3.3.0",
32
32
  "@lwc/eslint-plugin-lwc-platform": "6.3.0",
33
- "@lwc/metadata": "13.3.0",
34
- "@lwc/sfdc-compiler-utils": "13.3.0",
33
+ "@lwc/metadata": "13.3.2",
34
+ "@lwc/sfdc-compiler-utils": "13.3.2",
35
35
  "@rollup/plugin-babel": "^6.1.0",
36
36
  "@rollup/plugin-replace": "^6.0.3",
37
37
  "@rollup/wasm-node": "4.52.5",
@@ -47,6 +47,7 @@
47
47
  "line-column": "~1.0.2",
48
48
  "magic-string": "~0.30.21",
49
49
  "markdown-it": "~14.1.0",
50
+ "meriyah": "^5.0.0",
50
51
  "parse5-sax-parser": "~8.0.0",
51
52
  "postcss": "~8.5.6",
52
53
  "postcss-selector-parser": "~7.1.0",