Skip to content

Commit e28ab83

Browse files
committed
Replace ts-node with tsx
1 parent 9ae8152 commit e28ab83

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"
4+
"require": "tsx/cjs"
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
@@ -3905,42 +3905,11 @@ exports.Predecessor = Predecessor;
39053905

39063906
},{"../datatypes/quantity":12,"../datatypes/uncertainty":14,"../util/elmTypes":55,"../util/math":57,"./builder":17,"./expression":23}],17:[function(require,module,exports){
39073907
"use strict";
3908-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3909-
if (k2 === undefined) k2 = k;
3910-
var desc = Object.getOwnPropertyDescriptor(m, k);
3911-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3912-
desc = { enumerable: true, get: function() { return m[k]; } };
3913-
}
3914-
Object.defineProperty(o, k2, desc);
3915-
}) : (function(o, m, k, k2) {
3916-
if (k2 === undefined) k2 = k;
3917-
o[k2] = m[k];
3918-
}));
3919-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
3920-
Object.defineProperty(o, "default", { enumerable: true, value: v });
3921-
}) : function(o, v) {
3922-
o["default"] = v;
3923-
});
3924-
var __importStar = (this && this.__importStar) || (function () {
3925-
var ownKeys = function(o) {
3926-
ownKeys = Object.getOwnPropertyNames || function (o) {
3927-
var ar = [];
3928-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
3929-
return ar;
3930-
};
3931-
return ownKeys(o);
3932-
};
3933-
return function (mod) {
3934-
if (mod && mod.__esModule) return mod;
3935-
var result = {};
3936-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
3937-
__setModuleDefault(result, mod);
3938-
return result;
3939-
};
3940-
})();
39413908
Object.defineProperty(exports, "__esModule", { value: true });
39423909
exports.build = build;
3943-
const E = __importStar(require("./expressions"));
3910+
// Keep the live exports object because this module and expressions have a circular dependency.
3911+
// Otherwise, tsx fails when attempting to run this.
3912+
const E = require("./expressions");
39443913
const util_1 = require("../util/util");
39453914
function build(json) {
39463915
if (json == null) {

0 commit comments

Comments
 (0)