canopycms 0.0.39 → 0.0.41
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 +21 -4
- package/dist/cli/init.js +7 -2
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +13 -103
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/template-files/canopy.ts.template +30 -2
- package/dist/config/helpers.d.ts.map +1 -1
- package/dist/config/helpers.js +5 -0
- package/dist/config/helpers.js.map +1 -1
- package/dist/config/schemas/config.d.ts +21 -0
- package/dist/config/schemas/config.d.ts.map +1 -1
- package/dist/config/schemas/config.js +6 -0
- package/dist/config/schemas/config.js.map +1 -1
- package/dist/config/types.d.ts +19 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/context.d.ts +19 -10
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +5 -0
- package/dist/context.js.map +1 -1
- package/dist/dev-content-watcher.d.ts +37 -0
- package/dist/dev-content-watcher.d.ts.map +1 -0
- package/dist/dev-content-watcher.js +122 -0
- package/dist/dev-content-watcher.js.map +1 -0
- package/dist/entry-schema.d.ts +38 -0
- package/dist/entry-schema.d.ts.map +1 -1
- package/dist/entry-schema.js +33 -0
- package/dist/entry-schema.js.map +1 -1
- package/dist/schema/meta-loader.d.ts.map +1 -1
- package/dist/schema/meta-loader.js +3 -0
- package/dist/schema/meta-loader.js.map +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -1
- package/dist/static/index.d.ts +51 -0
- package/dist/static/index.d.ts.map +1 -0
- package/dist/static/index.js +24 -0
- package/dist/static/index.js.map +1 -0
- package/dist/sync-core.d.ts +57 -0
- package/dist/sync-core.d.ts.map +1 -0
- package/dist/sync-core.js +166 -0
- package/dist/sync-core.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/static/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD;;;;;;;;GAQG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,yGAAyG;IACzG,IAAI,EAAE,MAAM,CAAA;IACZ,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oGAAoG;IACpG,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAA;CAC7C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,EAC5C,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,eAAe,EAAE,CAAC,CAS5B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumerate routable content entries as neutral path descriptors for static generation.
|
|
3
|
+
*
|
|
4
|
+
* Reads filesystem-direct via the build context's `listEntries` (admin, no ACLs — build-time only).
|
|
5
|
+
* The returned entries carry both a collapsed `segments` array (for catch-all routes) and the entry
|
|
6
|
+
* `slug` (for collection-scoped single-segment routes), so a framework adapter can build either shape.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Catch-all [...slug] across all content:
|
|
10
|
+
* const paths = await collectStaticPaths(await getCanopyForBuild())
|
|
11
|
+
* // Single [slug] scoped to one collection:
|
|
12
|
+
* const posts = await collectStaticPaths(await getCanopyForBuild(), { rootPath: 'content/posts' })
|
|
13
|
+
*/
|
|
14
|
+
export async function collectStaticPaths(ctx, options = {}) {
|
|
15
|
+
const entries = await ctx.listEntries({ rootPath: options.rootPath });
|
|
16
|
+
const mapped = entries.map((entry) => ({
|
|
17
|
+
urlPath: entry.urlPath,
|
|
18
|
+
segments: entry.urlPath === '/' ? [] : entry.urlPath.replace(/^\//, '').split('/'),
|
|
19
|
+
slug: entry.slug,
|
|
20
|
+
entryType: entry.entryType,
|
|
21
|
+
}));
|
|
22
|
+
return options.filter ? mapped.filter(options.filter) : mapped;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/static/index.ts"],"names":[],"mappings":"AAwCA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAA4C,EAC5C,UAAqC,EAAE;IAEvC,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;IACrE,MAAM,MAAM,GAAsB,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxD,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,QAAQ,EAAE,KAAK,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;QAClF,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC,CAAC,CAAA;IACH,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;AAChE,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt-free core of the content sync between the working tree and CMS branch workspaces in
|
|
3
|
+
* `.canopy-dev/content-branches/`. The interactive CLI (cli/sync.ts) wraps these with prompts; the
|
|
4
|
+
* dev content watcher (dev-content-watcher.ts) reuses the diff helpers for divergence detection.
|
|
5
|
+
*/
|
|
6
|
+
/** Git tag marking the last known sync point, used as the merge base for `sync both` 3-way merges. */
|
|
7
|
+
export declare const SYNC_BASE_TAG = "canopycms-sync-base";
|
|
8
|
+
/** Validate that a resolved path stays within the expected parent directory. */
|
|
9
|
+
export declare function assertWithinDir(resolved: string, parent: string, label: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Safely replace a directory by renaming the old one to a backup, renaming
|
|
12
|
+
* the new one into place, then deleting the backup. If interrupted between
|
|
13
|
+
* steps, at least one copy always exists on disk.
|
|
14
|
+
*/
|
|
15
|
+
export declare function safeReplaceDir(oldDir: string, newDir: string): Promise<void>;
|
|
16
|
+
/** Recursively list all file paths relative to `dir`. Skips .git and symlinks. */
|
|
17
|
+
export declare function listFilesRecursive(dir: string, prefix?: string): Promise<string[]>;
|
|
18
|
+
/** Recursively copy a directory, creating the destination if needed. Skips .git directories and symlinks. */
|
|
19
|
+
export declare function copyDir(src: string, dest: string): Promise<void>;
|
|
20
|
+
/** Difference between two content directories, by relative file path. */
|
|
21
|
+
export interface ContentTreeDiff {
|
|
22
|
+
/** Files present in the working tree but not the branch clone. */
|
|
23
|
+
added: string[];
|
|
24
|
+
/** Files present in the branch clone but not the working tree. */
|
|
25
|
+
removed: string[];
|
|
26
|
+
/** Files present in both but with differing content. */
|
|
27
|
+
changed: string[];
|
|
28
|
+
}
|
|
29
|
+
/** True when the diff contains no added/removed/changed files. */
|
|
30
|
+
export declare function isContentTreeDiffEmpty(diff: ContentTreeDiff): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Compare two content directories by file presence and exact content (byte comparison — robust to
|
|
33
|
+
* mtime differences, which `fs.copyFile` does not preserve). Missing directories list as empty.
|
|
34
|
+
*/
|
|
35
|
+
export declare function diffContentTrees(workingTreeDir: string, branchDir: string): Promise<ContentTreeDiff>;
|
|
36
|
+
export interface PushContentToWorkspaceOptions {
|
|
37
|
+
/** Working-tree content directory (source). */
|
|
38
|
+
srcContentDir: string;
|
|
39
|
+
/** Branch workspace root (a git repo). */
|
|
40
|
+
branchPath: string;
|
|
41
|
+
/** Content directory name within the workspace (e.g. 'content'). */
|
|
42
|
+
contentRoot: string;
|
|
43
|
+
/** Commit message for the content update. */
|
|
44
|
+
commitMessage?: string;
|
|
45
|
+
/** When set, (re)tag the resulting commit as the sync base (used by `sync both` 3-way merges). */
|
|
46
|
+
baseTag?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Copy working-tree content into a branch workspace and commit it. Prompt-free — the interactive CLI
|
|
50
|
+
* (`canopycms sync push`) calls this for the actual copy + commit + tag step.
|
|
51
|
+
*
|
|
52
|
+
* Returns the number of changed files committed (0 when content was already up to date).
|
|
53
|
+
*/
|
|
54
|
+
export declare function pushContentToWorkspace(options: PushContentToWorkspaceOptions): Promise<{
|
|
55
|
+
fileCount: number;
|
|
56
|
+
}>;
|
|
57
|
+
//# sourceMappingURL=sync-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-core.d.ts","sourceRoot":"","sources":["../src/sync-core.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,sGAAsG;AACtG,eAAO,MAAM,aAAa,wBAAwB,CAAA;AAElD,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CASrF;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBlF;AAED,kFAAkF;AAClF,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBpF;AAED,6GAA6G;AAC7G,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CActE;AAED,yEAAyE;AACzE,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,kEAAkE;IAClE,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,wDAAwD;IACxD,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,kEAAkE;AAClE,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAErE;AAUD;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,eAAe,CAAC,CAwB1B;AAED,MAAM,WAAW,6BAA6B;IAC5C,+CAA+C;IAC/C,aAAa,EAAE,MAAM,CAAA;IACrB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAA;IACnB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,kGAAkG;IAClG,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAiChC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt-free core of the content sync between the working tree and CMS branch workspaces in
|
|
3
|
+
* `.canopy-dev/content-branches/`. The interactive CLI (cli/sync.ts) wraps these with prompts; the
|
|
4
|
+
* dev content watcher (dev-content-watcher.ts) reuses the diff helpers for divergence detection.
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'node:fs/promises';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { simpleGit } from 'simple-git';
|
|
9
|
+
import { filePathExists } from './utils/fs.js';
|
|
10
|
+
/** Git tag marking the last known sync point, used as the merge base for `sync both` 3-way merges. */
|
|
11
|
+
export const SYNC_BASE_TAG = 'canopycms-sync-base';
|
|
12
|
+
/** Validate that a resolved path stays within the expected parent directory. */
|
|
13
|
+
export function assertWithinDir(resolved, parent, label) {
|
|
14
|
+
const normalizedResolved = path.resolve(resolved);
|
|
15
|
+
const normalizedParent = path.resolve(parent);
|
|
16
|
+
if (!normalizedResolved.startsWith(normalizedParent + path.sep) &&
|
|
17
|
+
normalizedResolved !== normalizedParent) {
|
|
18
|
+
throw new Error(`${label} escapes the expected directory: ${resolved}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Safely replace a directory by renaming the old one to a backup, renaming
|
|
23
|
+
* the new one into place, then deleting the backup. If interrupted between
|
|
24
|
+
* steps, at least one copy always exists on disk.
|
|
25
|
+
*/
|
|
26
|
+
export async function safeReplaceDir(oldDir, newDir) {
|
|
27
|
+
const backupDir = `${oldDir}.sync-backup-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
28
|
+
const oldExists = await filePathExists(oldDir);
|
|
29
|
+
if (oldExists) {
|
|
30
|
+
await fs.rename(oldDir, backupDir);
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
await fs.rename(newDir, oldDir);
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
// Restore backup if the rename failed
|
|
37
|
+
if (oldExists) {
|
|
38
|
+
await fs.rename(backupDir, oldDir).catch(() => { });
|
|
39
|
+
}
|
|
40
|
+
throw err;
|
|
41
|
+
}
|
|
42
|
+
if (oldExists) {
|
|
43
|
+
await fs.rm(backupDir, { recursive: true, force: true }).catch(() => { });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** Recursively list all file paths relative to `dir`. Skips .git and symlinks. */
|
|
47
|
+
export async function listFilesRecursive(dir, prefix = '') {
|
|
48
|
+
const results = [];
|
|
49
|
+
let entries;
|
|
50
|
+
try {
|
|
51
|
+
entries = await fs.readdir(dir, { withFileTypes: true });
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return results;
|
|
55
|
+
}
|
|
56
|
+
for (const entry of entries) {
|
|
57
|
+
if (entry.name === '.git')
|
|
58
|
+
continue;
|
|
59
|
+
if (entry.isSymbolicLink())
|
|
60
|
+
continue;
|
|
61
|
+
const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
62
|
+
if (entry.isDirectory()) {
|
|
63
|
+
results.push(...(await listFilesRecursive(path.join(dir, entry.name), rel)));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
results.push(rel);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return results;
|
|
70
|
+
}
|
|
71
|
+
/** Recursively copy a directory, creating the destination if needed. Skips .git directories and symlinks. */
|
|
72
|
+
export async function copyDir(src, dest) {
|
|
73
|
+
await fs.mkdir(dest, { recursive: true });
|
|
74
|
+
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
75
|
+
for (const entry of entries) {
|
|
76
|
+
if (entry.name === '.git')
|
|
77
|
+
continue;
|
|
78
|
+
if (entry.isSymbolicLink())
|
|
79
|
+
continue;
|
|
80
|
+
const srcPath = path.join(src, entry.name);
|
|
81
|
+
const destPath = path.join(dest, entry.name);
|
|
82
|
+
if (entry.isDirectory()) {
|
|
83
|
+
await copyDir(srcPath, destPath);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
await fs.copyFile(srcPath, destPath);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** True when the diff contains no added/removed/changed files. */
|
|
91
|
+
export function isContentTreeDiffEmpty(diff) {
|
|
92
|
+
return diff.added.length === 0 && diff.removed.length === 0 && diff.changed.length === 0;
|
|
93
|
+
}
|
|
94
|
+
async function readFileSafe(file) {
|
|
95
|
+
try {
|
|
96
|
+
return await fs.readFile(file);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Compare two content directories by file presence and exact content (byte comparison — robust to
|
|
104
|
+
* mtime differences, which `fs.copyFile` does not preserve). Missing directories list as empty.
|
|
105
|
+
*/
|
|
106
|
+
export async function diffContentTrees(workingTreeDir, branchDir) {
|
|
107
|
+
const [wtFiles, brFiles] = await Promise.all([
|
|
108
|
+
listFilesRecursive(workingTreeDir),
|
|
109
|
+
listFilesRecursive(branchDir),
|
|
110
|
+
]);
|
|
111
|
+
const wtSet = new Set(wtFiles);
|
|
112
|
+
const brSet = new Set(brFiles);
|
|
113
|
+
const added = wtFiles.filter((f) => !brSet.has(f)).sort();
|
|
114
|
+
const removed = brFiles.filter((f) => !wtSet.has(f)).sort();
|
|
115
|
+
const common = wtFiles.filter((f) => brSet.has(f));
|
|
116
|
+
const changed = [];
|
|
117
|
+
for (const rel of common) {
|
|
118
|
+
const [a, b] = await Promise.all([
|
|
119
|
+
readFileSafe(path.join(workingTreeDir, rel)),
|
|
120
|
+
readFileSafe(path.join(branchDir, rel)),
|
|
121
|
+
]);
|
|
122
|
+
if (!a || !b)
|
|
123
|
+
continue;
|
|
124
|
+
if (!a.equals(b))
|
|
125
|
+
changed.push(rel);
|
|
126
|
+
}
|
|
127
|
+
changed.sort();
|
|
128
|
+
return { added, removed, changed };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Copy working-tree content into a branch workspace and commit it. Prompt-free — the interactive CLI
|
|
132
|
+
* (`canopycms sync push`) calls this for the actual copy + commit + tag step.
|
|
133
|
+
*
|
|
134
|
+
* Returns the number of changed files committed (0 when content was already up to date).
|
|
135
|
+
*/
|
|
136
|
+
export async function pushContentToWorkspace(options) {
|
|
137
|
+
const { srcContentDir, branchPath, contentRoot, commitMessage, baseTag } = options;
|
|
138
|
+
if (!(await filePathExists(srcContentDir))) {
|
|
139
|
+
return { fileCount: 0 };
|
|
140
|
+
}
|
|
141
|
+
const wsContentDir = path.join(branchPath, contentRoot);
|
|
142
|
+
assertWithinDir(wsContentDir, branchPath, 'content-root');
|
|
143
|
+
// Copy into a temp dir, then atomically swap it into place.
|
|
144
|
+
const tmpDir = `${wsContentDir}.sync-tmp-${Date.now()}`;
|
|
145
|
+
try {
|
|
146
|
+
await copyDir(srcContentDir, tmpDir);
|
|
147
|
+
await safeReplaceDir(wsContentDir, tmpDir);
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
await fs.rm(tmpDir, { recursive: true, force: true }).catch(() => { });
|
|
151
|
+
throw err;
|
|
152
|
+
}
|
|
153
|
+
const wsGit = simpleGit({ baseDir: branchPath });
|
|
154
|
+
await wsGit.add('-A');
|
|
155
|
+
const postStatus = await wsGit.status();
|
|
156
|
+
if (postStatus.files.length === 0) {
|
|
157
|
+
if (baseTag)
|
|
158
|
+
await wsGit.tag(['-f', baseTag]);
|
|
159
|
+
return { fileCount: 0 };
|
|
160
|
+
}
|
|
161
|
+
await wsGit.commit(commitMessage ?? 'sync: update content from working tree');
|
|
162
|
+
if (baseTag)
|
|
163
|
+
await wsGit.tag(['-f', baseTag]);
|
|
164
|
+
return { fileCount: postStatus.files.length };
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=sync-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-core.js","sourceRoot":"","sources":["../src/sync-core.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACjC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAA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AU,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAA;IAEvC,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,IAAI,OAAO;YAAE,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;QAC7C,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,CAAA;IACzB,CAAC;IAED,MAAM,KAAK,CAAC,MAAM,CAAC,aAAa,IAAI,wCAAwC,CAAC,CAAA;IAC7E,IAAI,OAAO;QAAE,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;IAE7C,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAA;AAC/C,CAAC"}
|
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.41",
|
|
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": {
|
|
@@ -61,6 +61,10 @@
|
|
|
61
61
|
"import": "./dist/build/index.js",
|
|
62
62
|
"types": "./dist/build/index.d.ts"
|
|
63
63
|
},
|
|
64
|
+
"./utils/error": {
|
|
65
|
+
"import": "./dist/utils/error.js",
|
|
66
|
+
"types": "./dist/utils/error.d.ts"
|
|
67
|
+
},
|
|
64
68
|
"./test-utils": {
|
|
65
69
|
"import": "./dist/test-utils/index.js",
|
|
66
70
|
"types": "./dist/test-utils/index.d.ts"
|