Skip to content

Commit ddaf068

Browse files
committed
Replace ts-node with tsx
1 parent fce0f62 commit ddaf068

9 files changed

Lines changed: 523 additions & 385 deletions

File tree

.mocharc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"ignore": ["test/spec-tests/*.js"],
33
"extension": ["ts"],
4-
"require": ["ts-node/register", "./test/should-extensions.ts"]
4+
"require": ["tsx/cjs", "./test/should-extensions.ts"]
55
}

DEPENDENCY_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ The following notes about the app's dependencies should be revisited and resolve
33
As of 2026-07-27:
44

55
- `@types/node`: Consider updating to `26.x` in the future, but for now `24.x` still has plent of time in LTS.
6-
- `typescript`: `7.x` uses a new native compiler without a native API. Libraries like `ts-node` do not yet support it.
6+
- `typescript`: `7.x` uses a new native compiler without a native API. Consider updating soon after evaluating the impact.
77
- `tslog` (test-server only): `5.x` is ESM-only and replaces v4's flat logger settings such as `hideLogPositionForProduction` and `prettyLogTemplate`. Updating will require some migration.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ In the above file, we've assumed the JSON ELM JSON file for the measure is calle
151151
also assumed a couple of very simple patients. Let's call the file we just created
152152
`exec-age.ts`.
153153

154-
Now we can execute the measure using [ts-node](https://www.npmjs.com/package/ts-node):
154+
Now we can execute the measure using [tsx](https://tsx.is/):
155155

156156
``` bash
157-
npx ts-node -O '{ "resolveJsonModule": true }' --files ${path_to_cql-execution}/customCQL/exec-age.ts
157+
npx tsx ${path_to_cql-execution}/customCQL/exec-age.ts
158158
```
159159

160160
If all is well, it should print the result object to standard out.

examples/browser/cql4browsers.js

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3956,42 +3956,11 @@ exports.Predecessor = Predecessor;
39563956

39573957
},{"../datatypes/datetime":8,"../datatypes/quantity":12,"../datatypes/uncertainty":14,"../util/elmTypes":55,"../util/limits":57,"../util/math":58,"./builder":17,"./expression":23}],17:[function(require,module,exports){
39583958
"use strict";
3959-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3960-
if (k2 === undefined) k2 = k;
3961-
var desc = Object.getOwnPropertyDescriptor(m, k);
3962-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3963-
desc = { enumerable: true, get: function() { return m[k]; } };
3964-
}
3965-
Object.defineProperty(o, k2, desc);
3966-
}) : (function(o, m, k, k2) {
3967-
if (k2 === undefined) k2 = k;
3968-
o[k2] = m[k];
3969-
}));
3970-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
3971-
Object.defineProperty(o, "default", { enumerable: true, value: v });
3972-
}) : function(o, v) {
3973-
o["default"] = v;
3974-
});
3975-
var __importStar = (this && this.__importStar) || (function () {
3976-
var ownKeys = function(o) {
3977-
ownKeys = Object.getOwnPropertyNames || function (o) {
3978-
var ar = [];
3979-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
3980-
return ar;
3981-
};
3982-
return ownKeys(o);
3983-
};
3984-
return function (mod) {
3985-
if (mod && mod.__esModule) return mod;
3986-
var result = {};
3987-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
3988-
__setModuleDefault(result, mod);
3989-
return result;
3990-
};
3991-
})();
39923959
Object.defineProperty(exports, "__esModule", { value: true });
39933960
exports.build = build;
3994-
const E = __importStar(require("./expressions"));
3961+
// Keep the live exports object because this module and expressions have a circular dependency.
3962+
// Otherwise, tsx fails when attempting to run this.
3963+
const E = require("./expressions");
39953964
const util_1 = require("../util/util");
39963965
function build(json) {
39973966
if (json == null) {

0 commit comments

Comments
 (0)