Skip to content

Commit 9c2b951

Browse files
authored
Merge pull request #962 from joshunrau/dev
2 parents a8fb0e0 + 4e64f30 commit 9c2b951

32 files changed

Lines changed: 174 additions & 87 deletions

File tree

.github/scripts/lib.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export async function getLatestPublishedVersion({ github }) {
3838
);
3939
}
4040
}
41+
// eslint-disable-next-line no-console
4142
console.log(`Found latest published version: ${packageVersion}`);
4243
return packageVersion;
4344
}

apps/api/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"dependencies": {
2020
"@casl/ability": "catalog:",
2121
"@casl/prisma": "catalog:",
22-
"@douglasneuroinformatics/libcrypto": "^0.0.2",
22+
"@douglasneuroinformatics/libcrypto": "catalog:",
2323
"@douglasneuroinformatics/libjs": "catalog:",
24-
"@douglasneuroinformatics/libnest": "^0.1.1",
25-
"@douglasneuroinformatics/libpasswd": "^0.0.3",
24+
"@douglasneuroinformatics/libnest": "catalog:",
25+
"@douglasneuroinformatics/libpasswd": "catalog:",
2626
"@douglasneuroinformatics/libstats": "catalog:",
2727
"@faker-js/faker": "^9.0.0",
2828
"@nestjs/axios": "^3.0.3",
@@ -56,7 +56,7 @@
5656
"zod": "workspace:zod__3.23.x@*"
5757
},
5858
"devDependencies": {
59-
"@douglasneuroinformatics/esbuild-plugin-prisma": "^1.0.0",
59+
"@douglasneuroinformatics/esbuild-plugin-prisma": "catalog:",
6060
"@nestjs/testing": "^10.4.1",
6161
"@opendatacapture/instrument-stubs": "workspace:*",
6262
"@types/express": "^4.17.21",

apps/api/scripts/build.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env tsx
22

3+
/* eslint-disable no-console */
4+
35
import fs from 'fs/promises';
46
import module from 'module';
57
import path from 'path';
@@ -28,7 +30,7 @@ const options: { external: NonNullable<unknown>; plugins: NonNullable<unknown> }
2830
},
2931
bundle: true,
3032
define: {
31-
__RELEASE_INFO__: JSON.stringify(await getReleaseInfo())
33+
__RELEASE__: JSON.stringify(await getReleaseInfo())
3234
},
3335
entryPoints: [entryFile],
3436
external: ['@nestjs/microservices', '@nestjs/websockets/socket-module', 'class-transformer', 'class-validator'],

apps/api/src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ async function bootstrap() {
1818
const configurationService = app.get(ConfigurationService);
1919
const logLevels: LogLevel[] = ['error', 'fatal', 'log', 'warn'];
2020
if (configurationService.get('DEBUG')) {
21+
// eslint-disable-next-line no-console
2122
console.log("Enabled 'debug' logs");
2223
logLevels.push('debug');
2324
}
2425
if (configurationService.get('VERBOSE')) {
26+
// eslint-disable-next-line no-console
2527
console.log("Enabled 'verbose' logs");
2628
logLevels.push('verbose');
2729
}
@@ -43,6 +45,7 @@ async function bootstrap() {
4345

4446
await app.listen(port);
4547

48+
// eslint-disable-next-line no-console
4649
console.log(`Application is running on: ${await app.getUrl()}`);
4750
}
4851

apps/api/src/setup/setup.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class SetupService {
2929
isDemo: Boolean(savedOptions?.isDemo),
3030
isGatewayEnabled: this.configurationService.get('GATEWAY_ENABLED'),
3131
isSetup: Boolean(savedOptions?.isSetup),
32-
releaseInfo: __RELEASE_INFO__,
32+
release: __RELEASE__,
3333
uptime: Math.round(process.uptime())
3434
} satisfies SetupState;
3535
}

apps/api/src/typings/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ReleaseInfo } from '@opendatacapture/schemas/setup';
22

33
declare global {
4-
const __RELEASE_INFO__: ReleaseInfo;
4+
const __RELEASE__: ReleaseInfo;
55
}

apps/gateway/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"lint": "tsc && eslint --fix src"
1717
},
1818
"dependencies": {
19-
"@douglasneuroinformatics/libcrypto": "^0.0.2",
19+
"@douglasneuroinformatics/libcrypto": "catalog:",
2020
"@douglasneuroinformatics/libui": "catalog:",
2121
"@opendatacapture/instrument-renderer": "workspace:*",
2222
"@opendatacapture/react-core": "workspace:*",
@@ -37,7 +37,7 @@
3737
"zod": "workspace:zod__3.23.x@*"
3838
},
3939
"devDependencies": {
40-
"@douglasneuroinformatics/esbuild-plugin-prisma": "^1.0.0",
40+
"@douglasneuroinformatics/esbuild-plugin-prisma": "catalog:",
4141
"@opendatacapture/release-info": "workspace:*",
4242
"@opendatacapture/vite-plugin-runtime": "workspace:*",
4343
"@types/compression": "^1.7.5",

apps/gateway/scripts/build.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ await esbuild.build({
1616
},
1717
bundle: true,
1818
define: {
19+
__RELEASE__: JSON.stringify(await getReleaseInfo()),
1920
'import.meta.env.DEV': 'false',
20-
'import.meta.env.PROD': 'true',
21-
'import.meta.env.RELEASE_INFO': JSON.stringify(await getReleaseInfo())
21+
'import.meta.env.PROD': 'true'
2222
},
2323
entryPoints: [entryFile],
2424
external: ['lightningcss'],
@@ -35,4 +35,5 @@ await esbuild.build({
3535
tsconfig
3636
});
3737

38+
// eslint-disable-next-line no-console
3839
console.log('Done!');

apps/gateway/scripts/dev.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env tsx
22

3+
/* eslint-disable no-console */
4+
35
import fs from 'fs';
46
import module from 'module';
57
import path from 'path';
@@ -19,7 +21,7 @@ if (fs.existsSync(outdir)) {
1921

2022
await fs.promises.mkdir(outdir);
2123

22-
const releaseInfo = await getReleaseInfo();
24+
const release = await getReleaseInfo();
2325

2426
await new Promise<BuildResult>((resolve, reject) => {
2527
esbuild
@@ -29,9 +31,9 @@ await new Promise<BuildResult>((resolve, reject) => {
2931
},
3032
bundle: true,
3133
define: {
34+
__RELEASE__: JSON.stringify(release),
3235
'import.meta.env.DEV': 'true',
33-
'import.meta.env.PROD': 'false',
34-
'import.meta.env.RELEASE_INFO': JSON.stringify(releaseInfo)
36+
'import.meta.env.PROD': 'false'
3537
},
3638
entryPoints: [
3739
path.resolve(import.meta.dirname, '../src/main.ts'),

apps/gateway/src/routers/api.router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ router.delete(
118118
router.get('/healthcheck', (_, res) => {
119119
res.status(200).json({
120120
ok: true,
121-
releaseInfo: import.meta.env.RELEASE_INFO,
121+
release: __RELEASE__,
122122
status: 200,
123123
uptime: Math.round(process.uptime())
124124
} satisfies GatewayHealthcheckSuccessResult);

0 commit comments

Comments
 (0)