Skip to content

Commit 293ea81

Browse files
committed
chore: Build startup scripts instead of using tsx
For some reason, tsx could not exit gracefully when running these. Either it got stuck, or exited but left the process running. These issues did not occur with ts-node, but the solution in this commit seemed more acceptable than having a new dependency. Future work could include investigating if this is an issue with the server.
1 parent 69ab89b commit 293ea81

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

packages/uma/bin/demo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const host = 'localhost';
77
const port = 4000;
88

99
const baseUrl = `${protocol}://${host}:${port}/uma`;
10-
const rootDir = path.join(__dirname, '../');
10+
// ../../ since this script will end up in dist/bin
11+
const rootDir = path.join(__dirname, '../../');
1112

1213
export const launch: () => Promise<void> = async () => {
1314
const variables: Record<string, unknown> = {};

packages/uma/bin/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const host = 'localhost';
77
const port = 4000;
88

99
const baseUrl = `${protocol}://${host}:${port}/uma`;
10-
const rootDir = path.join(__dirname, '../');
10+
// ../../ since this script will end up in dist/bin
11+
const rootDir = path.join(__dirname, '../../');
1112

1213
export const launch: () => Promise<void> = async () => {
1314
const variables: Record<string, unknown> = {};

packages/uma/bin/odrl.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const host = 'localhost';
77
const port = 4000;
88

99
const baseUrl = `${protocol}://${host}:${port}/uma`;
10-
const rootDir = path.join(__dirname, '../');
10+
// ../../ since this script will end up in dist/bin
11+
const rootDir = path.join(__dirname, '../../');
1112

1213
export const launch: () => Promise<void> = async () => {
1314
const variables: Record<string, any> = {};

packages/uma/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"build": "yarn build:ts && yarn build:components",
5656
"build:ts": "yarn run -T tsc",
5757
"build:components": "yarn run -T componentsjs-generator -r sai-uma -s src -c dist/components -i .componentsignore --lenient",
58-
"start": "yarn run -T tsx bin/main.ts",
58+
"start": "node ./dist/bin/main.js",
5959
"start:odrl": "yarn run -T tsx bin/odrl.ts",
6060
"demo": "yarn run -T tsx bin/demo.ts"
6161
},

packages/uma/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
"strictNullChecks": true,
2020
"lib": ["ES2022"]
2121
},
22-
"include": ["src", "types"],
22+
"include": ["bin", "src", "types"],
2323
"exclude": ["node_modules", "**/*.test.ts"]
2424
}

0 commit comments

Comments
 (0)