@astrojs/compiler 1.3.2 → 1.4.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @astrojs/compiler
2
2
 
3
+ ## 1.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0803e86: Handle crashes when using `parse` and `convertToTSX` by restarting the service
8
+
9
+ ## 1.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - fc0f470: Implements the scopedStyleStrategy option
14
+
3
15
  ## 1.3.2
4
16
 
5
17
  ### Patch Changes
package/astro.wasm CHANGED
Binary file
package/node/index.js CHANGED
@@ -55,9 +55,19 @@ const startRunningService = async () => {
55
55
  throw err;
56
56
  }
57
57
  }),
58
- parse: (input, options) => new Promise((resolve) => resolve(_service.parse(input, options || {}))).then((result) => ({ ...result, ast: JSON.parse(result.ast) })),
58
+ parse: (input, options) => new Promise((resolve) => resolve(_service.parse(input, options || {})))
59
+ .catch((error) => {
60
+ longLivedService = void 0;
61
+ throw error;
62
+ })
63
+ .then((result) => ({ ...result, ast: JSON.parse(result.ast) })),
59
64
  convertToTSX: (input, options) => {
60
- return new Promise((resolve) => resolve(_service.convertToTSX(input, options || {}))).then((result) => {
65
+ return new Promise((resolve) => resolve(_service.convertToTSX(input, options || {})))
66
+ .catch((error) => {
67
+ longLivedService = void 0;
68
+ throw error;
69
+ })
70
+ .then((result) => {
61
71
  return { ...result, map: JSON.parse(result.map) };
62
72
  });
63
73
  },
package/node/sync.cjs CHANGED
@@ -510,12 +510,22 @@ function startRunningService() {
510
510
  }
511
511
  },
512
512
  parse: (input, options) => {
513
- const result = _service.parse(input, options || {});
514
- return { ...result, ast: JSON.parse(result.ast) };
513
+ try {
514
+ const result = _service.parse(input, options || {});
515
+ return { ...result, ast: JSON.parse(result.ast) };
516
+ } catch (err) {
517
+ longLivedService = void 0;
518
+ throw err;
519
+ }
515
520
  },
516
521
  convertToTSX: (input, options) => {
517
- const result = _service.convertToTSX(input, options || {});
518
- return { ...result, map: JSON.parse(result.map) };
522
+ try {
523
+ const result = _service.convertToTSX(input, options || {});
524
+ return { ...result, map: JSON.parse(result.map) };
525
+ } catch (err) {
526
+ longLivedService = void 0;
527
+ throw err;
528
+ }
519
529
  }
520
530
  };
521
531
  }
package/node/sync.cts CHANGED
@@ -46,12 +46,22 @@ export function startRunningService(): Service {
46
46
  }
47
47
  },
48
48
  parse: (input, options) => {
49
- const result = _service.parse(input, options || {});
50
- return { ...result, ast: JSON.parse(result.ast) };
49
+ try {
50
+ const result = _service.parse(input, options || {});
51
+ return { ...result, ast: JSON.parse(result.ast) };
52
+ } catch (err) {
53
+ longLivedService = void 0;
54
+ throw err;
55
+ }
51
56
  },
52
57
  convertToTSX: (input, options) => {
53
- const result = _service.convertToTSX(input, options || {});
54
- return { ...result, map: JSON.parse(result.map) };
58
+ try {
59
+ const result = _service.convertToTSX(input, options || {});
60
+ return { ...result, map: JSON.parse(result.map) };
61
+ } catch (err) {
62
+ longLivedService = void 0;
63
+ throw err;
64
+ }
55
65
  },
56
66
  };
57
67
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "module",
6
6
  "bugs": "https://github.com/withastro/compiler/issues",
7
7
  "homepage": "https://astro.build",
8
- "version": "1.3.2",
8
+ "version": "1.4.1",
9
9
  "main": "./node/index.js",
10
10
  "types": "./node",
11
11
  "repository": {
package/shared/types.d.ts CHANGED
@@ -39,6 +39,7 @@ export interface TransformOptions {
39
39
  astroGlobalArgs?: string;
40
40
  compact?: boolean;
41
41
  resultScopedSlot?: boolean;
42
+ scopedStyleStrategy?: 'where' | 'class';
42
43
  /**
43
44
  * @deprecated "as" has been removed and no longer has any effect!
44
45
  */