Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 53 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ there is described in full here. This list is where to start.
`{ routes: { framework: "fastify", expose, filter } }`, `emitsApiDocs` →
`{ apiDocs: { subDir } }`, and `emitsModelDocs` is dropped with nothing in its place (the docs
Markdown generator it marked is removed). The refusal prints the declaration for each.
The name-based fallbacks that treated a copy named like a shipped generator as providing its
tier are removed with them, and so is their export, `UI_TIER_GENERATOR_NAMES`.
- **`formatTs` and the ts-poet printer** go; write through `TsWriter`:

```ts
Expand Down Expand Up @@ -337,6 +339,11 @@ there is described in full here. This list is where to start.
that called `@metaobjectsdev/docs-site`'s `generateSite({ sourceDirs })` loads the model itself
now and calls `buildDocsView` and `generateExplorerSite({ ..., output: "static" })`:
[docs-are-generators](docs/features/migrations/docs-are-generators.md#since-130-generatesite-is-removed).
`@metaobjectsdev/docs-site` no longer exports `DEFAULT_ASSET_BASE` either, and the page builders
of the removed Markdown generator leave `@metaobjectsdev/codegen-ts` and
`@metaobjectsdev/codegen-ts/generators`: `buildEntityDocData`, `buildTemplateDocData` and
`renderMermaidErBlock`. An owned generator that built pages from them reads the model through
`buildDocsView` instead.
- **`requirementsFile()` no longer writes `requirements.md`** (every port). The `requirements`
generator writes only `requirements.toon`; people read the ledger in the explorer and agents in
`agent/requirements.md`. The next `gen` deletes the generated `requirements.md` without a
Expand Down Expand Up @@ -440,8 +447,18 @@ there is described in full here. This list is where to start.
one of `output-parser` and `extractor` you own; delete
`codegen/runtime/extract_schema_emitter.py` and re-eject `trace-helper` (eject never overwrites
an existing `codegen/runtime/` copy, even with `--force`). The module aliases added in 1.1.0
(`metaobjects.codegen.extract_delegate_emitter` and the others listed under Changed) are removed:
import from `metaobjects.codegen.runtime.*`.
are removed. Import each from its new path:
`metaobjects.codegen.extract_delegate_emitter`, `metaobjects.codegen.extract_schema_emitter`,
`metaobjects.codegen.fr010_field_mapping`, `metaobjects.codegen.output_format_spec_emitter`,
`metaobjects.codegen.generators.fr019_shared_enum` and `metaobjects.codegen.generators.m2m_codegen`
keep their module name under `metaobjects.codegen.runtime`; `metaobjects.apidocs.api_model`,
`metaobjects.apidocs.builder`, `metaobjects.apidocs.renderer` and `metaobjects.apidocs.paths` are
`metaobjects.codegen.runtime.api_docs_model`, `api_docs_builder`, `api_docs_renderer` and
`api_docs_paths` (`metaobjects.apidocs.naming` stays). In `metaobjects.codegen.runtime.extract_delegate_emitter`, `nested_mirror_dataclasses`,
`nested_mappers` and `delegate_helpers` are `write_nested_mirror_dataclasses`,
`write_nested_mappers` and `write_delegate_helpers`, which take the writer; in
`extract_schema_emitter`, `mirror_dataclass` and `mirror_initializer` are removed with no
replacement (no generator called them; the nested writers above write the mirrors).
- **Java: the `mustache` generator is removed.** Replace a `MustacheTemplateGenerator`
`<generator>` with `com.metaobjects.generator.template.TemplateScopeGenerator` and its args
`templatesDir`, `template`, `scope` and `outputPattern` (docs/features/codegen-concepts.md), and
Expand Down Expand Up @@ -499,28 +516,58 @@ there is described in full here. This list is where to start.
which send none unless the caller passes one:
[default-list-page-of-fifty](docs/features/migrations/default-list-page-of-fifty.md).
- **C#: the route helpers are the `MetaObjects.AspNetCore` package.** `MetaObjects.Codegen` and the
`dotnet meta` tool no longer carry EF Core or ASP.NET Core, and the helpers (`FilterParser`,
`FilterPredicate`, `ValueObjectValidator` and the rest) moved to the new package. Add
`dotnet meta` tool no longer carry EF Core or ASP.NET Core, and the helpers moved from namespace
`MetaObjects.Codegen.Runtime` to the new package's namespace `MetaObjects.AspNetCore`:
`FilterParser`, `FilterParseResult`, `FilterPredicate`, `EfCoreFilterDispatch`,
`ValueObjectValidator`, `ConstraintErrors` (with `ConstraintFailure` and `ConstraintKind`),
`ValidationIssues`, `UnknownFieldCheck`, `Iso8601TimestampConverter`, `DecimalWire`,
`DurationWire`, `DecimalRangeEndpointFilter`, `ReportExportHttp` and `SerializerKeys`. Change a
hand-written `using MetaObjects.Codegen.Runtime;` that names one to `using MetaObjects.AspNetCore;`. Add
`<PackageReference Include="MetaObjects.AspNetCore" Version="1.3.0" />` to the project that compiles the
generated routes; the next `dotnet meta gen` moves the `using` line. Generated list routes also speak the
REST standard (`?search`, `filter[or]`, `filter[and]`), answer `400 {"error": "invalid_json"}` for a body
that is not JSON and `400 {"error": "invalid_id"}` for a path id the key cannot hold, and an owned copy
that sets `routes` and not `filter-allowlist` re-ejects both together.
- **C#: an owned or subclassed generator writes through `CsWriter`, under new names.** On
`EntityGenerator`, the property emitters `ScalarProperty`, `EnumProperty`, `ObjectNavProperty`,
`MapProperty`, `TphSubtypeScalarProperty` and `TphSubtypeEnumProperty` are now
`WriteScalarProperty` and so on, and take a `CsWriter`; the static `M2mNavProperty` is
`WriteM2mNavProperty(CsWriter, ...)`; `AppendStringValidatorAttributes`,
`AppendNumericValidatorAttributes` and `AppendArrayValidatorAttributes` are
`WriteStringValidatorAttributes` and its pair; and `EmitSharedEnumsFile`, which returned one
file, is `EmitSharedEnumFiles`, which returns one file per shared enum. On `ExtractDelegateEmitter`,
`DelegatingMembers` is `WriteDelegatingMembers(CsWriter, ...)`. The `Emit*` class hooks take a
`CsWriter` in place of the `StringBuilder`. `CSharpNaming.AssertNoCollectionNameCollisions` is
removed: the generators claim each name through `GenContext.Claim`, and two entities with one
DbSet name fail with `ERR_COLLECTION_NAME_COLLISION`. Rename the override, or re-eject.
- **C#: two members of the public metadata API are removed.** `ErrorCode.ERR_ENUM_INT_VALUE_MAP_ARRAY`
is gone, because an int-backed enum array now loads (under Added); drop a check for it.
`RegistryManifest.ExclusionReason` loses `PresentationOnly` and `NativeBinding`: the view
controls and `@object` are in the registry manifest now, marked with the ports that implement
them (`implementedIn`), so nothing is excluded for either reason.
- **C#: a missing design-time services line is a generation error.** A project that declares
`@sequenceStart`, whose `ModelSnapshot.cs` `dotnet meta gen` can see in another project, and whose
migrations project does not carry `[assembly: DesignTimeServicesReference]` now fails with
`ERR_DESIGN_TIME_REFERENCE_MISSING`, naming the project and the line to add. It was a warning, and the
next `dotnet ef migrations add` would have scaffolded `RESTART WITH n`.
- **Python: `ObjectManager` is the abstract contract, and the class you constructed is
`ObjectManagerDb` (breaking, by hand).** Constructing `ObjectManager(root, driver)` raises a `TypeError`
that names the replacement; there is no alias. Find every site with `grep -rn "ObjectManager(" .`:
that names the replacement; there is no alias. Find every site with `grep -rn "ObjectManager(" .`.
`DbApiDriver`, `PostgresDriver` and `SelectResult` are no longer importable from
`metaobjects.runtime.object_manager`; import them from `metaobjects.runtime` or
`metaobjects.runtime.drivers`:
[python-object-manager-split](docs/features/migrations/python-object-manager-split.md).
- **`@metaobjectsdev/ai-runtime` is no longer published.** The `trace-helper` generator writes its call loop
(`llm-call.ts`) into the project, so remove the dependency and regenerate:
[ai-runtime-unpublished](docs/features/migrations/ai-runtime-unpublished.md).
- **react: `<ImageUpload>` is imported from `@metaobjectsdev/react/image-upload`, and `react-easy-crop` is
an optional peer.** Only a project that uses the component installs it:
an optional peer.** `cropToBlob` moves with it, to the same subpath. Only a project that uses the
component installs it:
[react-image-upload-subpath](docs/features/migrations/react-image-upload-subpath.md).
- **`@metaobjectsdev/sdk` no longer exports `CONCERN_TOKENS` or `detectConcerns`** (from the root
or `@metaobjectsdev/sdk/agent-context`). The agent-context skills stopped gating their reference
pages on concerns observed in the project, so the requirements pages install in every stack
and there is nothing left to detect; drop the import.
- **The empty `@metaobjectsdev/forge` package is removed.** It exported nothing and had no importer; the
forge vocabulary is unchanged and ships in `@metaobjectsdev/sdk` as `forgeTypesProvider`.
- **A business-rules refusal is new at load.** Two operations or transitions whose permission names
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ means adding/updating a conformance fixture** so every port verifies it — see
(TS: `server/typescript/packages/metadata/src/constants.ts`).
- **No `any` escape hatches** (TS) — use `unknown` and narrow.
- **No backwards-compat hacks.**
- **A deliberate break changes a compatibility test; it never deletes it.** When a break makes a
test of an older contract obsolete (a legacy-form, compat, owned-copy or extension-seam test),
change it to expect the clear failure the old form now gets, and add the upgrade note that names
the change. Review refuses a pull request that deletes such a test instead: in 1.3.0, three
compatibility tests deleted with their breaks left nothing to flag the upgrade notes they made
wrong.
- **A removed public name needs an upgrade note.** `scripts/check-export-surface.mjs` compares each
port's public names with the last release and fails until every removed one is named, in an
inline code span beside its package, module or type, in the release's "Upgrading from" list (or a
fragment's `Upgrading:` paragraph).
- Match the surrounding code's style, naming, and idioms.
- Read an existing generator/port before adding a new one — the patterns are
intentionally consistent.
Expand Down
3 changes: 3 additions & 0 deletions changelog.d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ apply to the CHANGELOG:
- A change that moves `metamodelVersion` says that it moved, and to what.
- Upgrade notes go in the same bullet, as an indented paragraph that starts `Upgrading:`. The
release author moves them under the release's `### Upgrading` heading when writing the section.
A change that removes or renames a public name (an export, a public module, class, member or
type) names the old name in a code span in that paragraph: `scripts/check-export-surface.mjs`
reads it and fails while a removed name is not there.

Fragments are for unreleased work only. A released section of `CHANGELOG.md` is edited in place.
14 changes: 14 additions & 0 deletions changelog.d/export-surface-and-candidate-changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- **Every public name a release removes is in its upgrade list, and a candidate carries that
list.** In 1.3.0 five estates followed the CHANGELOG and hit removed names it did not give, and
one read a stale copy because the candidate's packages carried none. A new check,
`scripts/check-export-surface.mjs`, lists each port's public names (TypeScript package entries,
Python modules, Java and Kotlin classes and their public and protected members, C# types and
members), compares them with what the last release published (`scripts/export-surface/baseline/`,
recorded from the registries by `scripts/export-surface/record-published.mjs`), and fails until
every removed one is named in the "Upgrading from" list or a fragment's `Upgrading:` paragraph.
It runs in each port's lane of `scripts/ci-local.sh` and before a pre-release candidate
publishes anything; its first run, against 1.2.3, added 31 missing names to the 1.3.0 upgrade
list. Every package of a candidate now carries `CHANGELOG.md`: the unreleased sections and a
link to the released history. It is in each npm package, at each NuGet package's root, in the
PyPI sdist and the wheel (`metaobjects/CHANGELOG.md`), in each Maven jar
(`META-INF/CHANGELOG.md`) and in each Cargo crate.
11 changes: 11 additions & 0 deletions changelog.d/gen-syntax-check-csharp-jvm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- **C#, Java and Kotlin: `gen` and `verify` refuse generated output that does not parse.** As the
TypeScript and Python ports already do, every emitted `.cs`, `.java` and `.kt` file is parsed
(Roslyn's `CSharpSyntaxTree.ParseText`, the JDK's `javac` parser, the Kotlin compiler's PSI
parser; no compilation and no classpath) before it is written or compared, and a file that does
not parse fails the run with `ERR_GEN_SYNTAX`, naming the file, the generator and the first
error's line and column. In C# nothing from the run is written; in Java and Kotlin the broken
file is not written and the run fails before the hash manifest is. Valid output is unchanged.
`MetaObjects.Codegen` (and so the `dotnet meta` tool) now depends on `Microsoft.CodeAnalysis.CSharp`,
and `metaobjects-codegen-kotlin` on `kotlin-compiler-embeddable`. On a bare JRE, which has no Java
parser, `gen` and `verify` fail with `ERR_GEN_SYNTAX` naming the missing JDK: run the build on a
JDK.
14 changes: 14 additions & 0 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,20 @@ default, so a dispatch meant to report cannot write.
Then verify: `npm dist-tag ls @metaobjectsdev/<pkg>` — authoritative, where `npm view` is
CDN-cached and lags right after publish.

### 5. Record the export-surface baseline

Once the release is on every registry it went to, record what they published as the baseline the
next release's public names are compared with, and commit it:

```bash
node scripts/export-surface/record-published.mjs <version>
```

Until this lands, `scripts/check-export-surface.mjs` compares the next release with the one before
this one and reads both releases' upgrade lists, so a name this release's list already gave is
taken as named again when the next release removes something with the same name. See
[`scripts/export-surface/README.md`](../scripts/export-surface/README.md).

## Patch from a maintenance branch (`release/<major>.<minor>`)

**When.** `main` already holds work for the next minor (or major) that must not ship yet, and a
Expand Down
17 changes: 17 additions & 0 deletions docs/features/prerelease.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,23 @@ version files, so the row is the only change the run leaves; **commit it**, so t
records what each candidate was built from. Build a candidate from a commit that is already
pushed: a sha nobody can fetch is not a record.

**The upgrade list is checked first.** Before it edits or publishes anything, the run checks, for
each port it publishes, that every public name removed since the last release is named in the
CHANGELOG upgrade list (`scripts/check-export-surface.mjs`; how it matches names is in
[`scripts/export-surface/README.md`](../../scripts/export-surface/README.md)). A name the list
does not give stops the run. The C# and Java checks build those ports first.

**The notes travel with the candidate.** An adopter tests a candidate against its upgrade list,
so each candidate carries the CHANGELOG it was built with: every section above the last release's
own heading, then a link to the full history at that release's tag. Every npm package has it as
`CHANGELOG.md` (`node_modules/@metaobjectsdev/cli/CHANGELOG.md`); every NuGet package has it at
the package root, with release notes that point there; the PyPI sdist has it at its root and the
wheel installs it as `metaobjects/CHANGELOG.md`; every Maven jar has it as `META-INF/CHANGELOG.md`;
and every Cargo crate has it beside its `Cargo.toml`. The copy exists only while the candidate is
built and is removed when the run ends. Never read the notes
from a checkout of `main` or from the last release: rc.4's packages carried none, and one estate
filed items as undocumented against a stale copy.

**Estate runs.** What an estate does with a candidate is
[`tools/prerelease/estate-run.md`](../../tools/prerelease/estate-run.md), with
`tools/prerelease/estate-run.sh` for the mechanical part.
Expand Down
Loading
Loading