-
Notifications
You must be signed in to change notification settings - Fork 3
Report version from manifest #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ffde8e0
cbee166
93eba67
1f4a528
4ad9ee8
c8a9209
5239115
9a84046
ede943f
6a40a04
7e432ec
740ec9b
912d857
3e84548
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,16 @@ import { addChannelToSubscription, deleteChannelFromSubscription, postEvent, pus | |
| // @deno-types="npm:@types/nconf" | ||
| import nconf from 'npm:nconf' | ||
|
|
||
| const cheloniaAppManifest = await (async () => { | ||
| try { | ||
| return await import(join(process.cwd(), 'chelonia.json'), { | ||
| with: { type: 'json' } | ||
| }) | ||
|
corrideat marked this conversation as resolved.
Outdated
|
||
| } catch { | ||
| console.warn('`chelonia.json` not found. Version information will be unavailable.') | ||
|
corrideat marked this conversation as resolved.
Outdated
|
||
| } | ||
| })() | ||
|
|
||
| const ARCHIVE_MODE = nconf.get('server:archiveMode') | ||
|
|
||
| if (CREDITS_WORKER_TASK_TIME_INTERVAL && OWNER_SIZE_TOTAL_WORKER_TASK_TIME_INTERVAL > CREDITS_WORKER_TASK_TIME_INTERVAL) { | ||
|
|
@@ -49,8 +59,6 @@ const creditsWorker = ARCHIVE_MODE || !CREDITS_WORKER_TASK_TIME_INTERVAL | |
| ? undefined | ||
| : createWorker(join(import.meta.dirname || '.', import.meta.workerDir || '.', 'creditsWorker.js')) | ||
|
|
||
| const { CONTRACTS_VERSION, GI_VERSION } = process.env | ||
|
|
||
| // Dynamic runtime import to bypass bundling issues with npm: specifier | ||
| const hapi = new Hapi.Server({ | ||
| // debug: false, // <- Hapi v16 was outputing too many unnecessary debug statements | ||
|
|
@@ -426,8 +434,11 @@ sbp('okTurtles.data/set', PUBSUB_INSTANCE, createServer(hapi.listener, { | |
| serverHandlers: { | ||
| connection (socket) { | ||
| const versionInfo = { | ||
| GI_VERSION: GI_VERSION || null, | ||
| CONTRACTS_VERSION: CONTRACTS_VERSION || null | ||
| appVersion: cheloniaAppManifest?.appVersion || null, | ||
| contractsVersion: Object.fromEntries( | ||
| Object.entries(cheloniaAppManifest?.contracts || {}) | ||
| .map(([k, v]) => [k, (v as Record<string, number | string>).version]) | ||
| ) | ||
|
corrideat marked this conversation as resolved.
Outdated
corrideat marked this conversation as resolved.
Outdated
|
||
| } | ||
| socket.send(createNotification(NOTIFICATION_TYPE.VERSION_INFO, versionInfo)) | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.