Skip to content

Commit

Permalink
Use esm for ts-node (#2459)
Browse files Browse the repository at this point in the history
* Use esm for ts-node

* Add esm flag

* Change tsconfig properties

* Use tsx rather than ts-node

* Use tsx

* Remove ts-node
  • Loading branch information
dolanmiu authored Dec 22, 2023
1 parent 8744e61 commit d04c42c
Show file tree
Hide file tree
Showing 9 changed files with 763 additions and 350 deletions.
1 change: 0 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ parser: "@typescript-eslint/parser"
parserOptions:
project:
- tsconfig.json
- demo/tsconfig.json
sourceType: module
plugins:
- eslint-plugin-import
Expand Down
166 changes: 83 additions & 83 deletions .github/workflows/demos.yml

Large diffs are not rendered by default.

16 changes: 1 addition & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Demo",
"type": "node",
"request": "launch",
"runtimeArgs": [
"-r",
"${workspaceFolder}/node_modules/ts-node/register",
"-r",
"${workspaceFolder}/node_modules/tsconfig-paths/register"
],
"cwd": "${workspaceRoot}",
"program": "${workspaceFolder}/demo/85-template-document.ts"
}
]
"configurations": []
}
20 changes: 1 addition & 19 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,5 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
]
},
{
"type": "npm",
"script": "ts-node",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
"tasks": []
}
2 changes: 1 addition & 1 deletion demo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if (files.length === 0) {
const filePath = path.join(dir, files[0]);

console.log(`Running demo ${demoNumber}: ${files[0]}`);
const { stdout } = await $`ts-node --project demo/tsconfig.json ${filePath}`;
const { stdout } = await $`tsx ${filePath}`;
console.log(stdout);
console.log("Successfully created document!");
}
10 changes: 0 additions & 10 deletions demo/tsconfig.json

This file was deleted.

Loading

0 comments on commit d04c42c

Please sign in to comment.