@saasicat/core 1.0.0-rc.2 → 1.0.0-rc.21
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/README.md +21 -0
- package/dist/.build-stamp +1 -1
- package/dist/index.cjs +1017 -50
- package/dist/index.d.cts +2721 -477
- package/dist/index.d.ts +2721 -477
- package/dist/index.js +970 -49
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @saasicat/core
|
|
2
2
|
|
|
3
|
+
## What this is
|
|
4
|
+
|
|
3
5
|
The shared core of the SaaS platform: the wire-format types — AdminManifest,
|
|
4
6
|
PlanCatalog, PromoCode, AuditEvent, Subscription, PlanVersion, the adapter
|
|
5
7
|
ports — **and the pure domain logic both sides run**: the error-code catalogues
|
|
@@ -15,6 +17,18 @@ types are generated from the schemas via `pnpm gen:types`
|
|
|
15
17
|
(`json-schema-to-typescript`); a drift test keeps schemas and snapshots in
|
|
16
18
|
sync.
|
|
17
19
|
|
|
20
|
+
## What this is not
|
|
21
|
+
|
|
22
|
+
Not a types-only package, despite what its predecessor's name promised. It
|
|
23
|
+
carries 45 runtime exports — `classifyPlanDiff`, `applyPromo`,
|
|
24
|
+
`resolveErrorMessage`, the error-code catalogues, the feature-requires rules —
|
|
25
|
+
because backend and admin UI must reach the same verdict, and two
|
|
26
|
+
implementations of the same rule reach two.
|
|
27
|
+
|
|
28
|
+
Not the source of truth for the wire formats either. That is `@saasicat/spec`;
|
|
29
|
+
the types under `src/generated/` are produced from its JSON Schemas, and a
|
|
30
|
+
drift test rejects an edit made here.
|
|
31
|
+
|
|
18
32
|
## Contents
|
|
19
33
|
|
|
20
34
|
| File | Contents |
|
|
@@ -56,3 +70,10 @@ Produces `dist/index.{js,cjs,d.ts,d.cts}` via `tsup`.
|
|
|
56
70
|
there bumps this package's version as well.
|
|
57
71
|
- **Required fields mirror the schemas.** Anything non-optional here must be
|
|
58
72
|
non-optional in the schema too — otherwise it drifts.
|
|
73
|
+
|
|
74
|
+
## Next
|
|
75
|
+
|
|
76
|
+
- [The vocabulary](../../docs/explanation/concepts.md) — capability, feature, quota, plan, contract
|
|
77
|
+
- [Codegen](../../docs/explanation/adr/0006-spec-to-types-codegen.md) — what is generated, and what
|
|
78
|
+
is not
|
|
79
|
+
- [`@saasicat/spec`](../spec/README.md) — the schemas these types come from
|
package/dist/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
369e8bc186ed4a646394a1f9b7c7dcc8605204b4bae0e8c40edc4f3b5dd5e378
|