@pattern-stack/codegen 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/dist/runtime/subsystems/index.d.ts +7 -3
- package/dist/runtime/subsystems/index.js +993 -19
- package/dist/runtime/subsystems/index.js.map +1 -1
- package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.d.ts +25 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.js +34 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.js.map +1 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.d.ts +53 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.js +13 -0
- package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.js.map +1 -0
- package/dist/runtime/subsystems/integration/execute-integration.use-case.js.map +1 -1
- package/dist/runtime/subsystems/integration/index.d.ts +3 -1
- package/dist/runtime/subsystems/integration/index.js +35 -0
- package/dist/runtime/subsystems/integration/index.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration-cursor-store.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration-run-recorder.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration.module.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration.tokens.d.ts +14 -1
- package/dist/runtime/subsystems/integration/integration.tokens.js +2 -0
- package/dist/runtime/subsystems/integration/integration.tokens.js.map +1 -1
- package/dist/runtime/subsystems/observability/index.js.map +1 -1
- package/dist/runtime/subsystems/observability/observability.module.js.map +1 -1
- package/dist/runtime/subsystems/observability/observability.service.js.map +1 -1
- package/dist/src/cli/index.js +1074 -107
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/index.d.ts +48 -0
- package/dist/src/index.js +99 -3
- package/dist/src/index.js.map +1 -1
- package/package.json +9 -1
- package/runtime/subsystems/index.ts +15 -0
- package/runtime/subsystems/integration/entity-change-source-registry.memory.ts +40 -0
- package/runtime/subsystems/integration/entity-change-source-registry.protocol.ts +59 -0
- package/runtime/subsystems/integration/index.ts +9 -0
- package/runtime/subsystems/integration/integration.tokens.ts +14 -0
- package/templates/entity/new/clean-lite-ps/entity.ejs.t +12 -3
- package/templates/entity/new/clean-lite-ps/prompt-extension.js +212 -29
- package/templates/entity/new/backend/modules/core/integration-source.providers.ejs.t +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,66 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.12.0] — 2026-05-31
|
|
8
|
+
|
|
9
|
+
Integration codegen retarget (RFC-0001): a **provider/adapter/surface** model
|
|
10
|
+
for integration codegen, plus a **surface-package framework**. Additive over
|
|
11
|
+
0.11.0 — new declarative inputs and emitted artifacts; existing entity codegen
|
|
12
|
+
is unchanged. The one breaking item (the ADR-033.2 per-entity provider tuples)
|
|
13
|
+
has no consumers. Consumers adopt by adding `definitions/providers/*.yaml` and
|
|
14
|
+
regenerating. Ships alongside four independently-versioned **surface packages**
|
|
15
|
+
(`@pattern-stack/codegen-{crm,calendar,mail,transcript}`) publishing fresh at
|
|
16
|
+
`0.1.0`.
|
|
17
|
+
|
|
18
|
+
### ⚠ BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
- **ADR-033.2 per-entity provider tuples removed.** The
|
|
21
|
+
`<entity>-integration-source.providers.ts` emission (`<ENTITY>_PROVIDERS`
|
|
22
|
+
const + `<Entity>Provider` type) is deleted. Its replacement is the
|
|
23
|
+
surface-scoped, codegen-owned typed view at
|
|
24
|
+
`src/integrations/<surface>/types.generated.ts` (`<Surface>Provider` /
|
|
25
|
+
`<Surface>Entity` unions + a `(provider, entity)` validity map) — a single
|
|
26
|
+
source of provider truth. ADR-033.2 is superseded by RFC-0001. No published
|
|
27
|
+
consumers depend on the tuples.
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- **Track C — surface-package framework (ADR-036).** First-class L2 *surface
|
|
32
|
+
packages* shipping type-shaped ports + DI tokens + an L3 composing port per
|
|
33
|
+
integration surface:
|
|
34
|
+
- **L1** — `IEntityChangeSourceRegistry` (entity-keyed change-source
|
|
35
|
+
resolver) + `MemoryEntityChangeSourceRegistry` + the
|
|
36
|
+
`ENTITY_CHANGE_SOURCE_REGISTRY` token, in the integration subsystem;
|
|
37
|
+
exported across the package boundary via `@pattern-stack/codegen/subsystems`.
|
|
38
|
+
- **`@pattern-stack/codegen-crm`** — L2 CRM ports (`IFieldDefinitionReader`,
|
|
39
|
+
`IPicklistReader`, `IAssociationReader`), the `CrmCapabilities` descriptor,
|
|
40
|
+
and the L3 entity-agnostic **`CrmPort`** composing port + `assertCrmAdapter`
|
|
41
|
+
conformance helper (on the `/testing` subpath).
|
|
42
|
+
- **`@pattern-stack/codegen-{calendar,mail,transcript}`** — incremental-read
|
|
43
|
+
interaction surfaces (`CalendarPort` / `MailPort` / `TranscriptPort`,
|
|
44
|
+
canonical types, capability descriptors). Independently versioned (`0.1.0`).
|
|
45
|
+
- **Track D — provider/adapter integration codegen (RFC-0001).**
|
|
46
|
+
- `definitions/providers/<provider>.yaml` — providers as first-class
|
|
47
|
+
declarative artifacts (slug, auth strategy, client, surfaces); Zod schema +
|
|
48
|
+
validator with a **pre-flight import-path check** (a missing
|
|
49
|
+
strategy/client export fails `cdp gen`, not NestJS boot), surface
|
|
50
|
+
cross-check, and slug-uniqueness.
|
|
51
|
+
- Emits, per provider × surface: a `<provider>.provider.module.ts`, an
|
|
52
|
+
**emit-once** `<provider>-<surface>.adapter.ts` scaffold (sentinel-guarded,
|
|
53
|
+
author-owned after first emit), fully codegen-owned adapter modules +
|
|
54
|
+
barrels, a per-surface registry (`<SURFACE>_ADAPTER_CONTRIBUTIONS` →
|
|
55
|
+
`<SURFACE>_ENTITY_SOURCES`, folding into the L1 registry), and the
|
|
56
|
+
`types.generated.ts` typed view.
|
|
57
|
+
- Optional entity-YAML **`surface:`** field — the declarative input the
|
|
58
|
+
provider/adapter emission groups entities by.
|
|
59
|
+
- **`context:` output-folder grouping (#403).** An optional top-level entity
|
|
60
|
+
`context:` nests its generated module folder under that segment
|
|
61
|
+
(`<modules>/<context>/<plural>/`); no context → flat (byte-identical to
|
|
62
|
+
before).
|
|
63
|
+
- **Multi-package release.** `just publish` publishes the root plus every
|
|
64
|
+
opted-in `packages/*` (those declaring `publishConfig.access: public`) at its
|
|
65
|
+
own independent version, skipping versions already on npm.
|
|
66
|
+
|
|
7
67
|
## [0.11.0] — 2026-05-30
|
|
8
68
|
|
|
9
69
|
Vocabulary rename per **ADR-0005 (swe-brain `.ai-docs/decisions/ADR-0005-rename-sync-to-integration.md`)**:
|
|
@@ -19,6 +19,12 @@ export { IObservability } from './observability/observability.protocol.js';
|
|
|
19
19
|
export { OBSERVABILITY, OBSERVABILITY_MODULE_OPTIONS } from './observability/observability.tokens.js';
|
|
20
20
|
export { ObservabilityModule, ObservabilityModuleOptions } from './observability/observability.module.js';
|
|
21
21
|
export { ObservabilityError } from './observability/observability-errors.js';
|
|
22
|
+
export { IChangeSource } from './integration/integration-change-source.protocol.js';
|
|
23
|
+
export { CursorSnapshot } from './integration/integration-cursor-store.protocol.js';
|
|
24
|
+
export { IntegrationRunSummary } from './integration/integration-run-recorder.protocol.js';
|
|
25
|
+
export { IEntityChangeSourceRegistry, UnknownEntityError } from './integration/entity-change-source-registry.protocol.js';
|
|
26
|
+
export { MemoryEntityChangeSourceRegistry } from './integration/entity-change-source-registry.memory.js';
|
|
27
|
+
export { ENTITY_CHANGE_SOURCE_REGISTRY } from './integration/integration.tokens.js';
|
|
22
28
|
export { AuthCredentials, AuthResolveOptions, IAuthStrategy } from './auth/protocols/auth-strategy.js';
|
|
23
29
|
export { IEncryptionKey } from './auth/protocols/encryption-key.js';
|
|
24
30
|
export { IOAuthStateStore, OAuthStateError, OAuthStateRecord } from './auth/protocols/oauth-state-store.js';
|
|
@@ -36,8 +42,6 @@ export { MemoryOAuthStateStore } from './auth/backends/state-store.memory-backen
|
|
|
36
42
|
export { DrizzleOAuthStateStore } from './auth/backends/state-store.drizzle-backend.js';
|
|
37
43
|
export { AuthController } from './auth/controllers/auth.controller.js';
|
|
38
44
|
export { AuthModule } from './auth/auth.module.js';
|
|
39
|
-
export { CursorSnapshot } from './integration/integration-cursor-store.protocol.js';
|
|
40
|
-
export { IntegrationRunSummary } from './integration/integration-run-recorder.protocol.js';
|
|
41
45
|
export { StatusHistogram } from './bridge/bridge.protocol.js';
|
|
42
46
|
import '../types/drizzle.js';
|
|
43
47
|
import 'drizzle-orm/node-postgres';
|
|
@@ -47,7 +51,7 @@ import 'drizzle-orm/pg-core';
|
|
|
47
51
|
import 'drizzle-orm';
|
|
48
52
|
import '../../job-orchestrator.protocol-CHOEqBDk.js';
|
|
49
53
|
import './events/generated/types.js';
|
|
50
|
-
import '../base-classes/tenant-context.js';
|
|
51
54
|
import './integration/integration-field-diff.protocol.js';
|
|
52
55
|
import 'zod';
|
|
56
|
+
import '../base-classes/tenant-context.js';
|
|
53
57
|
import './bridge/bridge-delivery.schema.js';
|