- src/lib/dkc/version.ts exports VERSION (0.1.0-dev, which becomes 0.1.0 once phase 2 adds the opening of capsules) and SPEC_VERSION (0.8.2, the tag spec-v0.8.2 of datekeys-go), from index.ts too. - package.json and its lockfile move to 0.1.0-dev. version.test.ts ties VERSION to both and checks it is semantic versioning. It also ties SPEC_VERSION to the spec field of the shared vectors and fixtures. testing/vectors.ts now takes SPEC_VERSION from version.ts, so every vector file is checked against the version the library declares. - The footer of the page shows both, instead of a fixed 0.8.2. - README.md gains a "Versiones" section: the three versions (format, specification, library) and what 0.1.0-dev covers. CHANGELOG.md is new. The Go reference gained datekeys.SpecVersion, datekeys.Version() and `datekeys version` in 5b342d3. npm run verify is green: 2,406 tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>main
parent
27083805c2
commit
a9bdcecc28
@ -0,0 +1,24 @@
|
||||
# Changelog
|
||||
|
||||
Cambios notables de la librería TypeScript y de la página. El proyecto usa versionado semántico; mientras sea 0.x, no hay promesa de estabilidad. La sección «Versiones» del [README](README.md) explica qué cubre cada número.
|
||||
|
||||
## 0.1.0 — sin publicar
|
||||
|
||||
Implementa la especificación DateKeys 0.8.2 (tag `spec-v0.8.2` de `datekeys-go`) para el perfil Quicknet, y pasa todos los vectores y fixtures compartidos de `datekeys-go` en `9ac9cd9`.
|
||||
|
||||
### Hecho
|
||||
|
||||
- Codec CBOR del perfil de §58 con los textos de error de la referencia Go.
|
||||
- Schemas del Provider Profile, `PUBLIC_HEADER`, `CONTROL_CBOR` y `.dkk`.
|
||||
- Tramas DKC1 y DKK1, cabeceras `age` y DateKey (`dk1_`).
|
||||
- Extensiones, con los objetos y arrays de su registro.
|
||||
- La inspección de los pasos 1 a 8 de §63.
|
||||
- La página estática `/inspect`, sin red. Tras cada compilación se comprueban su política de seguridad y los paquetes de su bundle.
|
||||
- Fase 2, en curso:
|
||||
- dependencias de ejecución (`age-encryption` 0.3.1, `@noble/curves` y `@noble/hashes` 2.4.0) con sus guardas;
|
||||
- el IBE de tlock (`ibe.ts`) y la verificación local de releases (`release.ts`), contrastados con la referencia Go.
|
||||
- `VERSION` y `SPEC_VERSION`, también en el pie de la página.
|
||||
|
||||
### Pendiente para 0.1.0
|
||||
|
||||
- La apertura de cápsulas, pasos 9 a 18 de §63 (fase 2, pasos 5 a 8).
|
||||
@ -0,0 +1,24 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { readJSON } from './testing/testdata.ts';
|
||||
import { SPEC_VERSION, VERSION } from './version.ts';
|
||||
|
||||
// The version of the library is the one of package.json and its lockfile;
|
||||
// the version of the specification is the one every shared vector file
|
||||
// names (vectors.test.ts checks each file against it).
|
||||
describe('versions', () => {
|
||||
it('VERSION is the version of package.json and of its lockfile, in semantic versioning', () => {
|
||||
const root = new URL('../../../', import.meta.url);
|
||||
const pkg = JSON.parse(readFileSync(new URL('package.json', root), 'utf8')) as { version: string };
|
||||
const lock = JSON.parse(readFileSync(new URL('package-lock.json', root), 'utf8')) as { version: string; packages: Record<string, { version?: string }> };
|
||||
expect(VERSION).toBe(pkg.version);
|
||||
expect([lock.version, lock.packages['']?.version]).toEqual([VERSION, VERSION]);
|
||||
expect(VERSION).toMatch(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/);
|
||||
});
|
||||
|
||||
it('SPEC_VERSION is the specification of the shared vectors and fixtures', () => {
|
||||
for (const file of ['vectors/cbor.json', 'vectors/mutations.json', 'vectors/tlock_ibe.json', 'fixtures/time_only.json']) {
|
||||
expect(readJSON<{ spec: string }>(file).spec, file).toBe(SPEC_VERSION);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,17 @@
|
||||
// The versions of this library. There are three, each with its own meaning
|
||||
// (README, "Versiones"): the format versions inside the objects (framing and
|
||||
// schema, 1 today; spec §70), the version of the specification it
|
||||
// implements, and its own version.
|
||||
|
||||
/**
|
||||
* The version of this library, as in package.json: 0.1.0 once phase 2 adds
|
||||
* the opening of capsules to their inspection; 0.1.0-dev until then.
|
||||
*/
|
||||
export const VERSION = '0.1.0-dev';
|
||||
|
||||
/**
|
||||
* The version of the DateKeys Protocol Specification that this library
|
||||
* implements: the tag spec-v0.8.2 of the Go reference, whose shared vectors
|
||||
* and fixtures (testdata/) all name it.
|
||||
*/
|
||||
export const SPEC_VERSION = '0.8.2';
|
||||
Loading…
Reference in new issue