@cmssy/core 16.9.0 → 16.10.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/README.md +77 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/locale.cjs +1 -1
- package/dist/internal/locale.js +1 -1
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# @cmssy/core
|
|
2
|
+
|
|
3
|
+
Framework-agnostic client for a [cmssy](https://cmssy.com) headless site. Builds
|
|
4
|
+
the delivery request, defines blocks and layouts, resolves media and locales, and
|
|
5
|
+
verifies webhooks. Everything the framework packages are built on.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @cmssy/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Most sites do not install this directly. Use
|
|
12
|
+
[`@cmssy/next`](https://www.npmjs.com/package/@cmssy/next) with
|
|
13
|
+
[`@cmssy/react`](https://www.npmjs.com/package/@cmssy/react), or
|
|
14
|
+
[`@cmssy/astro`](https://www.npmjs.com/package/@cmssy/astro) /
|
|
15
|
+
[`@cmssy/remix`](https://www.npmjs.com/package/@cmssy/remix), which pull this in.
|
|
16
|
+
Reach for `@cmssy/core` when you are wiring a framework we do not ship bindings
|
|
17
|
+
for.
|
|
18
|
+
|
|
19
|
+
## Configure once
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { defineCmssyConfig, createCmssyClient } from "@cmssy/core";
|
|
23
|
+
|
|
24
|
+
export const cmssy = defineCmssyConfig({
|
|
25
|
+
org: process.env.CMSSY_ORG_SLUG,
|
|
26
|
+
workspaceSlug: process.env.CMSSY_WORKSPACE_SLUG,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const client = createCmssyClient(cmssy);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`defineCmssyConfig` validates the required values and throws if one is missing.
|
|
33
|
+
Do not paper over a missing org or workspace slug with `?? ""` - an empty
|
|
34
|
+
segment builds a delivery URL like `/public//graphql` that fails far from the
|
|
35
|
+
cause.
|
|
36
|
+
|
|
37
|
+
## What is in the box
|
|
38
|
+
|
|
39
|
+
`defineCmssyConfig`, `createCmssyClient`, `graphqlRequest` for the transport;
|
|
40
|
+
`fields` and `defineCmssyLayout` for block and layout definitions; `mediaUrl`,
|
|
41
|
+
`mediaUrls`, `mediaAlt` for media; `localizeHref`, `resolveCmssyLocale`,
|
|
42
|
+
`CMSSY_LOCALE_HEADER` for i18n; `applyCmssyCsp` and `verifyCmssyWebhook` for the
|
|
43
|
+
edges. Full signatures in
|
|
44
|
+
[docs/reference/sdk-api.md](https://github.com/cmssy-io/cmssy-sdk/blob/main/docs/reference/sdk-api.md).
|
|
45
|
+
|
|
46
|
+
## Versioning: this package, not the API
|
|
47
|
+
|
|
48
|
+
**Pinning this package does not pin the API it talks to.** They are two separate
|
|
49
|
+
things and only one of them is in your lockfile.
|
|
50
|
+
|
|
51
|
+
- The **package version** covers this client: its exports, their signatures, its
|
|
52
|
+
behaviour. Normal semver - a major means your code may need changing.
|
|
53
|
+
- The **delivery API** is a hosted service. Its GraphQL schema can change on any
|
|
54
|
+
deploy, and it does so without a release here. A field removed from the schema
|
|
55
|
+
is gone for `@cmssy/core@16.9.0` exactly as it is for the next version.
|
|
56
|
+
|
|
57
|
+
So `"@cmssy/core": "16.9.0"` in your `package.json` is not a compatibility
|
|
58
|
+
guarantee against the server, and there is currently no API version you can pin
|
|
59
|
+
instead - the delivery endpoint has no version segment.
|
|
60
|
+
|
|
61
|
+
What protects you today:
|
|
62
|
+
|
|
63
|
+
- Every change to the schema runs against this SDK's own operations in CI before
|
|
64
|
+
it can merge, so the queries shipped here keep working.
|
|
65
|
+
- A breaking change cannot merge silently. It fails the gate, and shipping one
|
|
66
|
+
anyway requires an explicit, recorded approval.
|
|
67
|
+
- Fields we intend to remove are marked `@deprecated` in the schema first, which
|
|
68
|
+
shows up in your codegen output and your editor.
|
|
69
|
+
|
|
70
|
+
What does not exist yet, stated plainly rather than implied: there is no
|
|
71
|
+
guaranteed deprecation window, no minimum notice period, and no dated API
|
|
72
|
+
version to pin. If your own documents select fields beyond what this package
|
|
73
|
+
queries, validate them against the live schema in your own CI.
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
MIT
|
package/dist/index.cjs
CHANGED
|
@@ -74,7 +74,7 @@ Set the listed environment variables (e.g. in .env.local) and restart the dev se
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// src/version.ts
|
|
77
|
-
var CMSSY_CORE_VERSION = "16.
|
|
77
|
+
var CMSSY_CORE_VERSION = "16.10.0" ;
|
|
78
78
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
79
79
|
|
|
80
80
|
// src/data/http.ts
|
package/dist/index.js
CHANGED
|
@@ -73,7 +73,7 @@ Set the listed environment variables (e.g. in .env.local) and restart the dev se
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// src/version.ts
|
|
76
|
-
var CMSSY_CORE_VERSION = "16.
|
|
76
|
+
var CMSSY_CORE_VERSION = "16.10.0" ;
|
|
77
77
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
78
78
|
|
|
79
79
|
// src/data/http.ts
|
package/dist/internal/locale.cjs
CHANGED
package/dist/internal/locale.js
CHANGED
package/dist/internal.cjs
CHANGED
package/dist/internal.js
CHANGED