Skip to content

Commit

Permalink
👽️ Use tsx instead of esm/register
Browse files Browse the repository at this point in the history
  • Loading branch information
indeyets committed Nov 9, 2024
1 parent 876e012 commit 36db14b
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 119 deletions.
2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require('./esm/register.cjs');

module.exports = {
extends: [
'eslint:recommended',
Expand Down
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"exit": true,
"recursive": true,
"require": "./test/testHelper",
"require": ["tsx", "./test/testHelper"],
"timeout": 60000,
"colors": true,
"extension": ["js", "ts"]
Expand Down
13 changes: 0 additions & 13 deletions esm/preprocess.cjs

This file was deleted.

92 changes: 0 additions & 92 deletions esm/register.cjs

This file was deleted.

1 change: 0 additions & 1 deletion knexfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require('./esm/register.cjs');
const { loadFileConfigs } = require('config').util;

let env = process.env.NODE_ENV || 'development';
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
"lint": "run-s eslint ejslint",
"ejslint": "ejslint app",
"eslint": "eslint . --ext \".js,.jsx,.ts\"",
"babel": "node -r './esm/register.cjs'",
"babel": "tsx",
"knex": "tsx node_modules/.bin/knex",
"typecheck": "tsc",
"reset-test-db": "run-s \"babel bin/clean_test_db.js\" && knex --env test migrate:latest",
"test-rollback": "knex --env test migrate:rollback && knex --env test migrate:latest",
"reset-test-db": "run-s \"babel bin/clean_test_db.js\" \"knex --env test migrate:latest\"",
"test-rollback": "run-s \"knex --env test migrate:rollback\" \"knex --env test migrate:latest\"",
"test-just": "cross-env NODE_ENV=test FRFS_SECRET=test-secret mocha",
"mocha": "cross-env TZ=UTC run-s \"test-just -b test/unit test/integration test/functional test/cleanup.js\"",
"console": "yarn babel bin/console",
Expand Down Expand Up @@ -146,7 +147,6 @@
"chai-fs": "~2.0.0",
"cross-env": "~7.0.3",
"ejs-lint": "~2.0.0",
"esbuild": "~0.23.1",
"eslint": "~8.56.0",
"eslint-config-prettier": "~9.1.0",
"eslint-plugin-babel": "~5.3.1",
Expand All @@ -167,6 +167,7 @@
"socket.io-client-modern": "npm:socket.io-client@~4.7.5",
"source-map-support": "~0.5.21",
"superagent": "~10.1.0",
"tsx": "~4.19.2",
"typescript": "~5.5.4",
"unexpected": "~13.2.1",
"unexpected-date": "~2.0.0",
Expand Down
2 changes: 0 additions & 2 deletions test/testHelper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require('../esm/register.cjs');

global.$database = require('../app/setup/database').default; // used by realtime-tests

global.$should = require('chai').should();
Expand Down
40 changes: 36 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5170,7 +5170,7 @@ __metadata:
languageName: node
linkType: hard

"esbuild@npm:~0.23.1":
"esbuild@npm:~0.23.0":
version: 0.23.1
resolution: "esbuild@npm:0.23.1"
dependencies:
Expand Down Expand Up @@ -6192,7 +6192,6 @@ __metadata:
ejs: "npm:~3.1.10"
ejs-lint: "npm:~2.0.0"
email-validator: "npm:~2.0.4"
esbuild: "npm:~0.23.1"
eslint: "npm:~8.56.0"
eslint-config-prettier: "npm:~9.1.0"
eslint-plugin-babel: "npm:~5.3.1"
Expand Down Expand Up @@ -6265,6 +6264,7 @@ __metadata:
stream-meter: "npm:~1.0.4"
superagent: "npm:~10.1.0"
ts-json-check: "npm:~2.0.3"
tsx: "npm:~4.19.2"
typescript: "npm:~5.5.4"
unexpected: "npm:~13.2.1"
unexpected-date: "npm:~2.0.0"
Expand Down Expand Up @@ -6347,7 +6347,7 @@ __metadata:
languageName: node
linkType: hard

"fsevents@npm:~2.3.2":
"fsevents@npm:~2.3.2, fsevents@npm:~2.3.3":
version: 2.3.3
resolution: "fsevents@npm:2.3.3"
dependencies:
Expand All @@ -6357,7 +6357,7 @@ __metadata:
languageName: node
linkType: hard

"fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin<compat/fsevents>":
"fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin<compat/fsevents>, fsevents@patch:fsevents@npm%3A~2.3.3#optional!builtin<compat/fsevents>":
version: 2.3.3
resolution: "fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin<compat/fsevents>::version=2.3.3&hash=df0bf1"
dependencies:
Expand Down Expand Up @@ -6520,6 +6520,15 @@ __metadata:
languageName: node
linkType: hard

"get-tsconfig@npm:^4.7.5":
version: 4.8.1
resolution: "get-tsconfig@npm:4.8.1"
dependencies:
resolve-pkg-maps: "npm:^1.0.0"
checksum: 10c0/536ee85d202f604f4b5fb6be81bcd6e6d9a96846811e83e9acc6de4a04fb49506edea0e1b8cf1d5ee7af33e469916ec2809d4c5445ab8ae015a7a51fbd1572f9
languageName: node
linkType: hard

"getopts@npm:2.3.0":
version: 2.3.0
resolution: "getopts@npm:2.3.0"
Expand Down Expand Up @@ -10743,6 +10752,13 @@ __metadata:
languageName: node
linkType: hard

"resolve-pkg-maps@npm:^1.0.0":
version: 1.0.0
resolution: "resolve-pkg-maps@npm:1.0.0"
checksum: 10c0/fb8f7bbe2ca281a73b7ef423a1cbc786fb244bd7a95cbe5c3fba25b27d327150beca8ba02f622baea65919a57e061eb5005204daa5f93ed590d9b77463a567ab
languageName: node
linkType: hard

"resolve@npm:^1.1.5, resolve@npm:^1.10.0, resolve@npm:^1.20.0, resolve@npm:^1.22.4":
version: 1.22.8
resolution: "resolve@npm:1.22.8"
Expand Down Expand Up @@ -12013,6 +12029,22 @@ __metadata:
languageName: node
linkType: hard

"tsx@npm:~4.19.2":
version: 4.19.2
resolution: "tsx@npm:4.19.2"
dependencies:
esbuild: "npm:~0.23.0"
fsevents: "npm:~2.3.3"
get-tsconfig: "npm:^4.7.5"
dependenciesMeta:
fsevents:
optional: true
bin:
tsx: dist/cli.mjs
checksum: 10c0/63164b889b1d170403e4d8753a6755dec371f220f5ce29a8e88f1f4d6085a784a12d8dc2ee669116611f2c72757ac9beaa3eea5c452796f541bdd2dc11753721
languageName: node
linkType: hard

"tunnel-agent@npm:^0.6.0":
version: 0.6.0
resolution: "tunnel-agent@npm:0.6.0"
Expand Down

0 comments on commit 36db14b

Please sign in to comment.