All notable changes to this project will be documented in this file.
- publiccode.yml 0.8 is supported:
publiccodeYmlVersion"0.8" and "0.8.0" are valid, WebP and AVIF images are accepted for the logo and the screenshots of 0.8 (and "0") files, andLATEST_SUPPORTEDis 0.8.0, so "0" maps to 0.8.0 andupgrade()goes to 0.8.0 by default. publiccode-parser-go still stops at 0.7:PARSER_LATEST(0.7.0) andisSupportedByParser()say what it accepts, andACCEPTED_VERSIONSlists what this library accepts. The v0 schema also annotates the 0.8.0 deprecations
validateVersion()inpubliccode-schema/validator: validates a file against a version of the standard, with the parser's rules or (strict: true) with that version's schema only, and returns errors, warnings and the deprecations up to that version. The per-version schemas are loaded on demand, one chunk each, sovalidate()alone is no biggervocabulary(),valueLabel()andVOCABULARY_FIELDS: values and labels (English and Italian) ofcategories,intendedAudience.scope,developmentStatus,softwareTypeandplatforms, with the version that added or deprecated a value. The Italian labels come from the Developers Italia catalogue, plus the five categories it was missing (design,design-system,integrated-library-system,regulations-and-directives,other);local-authoritiesis "Enti locali"- The CI smoke test also runs
validateVersion()andvocabulary()from the packed package
First release as an npm package.
publiccode-schema/validator:validate(), the custom Ajv formats and the parser's extra checks, moved here from publiccode-editor (src/app/validator/ajv) so that the editor and other tools share one copy- npm packaging: ESM bundles and type declarations in
dist/(bun run build), works withmoduleResolutionbundler,node16andnodenext;exportsfor.,./validatorand./data/* - CI (typecheck, tests, build, smoke test of the packed package with Node) and a release
workflow that publishes to npm from a
v*tag
- Breaking: the package is named
publiccode-schema(double c) and the schema$ids arepubliccode/root/v…instead ofpublicode/root/v… - License: AGPL-3.0-or-later, like publiccode-editor
fluent-json-schemaandyamlare development dependencies: the published library only needsajvandajv-formats
docs/validation-checklist.md: every publiccode-parser-go v0 rule, with its level (error or warning), whether the schema covers it, how JSON Schema can express it, and what changed after parser v5.2.1- vocabularies generated from the Go modules the editor's WASM uses
(
bun run vocab): BCP 47 subtags, ISO 3166-1 alpha-2 and alpha-3 country codes, SPDX licenses and exceptions, iPA codes, oEmbed schemes, the parser's email regex - a Go oracle (
scripts/vocab/oracle) that runs the parser's own validators, to test the custom formats against them - one schema per version of the standard (0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.7.0, 0.8.0),
built from its changelog: when keys appeared, until when they were mandatory, when
they were deprecated and what replaces them; next to
publiccode-schema-v0.json, which validates every 0.x version like the parser and is the one validators should use - form schemas, one per version, derived from the schema plus a small UI overlay
(
src/form/ui.ts): they only carry translation keys, following publiccode-editor'spubliccodeyml.<path>convention, and replace the hand-written form fields - a TypeScript library with no fluent-json-schema dependency (
src/index.ts):- versions:
schemaVersionFor(),LATEST_SUPPORTED(0.7.0),LATEST_KNOWN(0.8.0) deprecations(data): what's deprecated in a file, with the version that deprecated it and whether the parser reports it tooupgrade(data, { to }): migrates a file as the standard says (it→IT, lowercase country codes,IT.riuso.codiceIPA→organisation.uri,legal.repoOwner→organisation.name,IT.piattaforme.*andIT.conforme.gdpr→supportsaliases,monochromeLogo→logo...), without changing its input; fixes that drop information needlossy: truebuildSchema(),buildFormSchema(),withCountries(),sectionsFormSchema(),countryLocales()
- versions:
- country packages (
src/countries/), identified by ISO 3166-1 alpha-3 ids (ita):supportspresets, translations, version history, deprecation rules and sections. Theitapackage holds the standard'sITsection, with its translations in five languages. Experimental sections (a package's own, keyed by its id, e.g.nld:) are left out of the generated schemas, since the parser rejects them, and enabled by consumers. Seesrc/countries/README.md. - translations of the deprecation messages in en, it, de, fr and nl (
src/locales, andcountries.<id>.deprecationsin the country packages):locales(lang)anddeprecationKeys(finding) docs/versions-and-countries.md, and tests (bun test)
- the schema now matches publiccode-parser-go v0:
descriptionvalidated nothing: its language keys are BCP 47 tags and their values are checkedcontractor.emailwas validated as a dateplatformsno longer has a closed list of values- lowercase
countriesare accepted (the parser only warns) organisation.uriis mandatorysupports, version 0.7, the lowercaseitsection andfeaturesas mandatory were missing- custom formats for URLs, emails, MIME types, SPDX expressions, BCP 47 tags, country
codes, iPA codes, organisation URIs and
supportsids - the
maintenanceconditions oncontractorsandcontacts - dependency versions are strings, as the Go decoder reads any scalar as one
- the description of
IT.conforme.gdpr(copied frommisureMinimeSicurezza) tscerrors inisBasedOnand the license list; the library compiles for ES2020
- breaking: country packages have an
idandsectionsinstead ofcodeandsection;countriesandcountryById()replacestandardCountries()andcountryByCode() bun run genwritespubliccode-schema-v0.json, the versioned schemas and form schemas, anddata/countries/<id>.json;src/form-schema.tsand theformFieldsof the definitions are gone