canopycms 0.0.9 → 0.0.10

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.
@@ -7,7 +7,8 @@ import type { CanopyConfig } from '../config';
7
7
  * Resolve the branch root directory for reading content.
8
8
  *
9
9
  * - Dev mode: current working directory (content is in the checkout)
10
- * - Prod/prod-sim: load the default base branch context
10
+ * - Static deployment: current working directory (content is in the checkout)
11
+ * - Prod/prod-sim server: load the default base branch context
11
12
  */
12
13
  export declare function resolveBranchRoot(config: CanopyConfig): Promise<string>;
13
14
  //# sourceMappingURL=resolve-branch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-branch.d.ts","sourceRoot":"","sources":["../../src/ai/resolve-branch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB7E"}
1
+ {"version":3,"file":"resolve-branch.d.ts","sourceRoot":"","sources":["../../src/ai/resolve-branch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB7E"}
@@ -3,14 +3,16 @@
3
3
  * Used by both the route handler and build utility.
4
4
  */
5
5
  import { loadBranchContext } from '../branch-metadata';
6
+ import { isDeployedStatic } from '../build-mode';
6
7
  /**
7
8
  * Resolve the branch root directory for reading content.
8
9
  *
9
10
  * - Dev mode: current working directory (content is in the checkout)
10
- * - Prod/prod-sim: load the default base branch context
11
+ * - Static deployment: current working directory (content is in the checkout)
12
+ * - Prod/prod-sim server: load the default base branch context
11
13
  */
12
14
  export async function resolveBranchRoot(config) {
13
- if (config.mode === 'dev') {
15
+ if (config.mode === 'dev' || isDeployedStatic(config)) {
14
16
  return process.cwd();
15
17
  }
16
18
  const baseBranch = config.defaultBaseBranch ?? 'main';
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-branch.js","sourceRoot":"","sources":["../../src/ai/resolve-branch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAGtD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAoB;IAC1D,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QAC1B,OAAO,OAAO,CAAC,GAAG,EAAE,CAAA;IACtB,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,iBAAiB,IAAI,MAAM,CAAA;IACrD,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC;QACtC,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB,CAAC,CAAA;IAEF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,sCAAsC,UAAU,KAAK;YACnD,oDAAoD,CACvD,CAAA;IACH,CAAC;IAED,OAAO,OAAO,CAAC,UAAU,CAAA;AAC3B,CAAC"}
1
+ {"version":3,"file":"resolve-branch.js","sourceRoot":"","sources":["../../src/ai/resolve-branch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAGhD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAoB;IAC1D,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,OAAO,OAAO,CAAC,GAAG,EAAE,CAAA;IACtB,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,iBAAiB,IAAI,MAAM,CAAA;IACrD,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC;QACtC,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB,CAAC,CAAA;IAEF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,sCAAsC,UAAU,KAAK;YACnD,oDAAoD,CACvD,CAAA;IACH,CAAC;IAED,OAAO,OAAO,CAAC,UAAU,CAAA;AAC3B,CAAC"}
@@ -2593,9 +2593,21 @@ var loadBranchContext = async (options) => {
2593
2593
  };
2594
2594
  };
2595
2595
 
2596
+ // dist/build-mode.js
2597
+ var isDeployedStatic = (config) => {
2598
+ return config.deployedAs === "static";
2599
+ };
2600
+ var STATIC_DEPLOY_USER = Object.freeze({
2601
+ type: "authenticated",
2602
+ userId: "__static_deploy__",
2603
+ groups: ["Admins"],
2604
+ email: "static-deploy@canopycms",
2605
+ name: "Static Deploy"
2606
+ });
2607
+
2596
2608
  // dist/ai/resolve-branch.js
2597
2609
  async function resolveBranchRoot(config) {
2598
- if (config.mode === "dev") {
2610
+ if (config.mode === "dev" || isDeployedStatic(config)) {
2599
2611
  return process.cwd();
2600
2612
  }
2601
2613
  const baseBranch = config.defaultBaseBranch ?? "main";
package/dist/cli/init.js CHANGED
@@ -3391,9 +3391,27 @@ var init_branch_metadata = __esm({
3391
3391
  }
3392
3392
  });
3393
3393
 
3394
+ // dist/build-mode.js
3395
+ var isDeployedStatic, STATIC_DEPLOY_USER;
3396
+ var init_build_mode = __esm({
3397
+ "dist/build-mode.js"() {
3398
+ "use strict";
3399
+ isDeployedStatic = (config) => {
3400
+ return config.deployedAs === "static";
3401
+ };
3402
+ STATIC_DEPLOY_USER = Object.freeze({
3403
+ type: "authenticated",
3404
+ userId: "__static_deploy__",
3405
+ groups: ["Admins"],
3406
+ email: "static-deploy@canopycms",
3407
+ name: "Static Deploy"
3408
+ });
3409
+ }
3410
+ });
3411
+
3394
3412
  // dist/ai/resolve-branch.js
3395
3413
  async function resolveBranchRoot(config) {
3396
- if (config.mode === "dev") {
3414
+ if (config.mode === "dev" || isDeployedStatic(config)) {
3397
3415
  return process.cwd();
3398
3416
  }
3399
3417
  const baseBranch = config.defaultBaseBranch ?? "main";
@@ -3410,6 +3428,7 @@ var init_resolve_branch = __esm({
3410
3428
  "dist/ai/resolve-branch.js"() {
3411
3429
  "use strict";
3412
3430
  init_branch_metadata();
3431
+ init_build_mode();
3413
3432
  }
3414
3433
  });
3415
3434
 
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.9",
4
+ "version": "0.0.10",
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": {