diff --git a/index.js b/index.js index b951fd9..2665609 100644 --- a/index.js +++ b/index.js @@ -424,6 +424,7 @@ var extensions = { ); }, }, + 'tsx/dist/cjs/index.cjs', ], '.cts': ['ts-node/register'], '.tsx': [ @@ -498,6 +499,7 @@ var extensions = { ); }, }, + 'tsx/dist/cjs/index.cjs', ], '.yaml': 'yaml-hook/register', '.yml': 'yaml-hook/register', diff --git a/package.json b/package.json index 14027ee..6611bc7 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "author": "Gulp Team (https://gulpjs.com/)", "contributors": [ "Blaine Bublitz ", - "Tyler Kellen (http://goingslowly.com/)" + "Tyler Kellen (http://goingslowly.com/)", + "Even Stensberg " ], "repository": "gulpjs/interpret", "license": "MIT", diff --git a/test/fixtures/ts/5/package.json b/test/fixtures/ts/5/package.json new file mode 100644 index 0000000..a5757e8 --- /dev/null +++ b/test/fixtures/ts/5/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "tsx": "^4.7.0" + } +} diff --git a/test/fixtures/ts/5/test.ts b/test/fixtures/ts/5/test.ts new file mode 100644 index 0000000..06c3cc0 --- /dev/null +++ b/test/fixtures/ts/5/test.ts @@ -0,0 +1,15 @@ +var test = { + data: { + trueKey: true, + falseKey: false, + subKey: { + subProp: 1, + }, + }, +}; + +var main = { + default: test, +}; + +export = main; \ No newline at end of file diff --git a/test/fixtures/tsx/5/data.tsx b/test/fixtures/tsx/5/data.tsx new file mode 100644 index 0000000..e2f8fab --- /dev/null +++ b/test/fixtures/tsx/5/data.tsx @@ -0,0 +1,13 @@ +export const data: { + trueKey: boolean + falseKey: boolean + subKey: { + subProp: number + } +} = { + trueKey: true, + falseKey: false, + subKey: { + subProp: 1 + } +} diff --git a/test/fixtures/tsx/5/package.json b/test/fixtures/tsx/5/package.json new file mode 100644 index 0000000..a5757e8 --- /dev/null +++ b/test/fixtures/tsx/5/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "tsx": "^4.7.0" + } +} diff --git a/test/fixtures/tsx/5/test.tsx b/test/fixtures/tsx/5/test.tsx new file mode 100644 index 0000000..da694b8 --- /dev/null +++ b/test/fixtures/tsx/5/test.tsx @@ -0,0 +1,11 @@ +/** @jsx jsx */ + +import { data } from './data' + +const Component = (props: object) => ({ data: props }) + +function jsx (element: typeof Component, props: object) { + return element(props) +} + +export default diff --git a/test/index.js b/test/index.js index 1f9ca83..a34e9a3 100644 --- a/test/index.js +++ b/test/index.js @@ -129,12 +129,12 @@ describe('interpret.extensions', function () { this.skip(); } } - // Skip any swc test on linux due to https://github.com/swc-project/swc/issues/4107 if (name === '@swc/register' && process.platform === 'linux') { this.skip(); } + // if (name === '') this.timeout(0); var expected;