@poppinss/ts-exec 1.1.2 → 1.1.4

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.
@@ -58,13 +58,23 @@ function tsConfigToSwcConfig(tsConfig2) {
58
58
  dynamicImport: true
59
59
  },
60
60
  transform: {
61
- decoratorMetadata: tsConfig2.compilerOptions?.emitDecoratorMetadata,
62
- legacyDecorator: tsConfig2.compilerOptions?.experimentalDecorators,
63
- verbatimModuleSyntax: tsConfig2.compilerOptions?.verbatimModuleSyntax,
64
- useDefineForClassFields: tsConfig2.compilerOptions?.useDefineForClassFields,
61
+ ...tsConfig2.compilerOptions?.emitDecoratorMetadata ? {
62
+ decoratorMetadata: true
63
+ } : {},
64
+ ...tsConfig2.compilerOptions?.experimentalDecorators ? {
65
+ legacyDecorator: true
66
+ } : {},
67
+ ...tsConfig2.compilerOptions?.verbatimModuleSyntax ? {
68
+ verbatimModuleSyntax: true
69
+ } : {},
70
+ ...tsConfig2.compilerOptions?.useDefineForClassFields ? {
71
+ useDefineForClassFields: true
72
+ } : {},
65
73
  react: {
66
74
  runtime: "automatic",
67
- importSource: tsConfig2.compilerOptions?.jsxImportSource
75
+ ...tsConfig2.compilerOptions?.jsxImportSource ? {
76
+ importSource: tsConfig2.compilerOptions?.jsxImportSource
77
+ } : {}
68
78
  }
69
79
  },
70
80
  keepClassNames: true
@@ -92,7 +102,7 @@ function getConfig(searchPath) {
92
102
  }
93
103
 
94
104
  // src/transform.ts
95
- import { transformSync as swcTransform } from "@swc/core";
105
+ import { transform as swcTransform } from "@swc/core";
96
106
  function transformSync(source, options) {
97
107
  const input = `${source ?? ""}`;
98
108
  const { format, ...rest } = options;
@@ -193,7 +203,7 @@ var load = async function load2(url, context, nextLoad) {
193
203
  ...context,
194
204
  format: "module"
195
205
  });
196
- const { code, map } = transformSync(source.toString(), {
206
+ const { code, map } = await transformSync(source.toString(), {
197
207
  format: format ?? "module-tsx",
198
208
  filename: fileURLToPath3(url),
199
209
  ...swcConfig
@@ -5,4 +5,4 @@ import { Config as SwcConfig } from '@swc/core';
5
5
  export declare function transformSync(source: string, options: SwcConfig & {
6
6
  filename: string;
7
7
  format: 'module-typescript' | 'commonjs-typescript' | 'module-tsx';
8
- }): import("@swc/types").Output;
8
+ }): Promise<import("@swc/types").Output>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@poppinss/ts-exec",
3
3
  "description": "",
4
- "version": "1.1.2",
4
+ "version": "1.1.4",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },