Skip to content

Commit 9d1a447

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 8dbab0a commit 9d1a447

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

packages/uma/bin/demo.ts renamed to packages/uma/bin/demo.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as path from 'path';
2-
import { ComponentsManager } from 'componentsjs';
3-
import { App, setGlobalLoggerFactory, WinstonLoggerFactory } from '@solid/community-server';
1+
const path = require('path');
2+
const { ComponentsManager } = require('componentsjs');
3+
const { setGlobalLoggerFactory, WinstonLoggerFactory } = require('@solid/community-server');
44

55
const protocol = 'http';
66
const host = 'localhost';
@@ -9,8 +9,8 @@ const port = 4000;
99
const baseUrl = `${protocol}://${host}:${port}/uma`;
1010
const rootDir = path.join(__dirname, '../');
1111

12-
export const launch: () => Promise<void> = async () => {
13-
const variables: Record<string, unknown> = {};
12+
const launch = async () => {
13+
const variables = {};
1414

1515
variables['urn:uma:variables:port'] = port;
1616
variables['urn:uma:variables:baseUrl'] = baseUrl;
@@ -31,7 +31,7 @@ export const launch: () => Promise<void> = async () => {
3131

3232
await manager.configRegistry.register(configPath);
3333

34-
const umaServer: App = await manager.instantiate('urn:uma:default:App',{variables});
34+
const umaServer = await manager.instantiate('urn:uma:default:App',{variables});
3535
await umaServer.start();
3636
};
3737

packages/uma/bin/main.ts renamed to packages/uma/bin/main.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as path from 'path';
2-
import { ComponentsManager } from 'componentsjs';
3-
import { App, setGlobalLoggerFactory, WinstonLoggerFactory } from '@solid/community-server';
1+
const path = require('path');
2+
const { ComponentsManager } = require('componentsjs');
3+
const { setGlobalLoggerFactory, WinstonLoggerFactory } = require('@solid/community-server');
44

55
const protocol = 'http';
66
const host = 'localhost';
@@ -9,8 +9,8 @@ const port = 4000;
99
const baseUrl = `${protocol}://${host}:${port}/uma`;
1010
const rootDir = path.join(__dirname, '../');
1111

12-
export const launch: () => Promise<void> = async () => {
13-
const variables: Record<string, unknown> = {};
12+
const launch = async () => {
13+
const variables = {};
1414

1515
variables['urn:uma:variables:port'] = port;
1616
variables['urn:uma:variables:baseUrl'] = baseUrl;
@@ -31,7 +31,7 @@ export const launch: () => Promise<void> = async () => {
3131

3232
await manager.configRegistry.register(configPath);
3333

34-
const umaServer: App = await manager.instantiate('urn:uma:default:App',{variables});
34+
const umaServer = await manager.instantiate('urn:uma:default:App',{variables});
3535
await umaServer.start();
3636
};
3737

packages/uma/bin/odrl.ts renamed to packages/uma/bin/odrl.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { App, setGlobalLoggerFactory, WinstonLoggerFactory } from '@solid/community-server';
2-
import * as path from 'path';
3-
import { ComponentsManager } from 'componentsjs';
1+
const path = require('path');
2+
const { ComponentsManager } = require('componentsjs');
3+
const { setGlobalLoggerFactory, WinstonLoggerFactory } = require('@solid/community-server');
44

55
const protocol = 'http';
66
const host = 'localhost';
@@ -9,8 +9,8 @@ const port = 4000;
99
const baseUrl = `${protocol}://${host}:${port}/uma`;
1010
const rootDir = path.join(__dirname, '../');
1111

12-
export const launch: () => Promise<void> = async () => {
13-
const variables: Record<string, any> = {};
12+
const launch = async () => {
13+
const variables = {};
1414

1515
variables['urn:uma:variables:port'] = port;
1616
variables['urn:uma:variables:baseUrl'] = baseUrl;
@@ -31,7 +31,7 @@ export const launch: () => Promise<void> = async () => {
3131

3232
await manager.configRegistry.register(configPath);
3333

34-
const umaServer: App = await manager.instantiate('urn:uma:default:App',{variables});
34+
const umaServer = await manager.instantiate('urn:uma:default:App',{variables});
3535
await umaServer.start();
3636
};
3737

packages/uma/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
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",
59-
"start:odrl": "yarn run -T tsx bin/odrl.ts",
60-
"demo": "yarn run -T tsx bin/demo.ts"
58+
"start": "node bin/main.js",
59+
"start:odrl": "node bin/odrl.js",
60+
"demo": "node bin/demo.js"
6161
},
6262
"dependencies": {
6363
"@httpland/authorization-parser": "^1.1.0",

0 commit comments

Comments
 (0)