Skip to content

Commit

Permalink
use ts-node 7
Browse files Browse the repository at this point in the history
  • Loading branch information
ecraig12345 committed Apr 22, 2020
1 parent de7b200 commit 08fdc1e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 26 deletions.
2 changes: 1 addition & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"tmp": "^0.0.33",
"ts-jest": "24.0.1",
"ts-loader": "^4.1.0",
"ts-node": "^8.4.1",
"ts-node": "^7.0.0",
"tsconfig-paths": "^3.7.0",
"tslint": "^5.7.0",
"typescript": "3.7.2",
Expand Down
18 changes: 16 additions & 2 deletions scripts/ts-node-register.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Register ts-node so that it uses the scripts directory's tsconfig
const tsNode = require('ts-node');
tsNode.register({ dir: __dirname });
const jju = require('jju');
const fs = require('fs');
const path = require('path');

// Until ts-node re-enables caching, we're using version 7 (before caching was disabled).
// https://github.com/TypeStrong/ts-node/issues/951
tsNode.register({
// Run in transpileOnly mode because with type checking it's very slow
transpileOnly: true,
// TODO: re-enable when upgrading ts-node to version which supports this
// // Register ts-node so that it uses the scripts directory's tsconfig
// dir: __dirname,
// Hack to work around lack of `dir` option: manually pass in tsconfig
compilerOptions: jju.parse(fs.readFileSync(path.join(__dirname, 'tsconfig.json'))).compilerOptions,
skipProject: true, // don't read tsconfig within ts-node
});
2 changes: 1 addition & 1 deletion scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"compilerOptions": {
"module": "CommonJS",
"target": "ES2018", // Node 10 per https://kangax.github.io/compat-table/es2016plus/#node10_9
"lib": ["ES2018"],
"lib": ["ES2018", "DOM"], // Node 10, occasional test-related stuff that uses DOM
"esModuleInterop": true,
"allowJs": true,
"noImplicitAny": false,
Expand Down
37 changes: 15 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5090,11 +5090,6 @@ are-we-there-yet@~1.1.2:
delegates "^1.0.0"
readable-stream "^2.0.6"

arg@^4.1.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.2.tgz#e70c90579e02c63d80e3ad4e31d8bfdb8bd50064"
integrity sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==

argparse@^1.0.7, argparse@~1.0.9:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
Expand Down Expand Up @@ -6342,7 +6337,7 @@ buffer-equal@^1.0.0:
resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe"
integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74=

buffer-from@1.x, buffer-from@^1.0.0:
buffer-from@1.x, buffer-from@^1.0.0, buffer-from@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
Expand Down Expand Up @@ -8617,11 +8612,6 @@ diff@^3.1.0, diff@^3.2.0:
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==

diff@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==

diffie-hellman@^5.0.0:
version "5.0.3"
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875"
Expand Down Expand Up @@ -21321,16 +21311,19 @@ ts-loader@^4.1.0:
micromatch "^3.1.4"
semver "^5.0.1"

ts-node@^8.4.1:
version "8.6.2"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.6.2.tgz#7419a01391a818fbafa6f826a33c1a13e9464e35"
integrity sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==
ts-node@^7.0.0:
version "7.0.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf"
integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==
dependencies:
arg "^4.1.0"
diff "^4.0.1"
arrify "^1.0.0"
buffer-from "^1.1.0"
diff "^3.1.0"
make-error "^1.1.1"
minimist "^1.2.0"
mkdirp "^0.5.1"
source-map-support "^0.5.6"
yn "3.1.1"
yn "^2.0.0"

ts-pnp@^1.1.2:
version "1.1.5"
Expand Down Expand Up @@ -22952,10 +22945,10 @@ yauzl@2.4.1:
dependencies:
fd-slicer "~1.0.1"

yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==
yn@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a"
integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=

z-schema@~3.18.3:
version "3.18.4"
Expand Down

0 comments on commit 08fdc1e

Please sign in to comment.