diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 35919db..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -github: [phated] -tidelift: npm/interpret -open_collective: gulpjs diff --git a/.github/security.md b/.github/security.md deleted file mode 100644 index 5358dc5..0000000 --- a/.github/security.md +++ /dev/null @@ -1,3 +0,0 @@ -# Security Policy - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. diff --git a/CHANGELOG.md b/CHANGELOG.md index e329117..a203362 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.1.0](https://www.github.com/gulpjs/interpret/compare/v3.0.0...v3.1.0) (2022-06-29) + + +### Features + +* Add `.cts` to support typescript 4.7 ([#90](https://www.github.com/gulpjs/interpret/issues/90)) ([c1ffa36](https://www.github.com/gulpjs/interpret/commit/c1ffa36fbd1088f2dbdb00c9500eecfce70eafc0)) + ## [3.0.0](https://www.github.com/gulpjs/interpret/compare/v2.2.0...v3.0.0) (2022-04-12) diff --git a/README.md b/README.md index 146d8a5..005f92a 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,8 @@ A sample of an entry containing multiple hooks would look like: - coffeescript/register .coffee.md: - coffeescript/register +.cts: + - ts-node/register .esbuild.js: - esbuild-register/dist/node .esbuild.jsx: diff --git a/index.js b/index.js index 8c79279..b951fd9 100644 --- a/index.js +++ b/index.js @@ -425,6 +425,7 @@ var extensions = { }, }, ], + '.cts': ['ts-node/register'], '.tsx': [ 'ts-node/register', 'sucrase/register/tsx', diff --git a/package.json b/package.json index 8cb8438..786d680 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "interpret", - "version": "3.0.0", + "version": "3.1.0", "description": "A dictionary of file extensions and associated module loaders.", "author": "Gulp Team (https://gulpjs.com/)", "contributors": [ diff --git a/test/fixtures/cts/0/package.json b/test/fixtures/cts/0/package.json new file mode 100644 index 0000000..e11b5ba --- /dev/null +++ b/test/fixtures/cts/0/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "ts-node": "^10.8.0", + "typescript": "^4.7.4" + } +} diff --git a/test/fixtures/cts/0/test.cts b/test/fixtures/cts/0/test.cts new file mode 100644 index 0000000..3fa0969 --- /dev/null +++ b/test/fixtures/cts/0/test.cts @@ -0,0 +1,19 @@ +var test: { + data: { + trueKey: boolean; + falseKey: boolean; + subKey: { + subProp: number; + }; + }; +} = { + data: { + trueKey: true, + falseKey: false, + subKey: { + subProp: 1, + }, + }, +}; + +export default test; diff --git a/test/fixtures/cts/0/tsconfig.json b/test/fixtures/cts/0/tsconfig.json new file mode 100644 index 0000000..ca687b6 --- /dev/null +++ b/test/fixtures/cts/0/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "declaration": false, + "noImplicitAny": false, + "removeComments": true, + "sourceMap": true, + "outDir": ".tmp" + } +} diff --git a/test/fixtures/ts/0/package.json b/test/fixtures/ts/0/package.json index 5240475..e11b5ba 100644 --- a/test/fixtures/ts/0/package.json +++ b/test/fixtures/ts/0/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "ts-node": "^7.0.1", - "typescript": "^3.2.2" + "ts-node": "^10.8.0", + "typescript": "^4.7.4" } } diff --git a/test/fixtures/tsx/0/package.json b/test/fixtures/tsx/0/package.json index 5240475..b5ae145 100644 --- a/test/fixtures/tsx/0/package.json +++ b/test/fixtures/tsx/0/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "ts-node": "^7.0.1", - "typescript": "^3.2.2" + "ts-node": "^10.8.0", + "typescript": "4.7.4" } } diff --git a/test/index.js b/test/index.js index 295a860..1f9ca83 100644 --- a/test/index.js +++ b/test/index.js @@ -154,6 +154,7 @@ describe('interpret.extensions', function () { switch (extension) { case '.ts': + case '.cts': case '.tsx': case '.esm.js': case '.babel.tsx':