canopycms 0.0.40 → 0.0.42
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/dist/branch-schema-cache.d.ts +10 -0
- package/dist/branch-schema-cache.d.ts.map +1 -1
- package/dist/branch-schema-cache.js +14 -2
- package/dist/branch-schema-cache.js.map +1 -1
- package/dist/cli/generate-ai-content.js +16 -11
- package/dist/cli/init.js +2 -9
- package/dist/cli/template-files/schemas.ts.template +20 -5
- package/dist/config/flatten.d.ts +1 -6
- package/dist/config/flatten.d.ts.map +1 -1
- package/dist/config/flatten.js +1 -23
- package/dist/config/flatten.js.map +1 -1
- package/dist/config/helpers.d.ts +10 -5
- package/dist/config/helpers.d.ts.map +1 -1
- package/dist/config/helpers.js +10 -5
- package/dist/config/helpers.js.map +1 -1
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -2
- package/dist/config/index.js.map +1 -1
- package/dist/config/schemas/collection.d.ts +0 -53
- package/dist/config/schemas/collection.d.ts.map +1 -1
- package/dist/config/schemas/collection.js +0 -6
- package/dist/config/schemas/collection.js.map +1 -1
- package/dist/config/schemas/config.d.ts +1 -80
- package/dist/config/schemas/config.d.ts.map +1 -1
- package/dist/config/schemas/config.js +6 -5
- package/dist/config/schemas/config.js.map +1 -1
- package/dist/config/validation.d.ts +13 -6
- package/dist/config/validation.d.ts.map +1 -1
- package/dist/config/validation.js +65 -127
- package/dist/config/validation.js.map +1 -1
- package/dist/config-test.d.ts +1 -1
- package/dist/config-test.d.ts.map +1 -1
- package/dist/config-test.js.map +1 -1
- package/dist/content-tree.d.ts +85 -7
- package/dist/content-tree.d.ts.map +1 -1
- package/dist/content-tree.js +34 -9
- package/dist/content-tree.js.map +1 -1
- package/dist/context.d.ts +9 -3
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/entry-schema-registry.d.ts +54 -10
- package/dist/entry-schema-registry.d.ts.map +1 -1
- package/dist/entry-schema-registry.js +62 -10
- package/dist/entry-schema-registry.js.map +1 -1
- package/dist/entry-schema.d.ts +34 -0
- package/dist/entry-schema.d.ts.map +1 -1
- package/dist/entry-schema.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/server.d.ts +53 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +50 -2
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/server.d.ts
CHANGED
|
@@ -8,17 +8,67 @@ export * from './branch-workspace';
|
|
|
8
8
|
export * from './content-store';
|
|
9
9
|
export { loadCollectionMetaFiles, resolveCollectionReferences, watchCollectionMetaFiles, resolveSchema, } from './schema';
|
|
10
10
|
export type { CollectionMeta, RootCollectionMeta } from './schema';
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Create a type-safe entry schema registry with runtime validation.
|
|
13
|
+
*
|
|
14
|
+
* Maps each entry-type's name to its `EntrySchema`. Keys are referenced by
|
|
15
|
+
* `.collection.json` files via the `entry.schema` property. Recommended
|
|
16
|
+
* convention is to key by entry-type name (filename token, also the value of
|
|
17
|
+
* `meta.entryType` in tree-builder callbacks) — that way
|
|
18
|
+
* `EntryTypesFromRegistry<typeof yourRegistry>` derives the
|
|
19
|
+
* discriminated-union map for `buildContentTree`'s `TEntryTypes` parameter
|
|
20
|
+
* automatically. See `createEntrySchemaRegistry`'s source-file JSDoc for the
|
|
21
|
+
* full example.
|
|
22
|
+
*/
|
|
23
|
+
export { createEntrySchemaRegistry } from './entry-schema-registry';
|
|
24
|
+
/**
|
|
25
|
+
* Validate that entry-schema references in `.collection.json` files exist in
|
|
26
|
+
* the registry. Useful at build time to fail fast on stale references rather
|
|
27
|
+
* than at request time.
|
|
28
|
+
*/
|
|
29
|
+
export { validateEntrySchemaRegistry } from './entry-schema-registry';
|
|
30
|
+
/**
|
|
31
|
+
* Derive a discriminated-union entry-type map from a registry value. Pass
|
|
32
|
+
* `typeof entrySchemaRegistry` as the type argument. The registry must be
|
|
33
|
+
* keyed by entry-type name for the result to plug straight into
|
|
34
|
+
* `buildContentTree`'s `TEntryTypes` generic.
|
|
35
|
+
*/
|
|
36
|
+
export type { EntryTypesFromRegistry } from './entry-schema';
|
|
37
|
+
/** Generate a Canopy-format 12-character Base58 content ID. */
|
|
38
|
+
export { generateId } from './id';
|
|
39
|
+
/** Returns true if a string is a valid 12-character Base58 Canopy ID. */
|
|
40
|
+
export { isValidId } from './id';
|
|
41
|
+
/**
|
|
42
|
+
* Build a hierarchical tree of content nodes from the schema and filesystem.
|
|
43
|
+
*
|
|
44
|
+
* Pass `TEntryTypes` (typically `EntryTypesFromRegistry<typeof entrySchemaRegistry>`)
|
|
45
|
+
* to get narrowed access to `meta.indexEntry.data` after switching on
|
|
46
|
+
* `meta.entryType` in your `extract` callback.
|
|
47
|
+
*
|
|
48
|
+
* Adopters using `canopycms-next` typically call `canopy.buildContentTree(...)`
|
|
49
|
+
* via `getCanopyForBuild()` rather than the bare function.
|
|
50
|
+
*/
|
|
13
51
|
export { buildContentTree } from './content-tree';
|
|
14
|
-
export type { ContentTreeNode, BuildContentTreeOptions, ContentTreeExtractMeta, } from './content-tree';
|
|
52
|
+
export type { ContentTreeNode, BuildContentTreeOptions, ContentTreeExtractMeta, EntryTypeMap, DefaultEntryTypes, } from './content-tree';
|
|
53
|
+
/** List all content entries as a flat array. */
|
|
15
54
|
export { listEntries } from './content-listing';
|
|
16
55
|
export type { ListEntriesItem, ListEntriesOptions } from './content-listing';
|
|
56
|
+
/**
|
|
57
|
+
* Resolve a canopy entry-link to its URL. Pair with the field-walker variants
|
|
58
|
+
* (`resolveEntryLinksInText`, `resolveEntryLinksInData`) when rendering MDX
|
|
59
|
+
* bodies or arbitrary frontmatter that may contain link tokens.
|
|
60
|
+
*/
|
|
17
61
|
export { resolveEntryUrl, resolveEntryLinksInText, resolveEntryLinksInData, extractEntryLinkIds, } from './entry-link-resolver';
|
|
18
62
|
export type { EntryLinkUrlResolver } from './entry-link-resolver';
|
|
63
|
+
/** Compute the canonical URL for an entry given its logical path + slug. */
|
|
19
64
|
export { computeEntryUrl } from './utils/entry-url';
|
|
65
|
+
/** Collect static paths for `generateStaticParams` / sitemap emission. */
|
|
20
66
|
export { collectStaticPaths } from './static';
|
|
21
67
|
export type { StaticPathEntry, CollectStaticPathsOptions } from './static';
|
|
68
|
+
/**
|
|
69
|
+
* Start a chokidar-backed watcher that detects divergence between the dev
|
|
70
|
+
* working tree and the resolved branch clone. Dev mode only.
|
|
71
|
+
*/
|
|
22
72
|
export { startDevContentWatcher } from './dev-content-watcher';
|
|
23
73
|
export type { StartDevContentWatcherOptions } from './dev-content-watcher';
|
|
24
74
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAMA,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,aAAa,GACd,MAAM,UAAU,CAAA;AACjB,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAElE;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAEnE;;;;GAIG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAA;AAErE;;;;;GAKG;AACH,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAE5D,+DAA+D;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAEjC,yEAAyE;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEhC;;;;;;;;;GASG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjD,YAAY,EACV,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,GAClB,MAAM,gBAAgB,CAAA;AAEvB,gDAAgD;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE5E;;;;GAIG;AACH,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,uBAAuB,CAAA;AAE9B,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEjE,4EAA4E;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,0EAA0E;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE7C,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAE1E;;;GAGG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,YAAY,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAA"}
|
package/dist/server.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// Public server-side API for adopters. JSDoc is duplicated at each named
|
|
2
|
+
// re-export so it shows on hover in adopter editors — TypeScript propagation
|
|
3
|
+
// through `export { X } from './module.js'` is inconsistent across LSP versions
|
|
4
|
+
// and module-resolution modes. New top-level public re-exports should follow
|
|
5
|
+
// the same pattern (see DEVELOPING.md).
|
|
1
6
|
export * from './content-reader.js';
|
|
2
7
|
export * from './services.js';
|
|
3
8
|
export * from './build-mode.js';
|
|
@@ -7,12 +12,55 @@ export * from './authorization/groups/index.js';
|
|
|
7
12
|
export * from './branch-workspace.js';
|
|
8
13
|
export * from './content-store.js';
|
|
9
14
|
export { loadCollectionMetaFiles, resolveCollectionReferences, watchCollectionMetaFiles, resolveSchema, } from './schema/index.js';
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Create a type-safe entry schema registry with runtime validation.
|
|
17
|
+
*
|
|
18
|
+
* Maps each entry-type's name to its `EntrySchema`. Keys are referenced by
|
|
19
|
+
* `.collection.json` files via the `entry.schema` property. Recommended
|
|
20
|
+
* convention is to key by entry-type name (filename token, also the value of
|
|
21
|
+
* `meta.entryType` in tree-builder callbacks) — that way
|
|
22
|
+
* `EntryTypesFromRegistry<typeof yourRegistry>` derives the
|
|
23
|
+
* discriminated-union map for `buildContentTree`'s `TEntryTypes` parameter
|
|
24
|
+
* automatically. See `createEntrySchemaRegistry`'s source-file JSDoc for the
|
|
25
|
+
* full example.
|
|
26
|
+
*/
|
|
27
|
+
export { createEntrySchemaRegistry } from './entry-schema-registry.js';
|
|
28
|
+
/**
|
|
29
|
+
* Validate that entry-schema references in `.collection.json` files exist in
|
|
30
|
+
* the registry. Useful at build time to fail fast on stale references rather
|
|
31
|
+
* than at request time.
|
|
32
|
+
*/
|
|
33
|
+
export { validateEntrySchemaRegistry } from './entry-schema-registry.js';
|
|
34
|
+
/** Generate a Canopy-format 12-character Base58 content ID. */
|
|
35
|
+
export { generateId } from './id.js';
|
|
36
|
+
/** Returns true if a string is a valid 12-character Base58 Canopy ID. */
|
|
37
|
+
export { isValidId } from './id.js';
|
|
38
|
+
/**
|
|
39
|
+
* Build a hierarchical tree of content nodes from the schema and filesystem.
|
|
40
|
+
*
|
|
41
|
+
* Pass `TEntryTypes` (typically `EntryTypesFromRegistry<typeof entrySchemaRegistry>`)
|
|
42
|
+
* to get narrowed access to `meta.indexEntry.data` after switching on
|
|
43
|
+
* `meta.entryType` in your `extract` callback.
|
|
44
|
+
*
|
|
45
|
+
* Adopters using `canopycms-next` typically call `canopy.buildContentTree(...)`
|
|
46
|
+
* via `getCanopyForBuild()` rather than the bare function.
|
|
47
|
+
*/
|
|
12
48
|
export { buildContentTree } from './content-tree.js';
|
|
49
|
+
/** List all content entries as a flat array. */
|
|
13
50
|
export { listEntries } from './content-listing.js';
|
|
51
|
+
/**
|
|
52
|
+
* Resolve a canopy entry-link to its URL. Pair with the field-walker variants
|
|
53
|
+
* (`resolveEntryLinksInText`, `resolveEntryLinksInData`) when rendering MDX
|
|
54
|
+
* bodies or arbitrary frontmatter that may contain link tokens.
|
|
55
|
+
*/
|
|
14
56
|
export { resolveEntryUrl, resolveEntryLinksInText, resolveEntryLinksInData, extractEntryLinkIds, } from './entry-link-resolver.js';
|
|
57
|
+
/** Compute the canonical URL for an entry given its logical path + slug. */
|
|
15
58
|
export { computeEntryUrl } from './utils/entry-url.js';
|
|
59
|
+
/** Collect static paths for `generateStaticParams` / sitemap emission. */
|
|
16
60
|
export { collectStaticPaths } from './static/index.js';
|
|
61
|
+
/**
|
|
62
|
+
* Start a chokidar-backed watcher that detects divergence between the dev
|
|
63
|
+
* working tree and the resolved branch clone. Dev mode only.
|
|
64
|
+
*/
|
|
17
65
|
export { startDevContentWatcher } from './dev-content-watcher.js';
|
|
18
66
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B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OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"//": "@codemirror/language, @lezer/highlight: workaround — @mdxeditor/editor uses cm6-theme-basic-light which peer-requires these but mdxeditor doesn't declare them as dependencies",
|
|
3
3
|
"name": "canopycms",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.42",
|
|
5
5
|
"description": "CanopyCMS core package: schema-driven content, branch-aware editing, and editor UI for Next.js.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|