The console's public repository and the commit it was built from, in the form https://coffeylabs.org/specs/well-known-source/ defines. The commit comes from INBUXA_REVISION, which the image build passes in; a build without one writes nothing, and nginx answers that address with a 404 rather than the app. tsconfig.node.json drops source-archive.ts, gone since #7.
26 lines
860 B
TypeScript
26 lines
860 B
TypeScript
// SPDX-FileCopyrightText: 2026 Coffey Labs LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
import { REPOSITORY, sourceDocument } from './well-known-source'
|
|
|
|
const COMMIT = '808e6e4c2a1d5e8b7f6a9c0d1e2f3a4b5c6d7e8f'
|
|
|
|
describe('.well-known/source', () => {
|
|
it('names the repository and the commit', () => {
|
|
const doc = JSON.parse(sourceDocument('27.1-rc.2', COMMIT)!)
|
|
expect(doc).toEqual({
|
|
version: 1,
|
|
software: [
|
|
{ name: 'inbuxa Admin', version: '27.1-rc.2', license: 'AGPL-3.0-only', repository: REPOSITORY, revision: COMMIT },
|
|
],
|
|
})
|
|
})
|
|
|
|
it('says nothing without a full commit id', () => {
|
|
for (const revision of [undefined, '', '808e6e4', 'v27.1-rc.2', COMMIT.replace(/f/g, 'g')]) {
|
|
expect(sourceDocument('27.1-rc.2', revision)).toBeUndefined()
|
|
}
|
|
})
|
|
})
|